Package com.j3d.engine.math.rot
Class CamToWorldDirection
java.lang.Object
com.j3d.engine.math.rot.CamToWorldDirection
- All Implemented Interfaces:
RotationMatrixDirection
Implements the
RotationMatrixDirection interface to create rotation matrices
that transform a direction from camera space to world space.
This is the standard transformation used to orient an object (like a camera) in the world. For example, applying these rotations to a base "forward" vector (e.g., [0, 0, 1]) will point it in the correct direction in the world scene.
The order of multiplication typically matters. For a standard Tait-Bryan rotation (yaw, pitch, roll),
the combined matrix would be M = Yaw * Pitch * Roll.
- Author:
- Lehlogonolo Poole
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCamToWorldDirection(double pitch, double yaw, double roll) Constructs a newCamToWorldDirectiontransformer. -
Method Summary
-
Field Details
-
pitch
private final double pitch -
yaw
private final double yaw -
roll
private final double roll
-
-
Constructor Details
-
CamToWorldDirection
public CamToWorldDirection(double pitch, double yaw, double roll) Constructs a newCamToWorldDirectiontransformer.- Parameters:
pitch- The pitch angle in radians (rotation around the X-axis).yaw- The yaw angle in radians (rotation around the Y-axis).roll- The roll angle in radians (rotation around the Z-axis).
-
-
Method Details
-
rotPitch
Creates a standard rotation matrix for pitch (rotation around the X-axis).- Specified by:
rotPitchin interfaceRotationMatrixDirection- Returns:
- A 3x3
MatrixInterfacefor pitch rotation.
-
rotYaw
Creates a standard rotation matrix for yaw (rotation around the Y-axis).- Specified by:
rotYawin interfaceRotationMatrixDirection- Returns:
- A 3x3
MatrixInterfacefor yaw rotation.
-
rotRoll
Creates a standard rotation matrix for roll (rotation around the Z-axis).- Specified by:
rotRollin interfaceRotationMatrixDirection- Returns:
- A 3x3
MatrixInterfacefor roll rotation.
-
matrix
- Specified by:
matrixin interfaceRotationMatrixDirection
-