Interface JCameraFPSStyleType
- All Superinterfaces:
JCameraFPSStyleReadableType,JCameraReadableType,JCameraType
- All Known Implementing Classes:
JCameraFPSStyle
The type of first-person shooter style flying cameras that allow for:
- Rotation around a local X axis
- Rotation around a global Y axis
- Movement up and down on the global Y axis
- Movement left and right on the local X axis
- Movement forward and backward based on the current orientation on the global Y and local X axes
-
Method Summary
Modifier and TypeMethodDescriptionvoidDo not clamp rotations around the horizontal axis.voidcameraClampHorizontalEnable(double min, double max) Clamp the possible rotations around the horizontal axis to the given bounds.voidcameraMoveForward(double u) Move the camera forwarduunits iffuis positive, or backwarduunits iffuis negative.voidcameraMoveRight(double u) Move the camera rightuunits iffuis positive, or leftuunits iffuis negative.voidcameraMoveUp(double u) Move the camera upuunits iffuis positive, or downuunits iffuis negative.booleancameraRotateAroundHorizontal(double r) Rotate byrradians around the local X axis.voidcameraRotateAroundVertical(double r) Rotate byrradians around the global Y axis.voidcameraSetAngleAroundHorizontal(double h) Set the angle around the horizontal axis toh.voidcameraSetAngleAroundVertical(double v) Set the angle around the vertical axis tov.voidcameraSetPosition(com.io7m.jtensors.core.unparameterized.vectors.Vector3D v) Set the position of the camera.voidcameraSetPosition3(double x, double y, double z) Set the position of the camera.Methods inherited from interface com.io7m.jcamera.JCameraFPSStyleReadableType
cameraGetAngleAroundHorizontal, cameraGetAngleAroundVertical, cameraGetForward, cameraGetPosition, cameraGetRight, cameraGetUpMethods inherited from interface com.io7m.jcamera.JCameraReadableType
cameraMakeViewMatrix, cameraMakeViewPMatrix
-
Method Details
-
cameraClampHorizontalDisable
void cameraClampHorizontalDisable()Do not clamp rotations around the horizontal axis. -
cameraClampHorizontalEnable
void cameraClampHorizontalEnable(double min, double max) Clamp the possible rotations around the horizontal axis to the given bounds.- Parameters:
min- The minimum anglemax- The maximum angle
-
cameraMoveForward
void cameraMoveForward(double u) Move the camera forward
uunits iffuis positive, or backwarduunits iffuis negative.The forward direction, in this case, means the current view direction.
- Parameters:
u- The units to move
-
cameraMoveRight
void cameraMoveRight(double u) Move the camera right
uunits iffuis positive, or leftuunits iffuis negative.The right direction, in this case, means the direction perpendicular to the current view direction,
-π / 2radians around the global Y axis.- Parameters:
u- The units to move
-
cameraMoveUp
void cameraMoveUp(double u) Move the camera up
uunits iffuis positive, or downuunits iffuis negative.The up direction, in this case, means the direction towards positive infinity on the global Y axis.
- Parameters:
u- The units to move
-
cameraRotateAroundHorizontal
boolean cameraRotateAroundHorizontal(double r) Rotate by
rradians around the local X axis.Note that by convention, when looking towards negative infinity on an axis, a positive rotation value results in a counter-clockwise rotation on the axis.
A human analogy would be that a positive value passed to this function causes the camera to look up towards the sky. A negative value causes the camera to look down towards the ground.
- Parameters:
r- The radians to rotate- Returns:
trueif the rotation has been clamped- See Also:
-
cameraRotateAroundVertical
void cameraRotateAroundVertical(double r) Rotate by
rradians around the global Y axis.Note that by convention, when looking towards negative infinity on an axis, a positive rotation value results in a counter-clockwise rotation on the axis.
A human analogy would be that a positive value passed to this function causes the camera to turn left, while a negative value causes the camera to look right.
- Parameters:
r- The radians to rotate
-
cameraSetAngleAroundHorizontal
void cameraSetAngleAroundHorizontal(double h) Set the angle around the horizontal axis toh.- Parameters:
h- The angle.
-
cameraSetAngleAroundVertical
void cameraSetAngleAroundVertical(double v) Set the angle around the vertical axis tov.- Parameters:
v- The angle.
-
cameraSetPosition
void cameraSetPosition(com.io7m.jtensors.core.unparameterized.vectors.Vector3D v) Set the position of the camera.- Parameters:
v- The position.
-
cameraSetPosition3
void cameraSetPosition3(double x, double y, double z) Set the position of the camera.- Parameters:
x- The x coordinate.y- The y coordinate.z- The z coordinate.
-