resonance 1.0.1
Loading...
Searching...
No Matches
TnlGemMeshKind Class Reference

One level of detail of a gem kind that TnlGemManager draws as instances of a multi-mesh. More...

#include <tnlgemmeshkind.h>

Collaboration diagram for TnlGemMeshKind:

Public Member Functions

 TnlGemMeshKind (Rnd::MultiMesh *pMesh, float flLodOffset, float flCostScale)
 Take a multi-mesh as one level of detail and clear its instances.
void AddDrawTo (Rnd::Drawable *pParent)
 Add the multi-mesh of this level and of every coarser level to a drawable.
void SetShowing (int nShowing)
 Show or hide the multi-mesh of this level and of every coarser level.
float GetCost ()
 Report the drawing cost one gem at this level adds.

Public Attributes

Rnd::MultiMesh * mMesh
float mLodDistance
TnlGemMeshKind * mNext
float mCost

Detailed Description

One level of detail of a gem kind that TnlGemManager draws as instances of a multi-mesh.

The class is not polymorphic and emits no RTTI. No descriptor, tag, or file path identifies it, and its name is inferred from TnlGemManager::AddMeshKind(), which builds one per "<name><n>.mm" multi-mesh it finds and links them through mNext from the finest level to the coarsest. The record is 0x10 bytes, allocated with the untagged scalar allocator.

Constructor & Destructor Documentation

◆ TnlGemMeshKind()

TnlGemMeshKind::TnlGemMeshKind ( Rnd::MultiMesh * pMesh,
float flLodOffset,
float flCostScale )

Take a multi-mesh as one level of detail and clear its instances.

The level applies while a gem lies further ahead than the instanced mesh's Rnd::Mesh::mMinScreen plus flLodOffset. The cost is the triangle count of the instanced mesh times flCostScale. The out-of-line copy has no callers, and TnlGemManager::AddMeshKind() inlines it.

Parameters
pMeshThe multi-mesh.
flLodOffsetThe frames added to the instanced mesh's level of detail threshold.
flCostScaleThe cost of one triangle.
Ghidra address:
NTSC-U/C: 0x004158c0
Ghidra address:
PAL: 0x0044f410

Member Function Documentation

◆ AddDrawTo()

void TnlGemMeshKind::AddDrawTo ( Rnd::Drawable * pParent)

Add the multi-mesh of this level and of every coarser level to a drawable.

Does nothing when pParent is null. Each multi-mesh is added at the end of the draw list.

Parameters
pParentThe drawable to add to, or null.
Ghidra address:
NTSC-U/C: 0x00415980
Ghidra address:
PAL: 0x0044f4d0

◆ SetShowing()

void TnlGemMeshKind::SetShowing ( int nShowing)

Show or hide the multi-mesh of this level and of every coarser level.

Parameters
nShowingNon-zero to show.
Ghidra address:
NTSC-U/C: 0x004159d8
Ghidra address:
PAL: 0x0044f528

◆ GetCost()

float TnlGemMeshKind::GetCost ( )

Report the drawing cost one gem at this level adds.

Returns
mCost while the multi-mesh is showing, zero otherwise.
Ghidra address:
NTSC-U/C: 0x00415a30
Ghidra address:
PAL: 0x0044f580

Member Data Documentation

◆ mMesh

Rnd::MultiMesh* TnlGemMeshKind::mMesh

The multi-mesh one instance per gem is added to. Frames ahead of the playhead a gem has to lie for this level to draw it.

◆ mLodDistance

float TnlGemMeshKind::mLodDistance

◆ mNext

TnlGemMeshKind* TnlGemMeshKind::mNext

The next coarser level, or null.

◆ mCost

float TnlGemMeshKind::mCost

The drawing cost of one gem at this level.


The documentation for this class was generated from the following file: