Class SphericalOrientation
java.lang.Object
com.victorvalentim.zividomelive.render.SphericalOrientation
Gimbal-lock-free spherical orientation controlled by cyclic pitch, yaw, and roll values.
The three values are cyclic control accumulators, not an Euler decomposition of the current attitude. Each value change is converted to the shortest angular delta and composed directly into a unit quaternion in event order. Getter values report the most recently accepted control values.
getQuaternion() returns an immutable value, so callers cannot mutate orientation
state through the result.
API stability: Advanced Stable.
- Since:
- 2.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an identity orientation with all control accumulators at zero. -
Method Summary
Modifier and TypeMethodDescriptionfloatgetPitch()Returns the pitch control accumulator.Returns the current immutable unit quaternion.floatgetRoll()Returns the roll control accumulator.floatgetYaw()Returns the yaw control accumulator.voidreset()Restores the identity quaternion and zeroes all control accumulators.voidsetPitch(float value) Applies a pitch change around the current local X axis.voidsetRoll(float value) Applies a roll change around the current local Y axis.voidsetYaw(float value) Applies a yaw change around the current local Z axis.
-
Constructor Details
-
SphericalOrientation
public SphericalOrientation()Creates an identity orientation with all control accumulators at zero.
-
-
Method Details
-
setPitch
public void setPitch(float value) Applies a pitch change around the current local X axis.- Parameters:
value- pitch control value in radians; non-finite values are ignored
-
setYaw
public void setYaw(float value) Applies a yaw change around the current local Z axis.- Parameters:
value- yaw control value in radians; non-finite values are ignored
-
setRoll
public void setRoll(float value) Applies a roll change around the current local Y axis.- Parameters:
value- roll control value in radians; non-finite values are ignored
-
getPitch
public float getPitch()Returns the pitch control accumulator.- Returns:
- pitch control value in radians
-
getYaw
public float getYaw()Returns the yaw control accumulator.- Returns:
- yaw control value in radians
-
getRoll
public float getRoll()Returns the roll control accumulator.- Returns:
- roll control value in radians
-
getQuaternion
Returns the current immutable unit quaternion.- Returns:
- current spherical orientation
-
reset
public void reset()Restores the identity quaternion and zeroes all control accumulators.
-