wavelength 1.0.0
Loading...
Searching...
No Matches
gfxutil.h File Reference
#include <vector>
#include "math/key.h"
#include "math/vector2.h"
#include "math/vector3.h"
#include "rnd/rndanimatable.h"
#include "rnd/rndmesh.h"
#include "rnd/rndparticlesys.h"
#include "rnd/rndtransformable.h"
#include "rnd/rndview.h"
#include "script/dataarray.h"
Include dependency graph for gfxutil.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  FloatKey
 One key of a curve of floats, sorted by frame. More...

Functions

void DetachView (RndView *pParent, RndView *pChild)
 Take a view out of the draws, the animations, the transforms, and the collisions of another.
void AttachView (RndView *pParent, RndView *pChild)
 Add a view to the draws, the animations, and the transforms of another.
void SetFilterScale (RndAnimatable *pAnim, float fScale)
 Change the rate of the scale-offset filter in the first slot of an animation, keeping the filtered frame of its current frame.
void Rotate (Vector2 *pPoint, float fAngle)
 Turn a point about the origin.
void BuildTrackArc (std::vector< Vector2 > *pPoints, DataArray *pConfig)
 Place the cross section points of the tracks along an arc that is symmetric about the Y axis.
void ResetXfmTree (RndTransformable *pRoot, bool bReset)
 Give every transform under a transform the identity as its local transform.
void SetZModeTree (RndTransformable *pRoot, RndMesh::ZMode zMode, RndMesh::ZFunc zFunc)
 Set the depth test of every mesh under a transform, recursively.
void ScaleTransKeys (const char *pszName, float fScale)
 Scale the translation keys of a transform animation.
void ScaleKeys (std::vector< Key< Vector3 > > &keys, float fScale)
 Scale the values of position keys.
void LoadFloatKeys (DataArray *pData, std::vector< FloatKey > *pKeys)
 Read a curve of (value frame) pairs from a script array, replacing the keys and sorting them by frame.
void InterpBasis (const float *pFrom, const float *pTo, float *pOut, float fBlend)
 Blend the rotations of two transforms through quaternions.
void ClearMeshSpheres (RndTransformable *pRoot)
 Give every mesh under a transform a bounding sphere at the origin of radius 0, the mark of a mesh with no sphere, recursively.
void ScaleParticles (RndParticleSys *pSys, float fScale)
 Scale the size and the force of the particles of a particle system.
void ScaleParticleTree (RndTransformable *pRoot, float fScale)
 Scale every particle system of a transform tree with ScaleParticles().

Function Documentation

◆ DetachView()

void DetachView ( RndView * pParent,
RndView * pChild )

Take a view out of the draws, the animations, the transforms, and the collisions of another.

Parameters
pParentThe view to take the child out of.
pChildThe child, or null.
Ghidra address:
NTSC-U/C: 0x001e1988
Ghidra address:
PAL: 0x001ea728

◆ AttachView()

void AttachView ( RndView * pParent,
RndView * pChild )

Add a view to the draws, the animations, and the transforms of another.

Parameters
pParentThe view to add the child to.
pChildThe child, or null.
Ghidra address:
NTSC-U/C: 0x001e19f0
Ghidra address:
PAL: 0x001ea790

◆ SetFilterScale()

void SetFilterScale ( RndAnimatable * pAnim,
float fScale )

Change the rate of the scale-offset filter in the first slot of an animation, keeping the filtered frame of its current frame.

A warning is reported for an animation whose first filter is missing or is another kind.

Parameters
pAnimThe animation.
fScaleThe new rate.
Ghidra address:
NTSC-U/C: 0x001e1a50
Ghidra address:
PAL: 0x001ea7f0

◆ Rotate()

void Rotate ( Vector2 * pPoint,
float fAngle )

Turn a point about the origin.

Parameters
pPointThe point, which receives the result.
fAngleThe angle, in radians.
Ghidra address:
NTSC-U/C: 0x001e1b70
Ghidra address:
PAL: 0x001ea910

◆ BuildTrackArc()

