Package eu.svjatoslav.sixth.e3d.gui
Class Avatar
java.lang.Object
eu.svjatoslav.sixth.e3d.gui.Avatar
- All Implemented Interfaces:
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 Summary
FieldsModifier and TypeFieldDescriptiondoublestatic final doubleAvatar movement speed, relative to the world. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbeforeRender(ViewPanel viewPanel, int millisecondsSinceLastFrame) 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.voiddoubledoubledoublevoidsetAngleXZ(double angleXZ) voidsetAngleYZ(double angleYZ) voidsetLocation(Point3D location)
-
Field Details
-
SPEED_LIMIT
public static final double SPEED_LIMITAvatar 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
-
Avatar
-
Avatar
-
-
Method Details
-
beforeRender
Description copied from interface:ViewRenderListenerNotifies 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
ViewRenderListenerwill be notified exactly once before every frame is rendered.ViewRenderListenercan 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:
beforeRenderin interfaceViewRenderListener- Returns:
trueif underlying view shall be re-rendered. If at least one of the view update listeners returnstrue, 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
-
setLocation
-
getMovementVector
-
getMovementSpeed
public double getMovementSpeed()
-