Class Node

java.lang.Object
ch.epfl.cs107.play.math.Node
All Implemented Interfaces:
Attachable, Positionable
Direct Known Subclasses:
ImageGraphics, ShapeGraphics, SwingWindow, TextGraphics

public class Node extends Object implements Attachable
Simple attachable object.
  • Constructor Details

    • Node

      public Node()
      Creates a new node at origin.
  • Method Details

    • setParent

      public void setParent(Positionable parent)
      Description copied from interface: Attachable
      Chooses reference object.
      Specified by:
      setParent in interface Attachable
      Parameters:
      parent - (Positionable): any positionable, may be null
    • getParent

      public Positionable getParent()
      Specified by:
      getParent in interface Attachable
      Returns:
      (Positionable): reference object, may be null
    • getRelativeTransform

      public Transform getRelativeTransform()
      Specified by:
      getRelativeTransform in interface Attachable
      Returns:
      (Transform): relative affine transformation, not null
    • setRelativeTransform

      public void setRelativeTransform(Transform transform)
      Description copied from interface: Attachable
      Sets relative affine transformation.
      Specified by:
      setRelativeTransform in interface Attachable
      Parameters:
      transform - (Transform): any transform, not null
    • getTransform

      public Transform getTransform()
      Specified by:
      getTransform in interface Positionable
      Returns:
      (Transform): affine transform, not null
    • getPosition

      public Vector getPosition()
      Specified by:
      getPosition in interface Positionable
      Returns:
      (Vector): origin, not null
    • getVelocity

      public Vector getVelocity()
      Specified by:
      getVelocity in interface Positionable
      Returns:
      (Vector): linear velocity, not null