wavelength 1.0.0
Loading...
Searching...
No Matches
transform.h File Reference
#include "math/quaternion.h"
#include "math/transformops.h"
#include "math/vector3.h"
#include "os/prnstream.h"
Include dependency graph for transform.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Transform
 Affine transform stored as three basis rows and a translation row. More...

Functions

void MultiplyPoint (const Transform &xfm, const Vector3 &v, Vector3 &out)
 Transform a point by the basis rows and the translation of a transform.
void MultiplyVector (const Transform &xfm, const Vector3 &v, Vector3 &out)
 Transform a direction by the basis rows of a transform, without the translation.
void Multiply (Transform &out, const Transform &first, const Transform &second)
 Concatenate two transforms, applying the second and then the first, with sceVu0MulAffineMatrixXyz().
void Invert (Transform &out, const Transform &xfm)
 Invert a transform whose basis is orthonormal, with InversMatrix().
void MakeScale (const Transform &xfm, Vector3 &scale)
 Report the length of each basis row, negating the third when the basis is left handed, with Mat33ExtractScale().
PrnStream & operator<< (PrnStream &stream, const Transform &transform)
 Write the four rows of a transform.

Variables

constexpr int kTransformRowCount = 4
 Rows in a transform held as a bare array, three of the basis and the translation.
constexpr int kTransformRowFloatCount = 4
 Floats in a row of a transform held as a bare array, x, y, z, and padding.

Function Documentation

◆ MultiplyPoint()

void MultiplyPoint ( const Transform & xfm,
const Vector3 & v,
Vector3 & out )
inline

Transform a point by the basis rows and the translation of a transform.

The binary expands the routine inline. The output may alias the point.

Parameters
xfmThe transform.
vThe point.
outReceives the transformed point.

◆ MultiplyVector()

void MultiplyVector ( const Transform & xfm,
const Vector3 & v,
Vector3 & out )
inline

Transform a direction by the basis rows of a transform, without the translation.

The binary expands the routine inline. The output may alias the direction.

Parameters
xfmThe transform.
vThe direction.
outReceives the transformed direction.

◆ Multiply()

void Multiply ( Transform & out,
const Transform & first,
const Transform & second )
inline

Concatenate two transforms, applying the second and then the first, with sceVu0MulAffineMatrixXyz().

Parameters
outReceives the concatenation.
firstThe transform applied last, such as a parent's world transform.
secondThe transform applied first, such as a child's local transform.

◆ Invert()

void Invert ( Transform & out,
const Transform & xfm )
inline

Invert a transform whose basis is orthonormal, with InversMatrix().

Parameters
outReceives the inverse. It may not alias the source.
xfmThe transform.

◆ MakeScale()

void MakeScale ( const Transform & xfm,
Vector3 & scale )
inline

Report the length of each basis row, negating the third when the basis is left handed, with Mat33ExtractScale().

Parameters
xfmThe transform.
scaleReceives the three lengths.

◆ operator<<()

PrnStream & operator<< ( PrnStream & stream,
const Transform & transform )

Write the four rows of a transform.

Parameters
streamThe stream to write to.
transformThe transform.
Returns
The stream.
Ghidra address:
NTSC-U/C: 0x002930a0
Ghidra address:
PAL: 0x0029ca68

Variable Documentation

◆ kTransformRowCount

int kTransformRowCount = 4
constexpr

Rows in a transform held as a bare array, three of the basis and the translation.

◆ kTransformRowFloatCount

int kTransformRowFloatCount = 4
constexpr

Floats in a row of a transform held as a bare array, x, y, z, and padding.