46 explicit PsMesh(
const char *pszName);
62 void *
operator new(
size_t nSize) {
71 void operator delete(
void *pBlock) {
98 void Sync(
int nFlags)
override;
207 return new PsMesh(pszName);
220 unsigned short mFacesQwords;
221 unsigned short mEdgesQwords;
222 unsigned short mNumFaces;
223 unsigned short mNumEdges;
224 unsigned short mFacesSetupQwords;
225 unsigned short mFacesVuEnd;
Movable block of a handle heap, reached through a handle the block points back to.
Definition memhandle.h:21
~PsMesh() override
Release the packets after the frame and the bind pose.
static RndObject * New(const char *pszName)
Create a mesh.
Definition psmesh.h:206
void DrawEdges(const Transform &xfm)
Send the settings of the edge microprogram and the edge packet of the mesh with the geometry.
void Sync(int nFlags) override
Rebuild the bind pose, the face packet, and the edge packet a set of flags covers,...
void BuildFacesPacket()
Build the face packet from the faces and the vertices.
PsMesh(const char *pszName)
Construct a mesh without packets.
void FacesPacket(MemHandle *&pPacket, int &nSetupQwords, int &nVuEnd) const
Report the face packet of the mesh with the geometry and how the first batch is laid out.
void SetZTest(int nPass)
Set the GS depth test and depth write of a pass from the depth mode and comparison.
void DrawFaces(const Transform &xfm)
Send the settings of the face microprogram and the face packet of the mesh with the geometry.
unsigned short GetNumFaces() const
Definition psmesh.h:213
void BuildEdgesPacket()
Build the edge packet from the edges and the vertices.
static constexpr int kVertexCacheSize
The number of entries of g_vertexCache.
Definition psmesh.h:24
const Transform & SkinXfm()
Report the transform to draw the mesh with, skinning its vertices first when it has bones.
int DrawShowing() override
Draw each pass of the faces, then the edges, when the level of detail selects the mesh.
std::unique_ptr< SkinVert[]> mSkinVerts
Definition psmesh.h:210
static void Init()
Install the mesh factory for the class Mesh of a .rnd file, and set g_identityXfm.
void Copy(const RndObject *pSource, int nFlags) override
Copy another mesh, then copy each of its packets this mesh does not have.
RndMesh(const char *pszName)
Construct an empty mesh that draws with a Z depth test and write, passing when nearer.
RndObject(const char *pszName)
Construct an object and register it under a name.
void * PoolAlloc(int nSize, int nBlockSize, const char *pszTag, int nUnused)
Allocate a block from the small-block pool and bill it to a tag.
void PoolFree(int nSize, void *pBlock)
Return a block to the small-block pool.
unsigned short g_vertexCache[PsMesh::kVertexCacheSize]
The vertex indices of the batch being built, in the order the batch unpacks them.
Transform g_identityXfm
The identity transform a skinned mesh draws with.
The bind pose of a skinned vertex, with the weight of each bone in the fourth word.
Definition psmesh.h:32
float mWeight1
Definition psmesh.h:34
float mPos[3]
Definition psmesh.h:33
float mWeight2
Definition psmesh.h:36
float mNorm[3]
Definition psmesh.h:35