An affine transform that composes translation, rotation, and scale.
More...
#include <Transform.h>
|
|
using | Affine = Eigen::Transform<floatT, 3, Eigen::Affine> |
| |
|
|
| Transform () |
| | Constructs an identity transform.
|
| |
|
| Transform (const Matrix4 &matrix) |
| | Wraps an existing matrix.
|
| |
|
Transform & | translate (const Vector3 &offset) |
| | Moves the local origin by an offset.
|
| |
|
Transform & | rotateEuler (const Vector3 °rees) |
| | Rotates in X, then Y, then Z, with angles given in degrees.
|
| |
|
Transform & | scale (const Vector3 &factors) |
| | Scales each local axis independently.
|
| |
|
Transform & | scale (floatT uniform) |
| | Scales all local axes by the same factor.
|
| |
|
Transform & | compose (const Transform &other) |
| | Composes another transform into this one in the local frame.
|
| |
| Vector3 | operator* (const Vector3 &point) const |
| | Applies the transform to a point.
|
| |
|
const Matrix4 & | getMatrix () const |
| |
An affine transform that composes translation, rotation, and scale.
Builder methods mutate in place and return a reference so calls can be chained. Factory methods construct a Transform from other representations such as an attribute value or an orientation frame.
- Note
- The transform is stored as an Eigen affine transform whose operations skip the homogeneous bottom row, so composing and applying it costs less than a full 4x4 multiply. Builders and accessors are inline so they survive per element hot paths.
◆ fromAttribute()
Reads a transform from a single attribute value.
- Returns
- The transform encoded at the given offset.
- Note
- A vector attribute becomes a translation. A matrix attribute is used directly. Any other type yields the identity.
◆ lookAt()
| Transform enzo::Transform::lookAt |
( |
const Vector3 & | translation, |
|
|
const Vector3 & | forward, |
|
|
const Vector3 & | up ) |
|
static |
Builds an orientation frame that points down a forward axis.
- Returns
- A transform whose rotation aligns to the frame, placed at translation.
- Note
- The rotation maps the local Z axis onto forward and the local Y axis toward up. The up vector resolves the remaining roll. When forward and up are parallel the rotation falls back to identity.
◆ operator*()
| Vector3 enzo::Transform::operator* |
( |
const Vector3 & | point | ) |
const |
|
inline |
Applies the transform to a point.
- Returns
- The point with the transform's scale, rotation, and translation applied.
The documentation for this class was generated from the following files:
- src/Engine/Attribute/Transform.h
- src/Engine/Attribute/Transform.cpp