public final class DefaultCameraModel extends AbstractNamedModelElement implements CameraModel
CameraModel| Constructor and Description |
|---|
DefaultCameraModel()
Creates a new instance
|
| Modifier and Type | Method and Description |
|---|---|
float[] |
computeProjectionMatrix(float[] result,
java.lang.Float aspectRatio)
Compute the projection matrix for this camera.
|
java.util.function.Supplier<float[]> |
createProjectionMatrixSupplier(java.util.function.DoubleSupplier aspectRatioSupplier)
Create the supplier of the projection matrix for this camera model.
|
CameraOrthographicModel |
getCameraOrthographicModel()
Returns the
CameraOrthographicModel, or null if
this is a perspective camera |
CameraPerspectiveModel |
getCameraPerspectiveModel()
Returns the
CameraPerspectiveModel, or null if
this is an orthographic camera |
void |
setCameraOrthographicModel(CameraOrthographicModel cameraOrthographicModel)
Set the
CameraOrthographicModel |
void |
setCameraPerspectiveModel(CameraPerspectiveModel cameraPerspectiveModel)
Set the
CameraPerspectiveModel |
getName, setNameaddExtension, getExtensions, getExtras, removeExtension, setExtensions, setExtrasclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetNamegetExtensions, getExtraspublic void setCameraOrthographicModel(CameraOrthographicModel cameraOrthographicModel)
CameraOrthographicModelcameraOrthographicModel - The CameraOrthographicModelpublic CameraOrthographicModel getCameraOrthographicModel()
CameraModelCameraOrthographicModel, or null if
this is a perspective cameragetCameraOrthographicModel in interface CameraModelCameraOrthographicModelpublic void setCameraPerspectiveModel(CameraPerspectiveModel cameraPerspectiveModel)
CameraPerspectiveModelcameraPerspectiveModel - The CameraPerspectiveModelpublic CameraPerspectiveModel getCameraPerspectiveModel()
CameraModelCameraPerspectiveModel, or null if
this is an orthographic cameragetCameraPerspectiveModel in interface CameraModelCameraPerspectiveModelpublic float[] computeProjectionMatrix(float[] result,
java.lang.Float aspectRatio)
CameraModelnull or does
not have a length of 16, then a new array with length 16 will be
created and returned.computeProjectionMatrix in interface CameraModelresult - The result arrayaspectRatio - An optional aspect ratio that should be used.
If this is null, then the aspect ratio of the
camera will be used.public java.util.function.Supplier<float[]> createProjectionMatrixSupplier(java.util.function.DoubleSupplier aspectRatioSupplier)
CameraModelCameraModel was
created for is neither "perspective" nor
"orthographic",
then the supplier will print an error message and return
the identity matrix.createProjectionMatrixSupplier in interface CameraModelaspectRatioSupplier - The optional supplier for the aspect
ratio of the camera. If this is null, then the
aspect ratio of the camera will be used.Copyright © 2022. All Rights Reserved.