Package ch.epfl.cs107.play.math
Class Node
java.lang.Object
ch.epfl.cs107.play.math.Node
- All Implemented Interfaces:
Attachable,Positionable
- Direct Known Subclasses:
ImageGraphics,ShapeGraphics,SwingWindow,TextGraphics
Simple attachable object.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetParent(Positionable parent) Chooses reference object.voidsetRelativeTransform(Transform transform) Sets relative affine transformation.
-
Constructor Details
-
Node
public Node()Creates a new node at origin.
-
-
Method Details
-
setParent
Description copied from interface:AttachableChooses reference object.- Specified by:
setParentin interfaceAttachable- Parameters:
parent- (Positionable): any positionable, may be null
-
getParent
- Specified by:
getParentin interfaceAttachable- Returns:
- (Positionable): reference object, may be null
-
getRelativeTransform
- Specified by:
getRelativeTransformin interfaceAttachable- Returns:
- (Transform): relative affine transformation, not null
-
setRelativeTransform
Description copied from interface:AttachableSets relative affine transformation.- Specified by:
setRelativeTransformin interfaceAttachable- Parameters:
transform- (Transform): any transform, not null
-
getTransform
- Specified by:
getTransformin interfacePositionable- Returns:
- (Transform): affine transform, not null
-
getPosition
- Specified by:
getPositionin interfacePositionable- Returns:
- (Vector): origin, not null
-
getVelocity
- Specified by:
getVelocityin interfacePositionable- Returns:
- (Vector): linear velocity, not null
-