fix typos in Camera documentation

This commit is contained in:
Mathias Agopian
2022-07-07 09:37:34 -07:00
committed by Mathias Agopian
parent ea3553ceb7
commit 09f188659a
3 changed files with 33 additions and 33 deletions
@@ -400,7 +400,7 @@ public class Camera {
}
/**
* Sets the camera's view matrix.
* Sets the camera's model matrix.
* <p>
* Helper method to set the camera's entity transform component.
* Remember that the Camera "looks" towards its -z axis.
@@ -412,29 +412,29 @@ public class Camera {
* engine.getTransformManager().getInstance(camera->getEntity()), viewMatrix);
* </pre>
*
* @param viewMatrix The camera position and orientation provided as a <b>rigid transform</b> matrix.
* @param modelMatrix The camera position and orientation provided as a <b>rigid transform</b> matrix.
*/
public void setModelMatrix(@NonNull @Size(min = 16) float[] viewMatrix) {
Asserts.assertMat4fIn(viewMatrix);
nSetModelMatrix(getNativeObject(), viewMatrix);
public void setModelMatrix(@NonNull @Size(min = 16) float[] modelMatrix) {
Asserts.assertMat4fIn(modelMatrix);
nSetModelMatrix(getNativeObject(), modelMatrix);
}
/**
* Sets the camera's view matrix.
* Sets the camera's model matrix.
* <p>
* Helper method to set the camera's entity transform component.
* Remember that the Camera "looks" towards its -z axis.
* <p>
*
* @param viewMatrix The camera position and orientation provided as a <b>rigid transform</b> matrix.
* @param modelMatrix The camera position and orientation provided as a <b>rigid transform</b> matrix.
*/
public void setModelMatrix(@NonNull @Size(min = 16) double[] viewMatrix) {
Asserts.assertMat4In(viewMatrix);
nSetModelMatrixFp64(getNativeObject(), viewMatrix);
public void setModelMatrix(@NonNull @Size(min = 16) double[] modelMatrix) {
Asserts.assertMat4In(modelMatrix);
nSetModelMatrixFp64(getNativeObject(), modelMatrix);
}
/**
* Sets the camera's view matrix.
* Sets the camera's model matrix.
*
* @param eyeX x-axis position of the camera in world space
* @param eyeY y-axis position of the camera in world space
@@ -549,10 +549,10 @@ public class Camera {
/**
* Retrieves the camera's view matrix. The view matrix is the inverse of the model matrix.
*
* @param out A 16-float array where the model view will be stored, or null in which
* @param out A 16-float array where the view matrix will be stored, or null in which
* case a new array is allocated.
*
* @return A 16-float array containing the camera's view as a column-major matrix.
* @return A 16-float array containing the camera's column-major view matrix.
*/
@NonNull @Size(min = 16)
public float[] getViewMatrix(@Nullable @Size(min = 16) float[] out) {
@@ -567,7 +567,7 @@ public class Camera {
* @param out A 16-double array where the model view will be stored, or null in which
* case a new array is allocated.
*
* @return A 16-double array containing the camera's view as a column-major matrix.
* @return A 16-double array containing the camera's column-major view matrix.
*/
@NonNull @Size(min = 16)
public double[] getViewMatrix(@Nullable @Size(min = 16) double[] out) {
+8 -8
View File
@@ -313,26 +313,26 @@ public:
//! Returns the frustum's far plane used for culling
float getCullingFar() const noexcept;
/** Sets the camera's view matrix.
/** Sets the camera's model matrix.
*
* Helper method to set the camera's entity transform component.
* It has the same effect as calling:
*
* ~~~~~~~~~~~{.cpp}
* engine.getTransformManager().setTransform(
* engine.getTransformManager().getInstance(camera->getEntity()), view);
* engine.getTransformManager().getInstance(camera->getEntity()), model);
* ~~~~~~~~~~~
*
* @param view The camera position and orientation provided as a rigid transform matrix.
* @param model The camera position and orientation provided as a rigid transform matrix.
*
* @note The Camera "looks" towards its -z axis
*
* @warning \p view must be a rigid transform
* @warning \p model must be a rigid transform
*/
void setModelMatrix(const math::mat4& view) noexcept;
void setModelMatrix(const math::mat4f& view) noexcept; //!< \overload
void setModelMatrix(const math::mat4& model) noexcept;
void setModelMatrix(const math::mat4f& model) noexcept; //!< @overload
/** Sets the camera's view matrix
/** Sets the camera's model matrix
*
* @param eye The position of the camera in world space.
* @param center The point in world space the camera is looking at.
@@ -342,7 +342,7 @@ public:
const math::float3& center,
const math::float3& up) noexcept;
/** Sets the camera's view matrix, assuming up is along the y axis
/** Sets the camera's model matrix, assuming up is along the y axis
*
* @param eye The position of the camera in world space.
* @param center The point in world space the camera is looking at.
+11 -11
View File
@@ -69,7 +69,7 @@ public:
void setShift(math::double2 shift) noexcept { mShiftCS = shift * 2.0; }
const math::double2 getShift() const noexcept { return mShiftCS * 0.5; }
math::double2 getShift() const noexcept { return mShiftCS * 0.5; }
// viewing the projection matrix to be used for rendering, contains scaling/shift and possibly
// other transforms needed by the shaders
@@ -88,28 +88,28 @@ public:
float getCullingFar() const noexcept { return mFar; }
// sets the camera's view matrix (must be a rigid transform)
// sets the camera's model matrix (must be a rigid transform)
void setModelMatrix(const math::mat4& modelMatrix) noexcept;
void setModelMatrix(const math::mat4f& modelMatrix) noexcept;
// sets the camera's view matrix
void lookAt(const math::float3& eye, const math::float3& center, const math::float3& up = { 0, 1, 0 }) noexcept;
// sets the camera's model matrix
void lookAt(const math::float3& eye, const math::float3& center,
const math::float3& up = { 0, 1, 0 }) noexcept;
// returns the view matrix
// returns the model matrix
math::mat4 getModelMatrix() const noexcept;
// returns the inverse of the view matrix
// returns the view matrix (inverse of the model matrix)
math::mat4 getViewMatrix() const noexcept;
template <typename T>
template<typename T>
static math::details::TMat44<T> rigidTransformInverse(math::details::TMat44<T> const& v) noexcept {
// The inverse of a rigid transform can be computed from the transpose
// | R T |^-1 | Rt -Rt*T |
// | 0 1 | = | 0 1 |
const math::details::TMat33<T> rt(transpose(v.upperLeft()));
const math::details::TVec3<T> t(rt * v[3].xyz);
return math::details::TMat44<T>(rt, -t);
const auto rt(transpose(v.upperLeft()));
const auto t(rt * v[3].xyz);
return { rt, -t };
}
math::double3 getPosition() const noexcept {