void BuildTrackArc ( std::vector< Vector2 > * pPoints,
DataArray * pConfig )

Place the cross section points of the tracks along an arc that is symmetric about the Y axis.

The configuration gives center_height, track_width, start_angle, angle_inc, and angle_inc_inc, the angles in degrees. The middle point sits at the centre height, and each point outward is one track width from the last, turned by an angle that grows by the increment.

Parameters
pPointsThe points, sized already.
pConfigThe configuration.
Ghidra address:
NTSC-U/C: 0x001e1bf0
Ghidra address:
PAL: 0x001ea990

◆ ResetXfmTree()

void ResetXfmTree ( RndTransformable * pRoot,
bool bReset )

Give every transform under a transform the identity as its local transform.

Parameters
pRootThe transform.
bResetWhether the transform itself is reset as well as the transforms under it.
Ghidra address:
NTSC-U/C: 0x001e1e48
Ghidra address:
PAL: 0x001eabe8

◆ SetZModeTree()

void SetZModeTree ( RndTransformable * pRoot,
RndMesh::ZMode zMode,
RndMesh::ZFunc zFunc )

Set the depth test of every mesh under a transform, recursively.

Parameters
pRootThe transform.
zModeThe depth mode.
zFuncThe depth comparison.
Ghidra address:
NTSC-U/C: 0x001e1f10
Ghidra address:
PAL: 0x001eacb0

◆ ScaleTransKeys()

void ScaleTransKeys ( const char * pszName,
float fScale )

Scale the translation keys of a transform animation.

Parameters
pszNameThe animation, which must exist.
fScaleThe scale.
Ghidra address:
NTSC-U/C: 0x001e3c08
Ghidra address:
PAL: 0x001ec9a8

◆ ScaleKeys()

void ScaleKeys ( std::vector< Key< Vector3 > > & keys,
float fScale )

Scale the values of position keys.

The frames are unchanged. The name is inferred.

Parameters
keysThe keys.
fScaleThe scale.
Ghidra address:
NTSC-U/C: 0x00370bb8
Ghidra address:
PAL: 0x003df2e8

◆ LoadFloatKeys()

void LoadFloatKeys ( DataArray * pData,
std::vector< FloatKey > * pKeys )

Read a curve of (value frame) pairs from a script array, replacing the keys and sorting them by frame.

Parameters
pDataThe array.
pKeysReceives the keys.
Ghidra address:
NTSC-U/C: 0x001e3c88
Ghidra address:
PAL: 0x001eca28

◆ InterpBasis()

void InterpBasis ( const float * pFrom,
const float * pTo,
float * pOut,
float fBlend )

Blend the rotations of two transforms through quaternions.

Parameters
pFromThe transform at a blend of 0, four rows of four floats.
pToThe transform at a blend of 1, four rows of four floats.
pOutReceives the blended rotation, four rows of four floats. It may alias pFrom.
fBlendThe blend.
Ghidra address:
NTSC-U/C: 0x001e2b38
Ghidra address:
PAL: 0x001eb8d8

◆ ClearMeshSpheres()

void ClearMeshSpheres ( RndTransformable * pRoot)

Give every mesh under a transform a bounding sphere at the origin of radius 0, the mark of a mesh with no sphere, recursively.

Parameters
pRootThe transform.
Ghidra address:
NTSC-U/C: 0x001e1fc8
Ghidra address:
PAL: 0x001ead68

◆ ScaleParticles()

void ScaleParticles ( RndParticleSys * pSys,
float fScale )

Scale the size and the force of the particles of a particle system.

Parameters
pSysThe particle system.
fScaleThe scale.
Ghidra address:
NTSC-U/C: 0x001e2138
Ghidra address:
PAL: 0x001eaed8

◆ ScaleParticleTree()

void ScaleParticleTree ( RndTransformable * pRoot,
float fScale )

Scale every particle system of a transform tree with ScaleParticles().

Parameters
pRootThe root of the tree, or null.
fScaleThe scale.
Ghidra address:
NTSC-U/C: 0x001e2088
Ghidra address:
PAL: 0x001eae28