wavelength 1.0.0
Loading...
Searching...
No Matches
PsMultiMesh Class Reference

Multimesh, PlayStation 2. More...

#include <psmultimesh.h>

Inheritance diagram for PsMultiMesh:
Collaboration diagram for PsMultiMesh:

Public Member Functions

 PsMultiMesh (const char *pszName)
 Construct a multimesh.
 ~PsMultiMesh () override
int DrawShowing () override
 Draw every instance in each pass of the material of the mesh.
void DrawInstances ()
 Send the settings of the instanced microprogram and the face packet of the mesh, then the transforms in batches, each batch followed by a frame flush.
Public Member Functions inherited from RndMultiMesh
 RndMultiMesh (const char *pszName)
 Construct a multimesh without a mesh or instances.
 ~RndMultiMesh () override
 Drop the reference on the mesh.
void ListDrawObjects (std::list< RndObject * > &objects) override
 Add the draw objects of the mesh to a list.
void ListDrawables (std::list< RndDrawable * > &drawables) override
 Add the multimesh, when the mesh has something to draw at an instance, then the children, to a list.
int DrawShowing () override
 Draw the mesh at each instance.
void DumpText (PrnStream &stream) override
 Write a description of the multimesh and its base.
void Save (BinStream &stream) override
 Write the multimesh and its base.
void Replace (RndObject *pFrom, RndObject *pTo) override
 Replace a child, or the mesh, with another object.
const char * ClassName () const override
 Report the class name.
void Copy (const RndObject *pSource, int nFlags) override
 Copy another multimesh and its base.
void Load (BinStream &stream) override
 Read what Save() wrote.
void SetMesh (RndMesh *pMesh)
 Set the mesh to draw.
RndMesh * GetMesh () const
const std::list< Transform > & GetTransforms () const
std::list< Transform > & GetTransforms ()
Public Member Functions inherited from RndDrawable
 RndDrawable ()
 Construct a showing drawable without a highlight or children.
 ~RndDrawable () override
 Drop the references on the children.
virtual void SetShowing (int nShowing)
 Set whether the drawable draws at all.
virtual void SetHighlight (int nHighlight)
 Set whether the drawable draws with its highlight treatment.
RndDrawable * Parent ()
 Find the drawable whose children include this one.
void Draw ()
 Draw the drawable and then its children, when it is showing.
bool AddDraw (RndDrawable *pDraw, RndDrawable *pBefore)
 Add a child before another.
void RemoveDraw (RndDrawable *pDraw)
 Remove a child.
void ClearDraws ()
 Remove every child.
int GetShowing () const
const std::list< RndDrawable * > & GetDraws () const
Public Member Functions inherited from RndObject
 RndObject (const char *pszName)
 Construct an object and register it under a name.
virtual ~RndObject ()
 Notify every referrer, then erase the registration.
void SetName (const char *pszName)
 Register the object under a different name.
void AddRef (RndObject *pReferrer)
 Register an object as a store of a pointer to this one.
void RemoveRef (RndObject *pReferrer)
 Drop the first registration AddRef() made for a referrer.
const char * GetName () const
const std::list< RndObject * > & GetRefs () const
int GetInternal () const
void SetInternal (int nInternal)

Static Public Member Functions

static RndObject * New (const char *pszName)
 Create a multimesh.
Static Public Member Functions inherited from RndMultiMesh
static RndObject * New (const char *pszName)
 Create a multimesh.
Static Public Member Functions inherited from RndDrawable
static void CollectChildren (std::list< RndObject * > &objects, RndDrawable *pDrawable)
 Append every draw descendant of a drawable, depth first, each before its descendants.

Additional Inherited Members

Static Public Attributes inherited from RndMultiMesh
static const char * sClassName
 The class name a .rnd file writes, MultiMesh.
static int sRev
 The format version Save() writes and Load() accepts.
static int sLoadRev
 The version Load() read last.
Static Public Attributes inherited from RndDrawable
static int sRev
 The format version Save() writes and Load() accepts.
Static Public Attributes inherited from RndObject
static constexpr int kCopyChildLists = 0x200
 The bit of the Copy() flags that copies the child lists of the mix-ins.
Protected Member Functions inherited from RndMultiMesh
void AcquireRefs ()
 Take a reference on the mesh.
void ReleaseRefs ()
 Drop the reference on the mesh.
Protected Member Functions inherited from RndDrawable
void ReleaseDrawRefs ()
 Drop the reference on every child without emptying the list.
void AcquireDrawRefs ()
 Take a reference on every child.
Protected Attributes inherited from RndMultiMesh
RndMesh * mMesh
std::list< Transform > mTransforms
Protected Attributes inherited from RndDrawable
int mShowing
Protected Attributes inherited from RndObject
std::list< RndObject * > mRefs
String mName

Detailed Description

Multimesh, PlayStation 2.

The RTTI includes the class name and records RndMultiMesh as the one base. The class adds no data member. The face packet of the mesh is sent to VU1 once for each pass, and the transforms of the instances follow in batches that the instanced microprogram draws the faces with.

Constructor & Destructor Documentation

◆ PsMultiMesh()

PsMultiMesh::PsMultiMesh ( const char * pszName)
explicit

Construct a multimesh.

Parameters
pszNameThe registry key.
Ghidra address:
NTSC-U/C: 0x0021ab00
Ghidra address:
PAL: 0x00223918

◆ ~PsMultiMesh()

PsMultiMesh::~PsMultiMesh ( )
inlineoverride
Ghidra address:
NTSC-U/C: 0x0037d920
Ghidra address:
PAL: 0x003ec050

Member Function Documentation

◆ DrawShowing()

int PsMultiMesh::DrawShowing ( )
overridevirtual

Draw every instance in each pass of the material of the mesh.

Nothing draws without instances, without a mesh, or for a mesh without faces.

Returns
1, to draw the children.
Ghidra address:
NTSC-U/C: 0x0021aa40
Ghidra address:
PAL: 0x00223858

Reimplemented from RndDrawable.

◆ DrawInstances()

void PsMultiMesh::DrawInstances ( )

Send the settings of the instanced microprogram and the face packet of the mesh, then the transforms in batches, each batch followed by a frame flush.

A batch is as many transforms as fit in the VU1 data memory after the face packet. The transforms are sent by reference. The name is inferred.

Ghidra address:
NTSC-U/C: 0x0021a4d0
Ghidra address:
PAL: 0x002232e8

◆ New()

RndObject * PsMultiMesh::New ( const char * pszName)
inlinestatic

Create a multimesh.

Parameters
pszNameThe registry key.
Returns
The multimesh.
Ghidra address:
NTSC-U/C: 0x0037dac0
Ghidra address:
PAL: 0x003ec1f0

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