Package com.io7m.jcamera
Class JCameraSpherical
java.lang.Object
com.io7m.jcamera.JCameraSpherical
- All Implemented Interfaces:
JCameraReadableType,JCameraSphericalReadableType,JCameraSphericalType,JCameraType
@EqualityStructural
public final class JCameraSpherical
extends Object
implements JCameraSphericalType
The default implementation of
JCameraSphericalType.-
Method Summary
Modifier and TypeMethodDescriptionvoidDo not clamp rotations around the horizontal axis.voidcameraClampInclineEnable(double min, double max) Clamp the possible rotations around the horizontal axis to the given bounds.voidDo not clamp the length of the radius.voidcameraClampRadiusEnable(double min, double max) Clamp the length of the radius to the given bounds.doubledoublecom.io7m.jtensors.core.unparameterized.vectors.Vector3Dcom.io7m.jtensors.core.unparameterized.vectors.Vector3Dcom.io7m.jtensors.core.unparameterized.vectors.Vector3Dcom.io7m.jtensors.core.unparameterized.vectors.Vector3Dcom.io7m.jtensors.core.unparameterized.vectors.Vector3Dcom.io7m.jtensors.core.unparameterized.vectors.Vector3Ddoublecom.io7m.jtensors.core.unparameterized.matrices.Matrix4x4DConstruct a view matrix for the camera.<T0,T1> com.io7m.jtensors.core.parameterized.matrices.PMatrix4x4D<T0, T1> Construct a view matrix for the camera.voidcameraMoveTargetForwardOnXZ(double u) Move the target point of the camera forwarduunits iffuis positive, or backwarduunits iffuis negative.voidcameraMoveTargetRight(double u) Move the target point of the camera rightuunits iffuis positive, or leftuunits iffuis negative.voidcameraMoveTargetUp(double u) Move the target point of the camera upuunits iffuis positive, or downuunits iffuis negative.voidcameraOrbitHeading(double r) booleancameraOrbitIncline(double r) voidcameraSetAngleHeading(double v) Set the heading angle toa.voidcameraSetAngleIncline(double h) Set the incline angle toa.voidcameraSetTargetPosition(com.io7m.jtensors.core.unparameterized.vectors.Vector3D v) Set the position of the target point of camera.voidcameraSetTargetPosition3(double x, double y, double z) Set the position of the target point of camera.voidcameraSetZoom(double r) Set the zoom (or radius) of the camera tor.booleancameraZoomIn(double r) Zoom in the camera by reducing the radius of the sphere.booleancameraZoomOut(double r) Zoom out the camera by increasing the radius of the sphere.booleaninthashCode()static JCameraSphericalTypestatic JCameraSphericalTypetoString()
-
Method Details
-
newCamera
- Returns:
- A new spherical camera.
-
newCameraFrom
- Parameters:
c- An existing camera- Returns:
- A new camera based on the given camera.
-
cameraClampInclineDisable
public void cameraClampInclineDisable()Description copied from interface:JCameraSphericalTypeDo not clamp rotations around the horizontal axis.- Specified by:
cameraClampInclineDisablein interfaceJCameraSphericalType- See Also:
-
cameraClampInclineEnable
public void cameraClampInclineEnable(double min, double max) Description copied from interface:JCameraSphericalTypeClamp the possible rotations around the horizontal axis to the given bounds.- Specified by:
cameraClampInclineEnablein interfaceJCameraSphericalType- Parameters:
min- The minimum anglemax- The maximum angle
-
cameraClampRadiusDisable
public void cameraClampRadiusDisable()Description copied from interface:JCameraSphericalTypeDo not clamp the length of the radius.- Specified by:
cameraClampRadiusDisablein interfaceJCameraSphericalType- See Also:
-
cameraClampRadiusEnable
public void cameraClampRadiusEnable(double min, double max) Description copied from interface:JCameraSphericalTypeClamp the length of the radius to the given bounds.- Specified by:
cameraClampRadiusEnablein interfaceJCameraSphericalType- Parameters:
min- The minimum lengthmax- The maximum length
-
cameraGetAngleHeading
public double cameraGetAngleHeading()- Specified by:
cameraGetAngleHeadingin interfaceJCameraSphericalReadableType- Returns:
- The angle around the vertical axis.
-
cameraGetAngleIncline
public double cameraGetAngleIncline()- Specified by:
cameraGetAngleInclinein interfaceJCameraSphericalReadableType- Returns:
- The angle around the horizontal axis.
-
cameraGetForward
public com.io7m.jtensors.core.unparameterized.vectors.Vector3D cameraGetForward()- Specified by:
cameraGetForwardin interfaceJCameraSphericalReadableType- Returns:
- The forward direction for the camera.
-
cameraGetForwardProjectedOnXZ
public com.io7m.jtensors.core.unparameterized.vectors.Vector3D cameraGetForwardProjectedOnXZ()- Specified by:
cameraGetForwardProjectedOnXZin interfaceJCameraSphericalReadableType- Returns:
- The forward direction for the camera, projected onto the X/Z plane.
-
cameraGetPosition
public com.io7m.jtensors.core.unparameterized.vectors.Vector3D cameraGetPosition()- Specified by:
cameraGetPositionin interfaceJCameraSphericalReadableType- Returns:
- The position of the camera.
-
cameraGetRight
public com.io7m.jtensors.core.unparameterized.vectors.Vector3D cameraGetRight()- Specified by:
cameraGetRightin interfaceJCameraSphericalReadableType- Returns:
- The right direction for the camera.
-
cameraGetTargetPosition
public com.io7m.jtensors.core.unparameterized.vectors.Vector3D cameraGetTargetPosition()- Specified by:
cameraGetTargetPositionin interfaceJCameraSphericalReadableType- Returns:
- The position of the camera target.
-
cameraGetUp
public com.io7m.jtensors.core.unparameterized.vectors.Vector3D cameraGetUp()- Specified by:
cameraGetUpin interfaceJCameraSphericalReadableType- Returns:
- The up direction for the camera.
-
cameraGetZoom
public double cameraGetZoom()- Specified by:
cameraGetZoomin interfaceJCameraSphericalReadableType- Returns:
- The zoom (or radius) of the camera.
-
cameraMakeViewMatrix
public com.io7m.jtensors.core.unparameterized.matrices.Matrix4x4D cameraMakeViewMatrix()Description copied from interface:JCameraReadableTypeConstruct a view matrix for the camera.- Specified by:
cameraMakeViewMatrixin interfaceJCameraReadableType- Returns:
- A view matrix for the camera
-
cameraMakeViewPMatrix
public <T0,T1> com.io7m.jtensors.core.parameterized.matrices.PMatrix4x4D<T0,T1> cameraMakeViewPMatrix()Description copied from interface:JCameraReadableTypeConstruct a view matrix for the camera.- Specified by:
cameraMakeViewPMatrixin interfaceJCameraReadableType- Type Parameters:
T0- The source coordinate systemT1- The target coordiante system- Returns:
- A view matrix for the camera
-
cameraMoveTargetForwardOnXZ
public void cameraMoveTargetForwardOnXZ(double u) Description copied from interface:JCameraSphericalTypeMove the target point of the camera forward
uunits iffuis positive, or backwarduunits iffuis negative.The forward direction, in this case, means the current view direction projected onto the X/Z plane. This means that the camera will not move along the Y axis.
- Specified by:
cameraMoveTargetForwardOnXZin interfaceJCameraSphericalType- Parameters:
u- The units to move
-
cameraMoveTargetRight
public void cameraMoveTargetRight(double u) Description copied from interface:JCameraSphericalTypeMove the target point of 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.- Specified by:
cameraMoveTargetRightin interfaceJCameraSphericalType- Parameters:
u- The units to move
-
cameraMoveTargetUp
public void cameraMoveTargetUp(double u) Description copied from interface:JCameraSphericalTypeMove the target point of 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.
- Specified by:
cameraMoveTargetUpin interfaceJCameraSphericalType- Parameters:
u- The units to move
-
cameraOrbitHeading
public void cameraOrbitHeading(double r) - Specified by:
cameraOrbitHeadingin interfaceJCameraSphericalType- Parameters:
r- The radians to rotate
-
cameraOrbitIncline
public boolean cameraOrbitIncline(double r) - Specified by:
cameraOrbitInclinein interfaceJCameraSphericalType- Parameters:
r- The radians to orbit- Returns:
trueif the rotation has been clamped- See Also:
-
cameraSetAngleHeading
public void cameraSetAngleHeading(double v) Description copied from interface:JCameraSphericalTypeSet the heading angle toa.- Specified by:
cameraSetAngleHeadingin interfaceJCameraSphericalType- Parameters:
v- The angle.
-
cameraSetAngleIncline
public void cameraSetAngleIncline(double h) Description copied from interface:JCameraSphericalTypeSet the incline angle toa.- Specified by:
cameraSetAngleInclinein interfaceJCameraSphericalType- Parameters:
h- The angle.
-
cameraSetTargetPosition
public void cameraSetTargetPosition(com.io7m.jtensors.core.unparameterized.vectors.Vector3D v) Description copied from interface:JCameraSphericalTypeSet the position of the target point of camera.- Specified by:
cameraSetTargetPositionin interfaceJCameraSphericalType- Parameters:
v- The position.
-
cameraSetTargetPosition3
public void cameraSetTargetPosition3(double x, double y, double z) Description copied from interface:JCameraSphericalTypeSet the position of the target point of camera.- Specified by:
cameraSetTargetPosition3in interfaceJCameraSphericalType- Parameters:
x- The x coordinate.y- The y coordinate.z- The z coordinate.
-
cameraSetZoom
public void cameraSetZoom(double r) Description copied from interface:JCameraSphericalTypeSet the zoom (or radius) of the camera tor.- Specified by:
cameraSetZoomin interfaceJCameraSphericalType- Parameters:
r- The camera radius.
-
cameraZoomIn
public boolean cameraZoomIn(double r) Description copied from interface:JCameraSphericalTypeZoom in the camera by reducing the radius of the sphere.- Specified by:
cameraZoomInin interfaceJCameraSphericalType- Parameters:
r- The amount by which to reduce the radius- Returns:
trueif the radius has been clamped- See Also:
-
cameraZoomOut
public boolean cameraZoomOut(double r) Description copied from interface:JCameraSphericalTypeZoom out the camera by increasing the radius of the sphere.- Specified by:
cameraZoomOutin interfaceJCameraSphericalType- Parameters:
r- The amount by which to increase the radius- Returns:
trueif the radius has been clamped- See Also:
-
equals
-
hashCode
public int hashCode() -
toString
-