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
Modifier and TypeFieldDescriptiondouble
static final double
Avatar movement speed, relative to the world. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
beforeRender
(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.void
double
double
double
void
setAngleXZ
(double angleXZ) void
setAngleYZ
(double angleYZ) void
setLocation
(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: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 interfaceViewRenderListener
- Returns:
true
if 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()
-