Class Avatar

java.lang.Object
eu.svjatoslav.sixth.e3d.gui.Avatar
All Implemented Interfaces:
ViewRenderListener

public class Avatar extends Object implements ViewRenderListener
The avatar is a user-controlled object in the 3D world. It is a point in space that can be moved around by the user. It has orientation in space, and it can also be rotated around.
  • Field Details

    • SPEED_LIMIT

      public static final double SPEED_LIMIT
      Avatar movement speed, relative to the world. When avatar coordinates are updated within the world, avatar orientation relative to the world is taken into account.
      See Also:
    • avatarAcceleration

      public double avatarAcceleration
  • Constructor Details

    • Avatar

      public Avatar()
    • Avatar

      public Avatar(Avatar sourceView)
    • Avatar

      public Avatar(Point3D location)
    • Avatar

      public Avatar(Point3D location, float angleXZ, float angleYZ)
  • Method Details

    • beforeRender

      public boolean beforeRender(ViewPanel viewPanel, int millisecondsSinceLastFrame)
      Description copied from interface: ViewRenderListener
      Notifies that it is about time (to keep constant framerate) to render next frame and allows listener to do any related processing that it needs to.

      Each ViewRenderListener will be notified exactly once before every frame is rendered.

      ViewRenderListener can determine if frame repaint is actually needed from its perspective. Frame will be rendered only if at least one listener says yes. This mechanism allows to save computing power and energy by skipping frame rendering when possible.

      Specified by:
      beforeRender in interface ViewRenderListener
      Returns:
      true if underlying view shall be re-rendered. If at least one of the view update listeners returns true, view is re-rendered.
    • enforceSpeedLimit

      public void enforceSpeedLimit()
    • getAngleXZ

      public double getAngleXZ()
    • setAngleXZ

      public void setAngleXZ(double angleXZ)
    • getAngleYZ

      public double getAngleYZ()
    • setAngleYZ

      public void setAngleYZ(double angleYZ)
    • getLocation

      public Point3D getLocation()
    • setLocation

      public void setLocation(Point3D location)
    • getMovementVector

      public Point3D getMovementVector()
    • getMovementSpeed

      public double getMovementSpeed()