Package eu.svjatoslav.sixth.e3d.gui
Class UserRelativityTracker
java.lang.Object
eu.svjatoslav.sixth.e3d.gui.UserRelativityTracker
Tracks the position of the user in the 3D space.
It can be used to determine the angle between the user and the object. Also, it can be used to determine the distance between the user and the object.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
analyze
(TransformsStack transformPipe, RenderingContext renderingContext) void
Initializes the orientation tracking.double
Calculates the angle between the user and the object in the XY plane.double
Calculates the angle between the user and the object in the XZ plane.double
Calculates the angle between the user and the object in the YZ plane.double
Calculates the distance between the user and the object.double
-
Field Details
-
center
Points to 0, 0, 0 in object own relative space. -
right
Points to 10, 0, 0 in object own relative space if orientation tracking is enabled. It is used to determine the angle between the user and the object. -
down
Points to 0, 10, 0 in object own relative space if orientation tracking is enabled. It is used to determine the angle between the user and the object.
-
-
Constructor Details
-
UserRelativityTracker
public UserRelativityTracker()
-
-
Method Details
-
analyze
-
enableOrientationTracking
public void enableOrientationTracking()Initializes the orientation tracking. Orientation tracking is used to determine the angle between the user and the object. Orientation tracking is disabled by default and it is optional. -
getAngleXY
public double getAngleXY()Calculates the angle between the user and the object in the XY plane.- Returns:
- the angle between the user and the object in the XY plane.
-
getAngleXZ
public double getAngleXZ()Calculates the angle between the user and the object in the XZ plane.- Returns:
- the angle between the user and the object in the XZ plane.
-
getAngleYZ
public double getAngleYZ()Calculates the angle between the user and the object in the YZ plane.- Returns:
- the angle between the user and the object in the YZ plane.
-
getDistanceToUser
public double getDistanceToUser()Calculates the distance between the user and the object. Distance to the user can be used to determine object detail level. -
proposeSliceFactor
public double proposeSliceFactor()
-