Package rosequartz.gfx
Class CameraConfiguration
java.lang.Object
rosequartz.gfx.CameraConfiguration
- All Implemented Interfaces:
Serializable,Cloneable
Represents the position and orientation of a camera or audio listener.
- See Also:
- Serialized Form
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceInterface for classes that use the CameraConfiguration for configuration. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new CameraConfiguration at [0, 0, 0] looking at the point [0, 0, -1] with [0, 1, 0] pointing 'up'.CameraConfiguration(CameraConfiguration source)Creates a new CameraConfiguration from another camera configuration to copy its values from. -
Method Summary
Modifier and TypeMethodDescriptionclone()copyValues(CameraConfiguration source)Copies the values of a given configuration into this.Returns a point that the configuration is looking at.floatReturns the x-axis of a point that the configuration is looking at.floatReturns the y-axis of a point that the configuration is looking at.floatReturns the z-axis of a point that the configuration is looking at.Returns a vector describing where the configuration is looking.floatReturns the x-axis of a vector describing where the configuration is looking.floatReturns the y-axis of a vector describing where the configuration is looking.floatReturns the z-axis of a vector describing where the configuration is looking.Returns a vector describing where 'up' is relative to the camera.floatReturns the x-axis of a vector describing where 'up' is relative to the camera.floatReturns the y-axis of a vector describing where 'up' is relative to the camera.floatReturns the z-axis of a vector describing where 'up' is relative to the camera.Gets the position.floatGets the position on the x-axis.floatGets the position on the y-axis.floatGets the position on the z-axis.setLookAt(float x, float y, float z)Sets the configuration to look at a given point (aligns -z to go through the point).setLookAt(float x, float y, float z, float upX, float upY, float upZ)Sets the configuration to look at a given point (aligns -z to go through the point), with a given vector pointing where 'up' is.Sets the configuration to look at a given point (aligns -z to go through the point).Sets the configuration to look at a given point (aligns -z to go through the point), with a given vector pointing where 'up' is.setLookIn(float x, float y, float z)Sets the configuration to look in the direction of a given vector.setLookIn(float x, float y, float z, float upX, float upY, float upZ)Sets the configuration to look in the direction of a given vector, with a given vector pointing where 'up' is.Sets the configuration to look in the direction of a given vector.Sets the configuration to look in the direction of a given vector, with a given vector pointing where 'up' is.setLookUp(float upX, float upY, float upZ)Sets the direction of 'up' to a given vector.Sets the direction of 'up' to a given vector.setPosition(float x, float y, float z)Sets the position.setPosition(Vec3 xyz)Sets the position.setPositionRelative(float dx, float dy, float dz)Sets the position relative to the current position.setPositionRelative(Vec3 dxyz)Sets the position relative to the current position.toString()
-
Constructor Details
-
CameraConfiguration
public CameraConfiguration()Creates a new CameraConfiguration at [0, 0, 0] looking at the point [0, 0, -1] with [0, 1, 0] pointing 'up'. -
CameraConfiguration
Creates a new CameraConfiguration from another camera configuration to copy its values from.
-
-
Method Details
-
setPosition
Sets the position.- Parameters:
x- position on the x-axisy- position on the y-axisz- position on the z-axis- Returns:
- this
-
setPosition
Sets the position.- Parameters:
xyz- position- Returns:
- this
-
setPositionRelative
Sets the position relative to the current position.- Parameters:
dx- position difference on the x-axisdy- position difference on the y-axisdz- position difference on the z-axis- Returns:
- this
-
setPositionRelative
Sets the position relative to the current position.- Parameters:
dxyz- position difference- Returns:
- this
-
getPositionX
public float getPositionX()Gets the position on the x-axis.- Returns:
- position on the x-axis
-
getPositionY
public float getPositionY()Gets the position on the y-axis.- Returns:
- position on the y-axis
-
getPositionZ
public float getPositionZ()Gets the position on the z-axis.- Returns:
- position on the z-axis
-
getPosition
Gets the position.- Returns:
- position
-
setLookAt
Sets the configuration to look at a given point (aligns -z to go through the point). The camera looks at [0, 0, -1] by default.- Parameters:
x- position of the point to look at on the x-axisy- position of the point to look at on the y-axisz- position of the point to look at on the z-axis- Returns:
- this
-
setLookAt
Sets the configuration to look at a given point (aligns -z to go through the point). The camera looks at [0, 0, -1] by default.- Parameters:
xyz- position of the point to look at- Returns:
- this
-
setLookAt
Sets the configuration to look at a given point (aligns -z to go through the point), with a given vector pointing where 'up' is. The camera looks at [0, 0, -1] by default, with [0, 1, 0] being 'up'. 'up' does not need to be normalized nor be perpendicular to the vector the configuration looks in. For most use cases, [0, 1, 0] is a good value (that's why it is the default).- Parameters:
x- position of the point to look at on the x-axisy- position of the point to look at on the y-axisz- position of the point to look at on the z-axisupX- x-axis of a vector pointing 'up'upY- y-axis of a vector pointing 'up'upZ- z-axis of a vector pointing 'up'- Returns:
- this
-
setLookAt
Sets the configuration to look at a given point (aligns -z to go through the point), with a given vector pointing where 'up' is. The camera looks at [0, 0, -1] by default, with [0, 1, 0] being 'up'. 'up' does not need to be normalized nor be perpendicular to the vector the configuration looks in. For most use cases, [0, 1, 0] is a good value (that's why it is the default).- Parameters:
xyz- position of the point to look atup- vector pointing 'up'- Returns:
- this
-
setLookIn
Sets the configuration to look in the direction of a given vector. The camera looks in the direction of [0, 0, -1] by default.- Parameters:
x- x-axis of a vector pointing in the direction to look iny- y-axis of a vector pointing in the direction to look inz- z-axis of a vector pointing in the direction to look in- Returns:
- this
-
setLookIn
Sets the configuration to look in the direction of a given vector. The camera looks in the direction of [0, 0, -1] by default.- Parameters:
xyz- vector pointing in the direction to look in- Returns:
- this
-
setLookIn
Sets the configuration to look in the direction of a given vector, with a given vector pointing where 'up' is. The camera looks in the direction of [0, 0, -1] by default, with [0, 1, 0] being 'up'. 'up' does not need to be normalized nor be perpendicular to the vector the configuration looks in. For most use cases, [0, 1, 0] is a good value (that's why it is the default).- Parameters:
x- x-axis of a vector pointing in the direction to look iny- y-axis of a vector pointing in the direction to look inz- z-axis of a vector pointing in the direction to look inupX- x-axis of a vector pointing 'up'upY- y-axis of a vector pointing 'up'upZ- z-axis of a vector pointing 'up'- Returns:
- this
-
setLookIn
Sets the configuration to look in the direction of a given vector, with a given vector pointing where 'up' is. The camera looks in the direction of [0, 0, -1] by default, with [0, 1, 0] being 'up'. 'up' does not need to be normalized nor be perpendicular to the vector the configuration looks in. For most use cases, [0, 1, 0] is a good value (that's why it is the default).- Parameters:
xyz- x-vector pointing in the direction to look inup- vector pointing 'up'- Returns:
- this
-
setLookUp
Sets the direction of 'up' to a given vector. 'up' does not need to be normalized nor be perpendicular to the vector the configuration looks in. For most use cases, [0, 1, 0] is a good value (that's why it is the default).- Parameters:
upX- x-axis of a vector pointing 'up'upY- y-axis of a vector pointing 'up'upZ- z-axis of a vector pointing 'up'- Returns:
- this
-
setLookUp
Sets the direction of 'up' to a given vector. 'up' does not need to be normalized nor be perpendicular to the vector the configuration looks in. For most use cases, [0, 1, 0] is a good value (that's why it is the default).- Parameters:
xyz- vector pointing 'up'- Returns:
- this
-
getLookInX
public float getLookInX()Returns the x-axis of a vector describing where the configuration is looking.- Returns:
- lookInX-value
-
getLookInY
public float getLookInY()Returns the y-axis of a vector describing where the configuration is looking.- Returns:
- lookInY-value
-
getLookInZ
public float getLookInZ()Returns the z-axis of a vector describing where the configuration is looking.- Returns:
- lookInZ-value
-
getLookIn
Returns a vector describing where the configuration is looking.- Returns:
- lookIn-value
-
getLookAtX
public float getLookAtX()Returns the x-axis of a point that the configuration is looking at.- Returns:
- lookAtX-value
-
getLookAtY
public float getLookAtY()Returns the y-axis of a point that the configuration is looking at.- Returns:
- lookAtY-value
-
getLookAtZ
public float getLookAtZ()Returns the z-axis of a point that the configuration is looking at.- Returns:
- lookAtZ-value
-
getLookAt
Returns a point that the configuration is looking at.- Returns:
- lookAt-value
-
getLookUpX
public float getLookUpX()Returns the x-axis of a vector describing where 'up' is relative to the camera.- Returns:
- x-axis of a vector pointing 'up'
-
getLookUpY
public float getLookUpY()Returns the y-axis of a vector describing where 'up' is relative to the camera.- Returns:
- y-axis of a vector pointing 'up'
-
getLookUpZ
public float getLookUpZ()Returns the z-axis of a vector describing where 'up' is relative to the camera.- Returns:
- z-axis of a vector pointing 'up'
-
getLookUp
Returns a vector describing where 'up' is relative to the camera.- Returns:
- vector pointing 'up'
-
copyValues
Copies the values of a given configuration into this.- Parameters:
source- configuration to copy values from- Returns:
- this
-
clone
-
toString
-