OpenClonk
StdMesh Class Reference

#include <StdMesh.h>

Public Types

typedef StdSubMesh::Vertex Vertex
 

Public Member Functions

 ~StdMesh ()
 
const StdSubMeshGetSubMesh (size_t i) const
 
size_t GetNumSubMeshes () const
 
const std::vector< Vertex > & GetSharedVertices () const
 
const StdMeshSkeletonGetSkeleton () const
 
StdMeshSkeletonGetSkeleton ()
 
const StdMeshBoxGetBoundingBox () const
 
float GetBoundingRadius () const
 
void PostInit ()
 
GLuint GetVBO () const
 
GLuint GetIBO () const
 
unsigned int GetVAOID () const
 
void SetLabel (const std::string &label)
 

Friends

class StdMeshLoader
 
class StdMeshMaterialUpdate
 

Detailed Description

Definition at line 187 of file StdMesh.h.

Member Typedef Documentation

◆ Vertex

Definition at line 196 of file StdMesh.h.

Constructor & Destructor Documentation

◆ ~StdMesh()

StdMesh::~StdMesh ( )

Definition at line 557 of file StdMesh.cpp.

558 {
559 #ifndef USE_CONSOLE
560  if (ibo)
561  glDeleteBuffers(1, &ibo);
562  if (vbo)
563  glDeleteBuffers(1, &vbo);
564  if (vaoid)
565  pGL->FreeVAOID(vaoid);
566 #endif
567 }
CStdGL * pGL
Definition: C4DrawGL.cpp:907
void FreeVAOID(unsigned int vaoid)
Definition: C4DrawGL.cpp:969

References CStdGL::FreeVAOID(), and pGL.

Here is the call graph for this function:

Member Function Documentation

◆ GetBoundingBox()

const StdMeshBox& StdMesh::GetBoundingBox ( ) const
inline

Definition at line 206 of file StdMesh.h.

206 { return BoundingBox; }

Referenced by C4Object::DrawFaceImpl(), C4Game::GetTextSpecImageAspect(), and CStdGL::PerformMesh().

Here is the caller graph for this function:

◆ GetBoundingRadius()

float StdMesh::GetBoundingRadius ( ) const
inline

Definition at line 207 of file StdMesh.h.

207 { return BoundingRadius; }

Referenced by CStdGL::PerformMesh().

Here is the caller graph for this function:

◆ GetIBO()

GLuint StdMesh::GetIBO ( ) const
inline

Definition at line 213 of file StdMesh.h.

213 { return ibo; }

Referenced by StdMeshInstance::GetIBO().

Here is the caller graph for this function:

◆ GetNumSubMeshes()

size_t StdMesh::GetNumSubMeshes ( ) const
inline

Definition at line 199 of file StdMesh.h.

199 { return SubMeshes.size(); }

Referenced by StdMeshInstance::SetCompletion(), StdMeshInstance::SetFaceOrdering(), StdMeshInstance::SetFaceOrderingForClrModulation(), StdMeshInstance::StdMeshInstance(), StdMeshUpdate::Update(), and StdMeshInstance::UpdateIBO().

Here is the caller graph for this function:

◆ GetSharedVertices()

const std::vector<Vertex>& StdMesh::GetSharedVertices ( ) const
inline

Definition at line 201 of file StdMesh.h.

201 { return SharedVertices; }

Referenced by StdMeshInstance::GetSharedVertices().

Here is the caller graph for this function:

◆ GetSkeleton() [1/2]

StdMeshSkeleton& StdMesh::GetSkeleton ( )
inline

Definition at line 204 of file StdMesh.h.

204 { return *Skeleton; }

◆ GetSkeleton() [2/2]

const StdMeshSkeleton& StdMesh::GetSkeleton ( ) const
inline

Definition at line 203 of file StdMesh.h.

203 { return *Skeleton; }

Referenced by StdMeshInstance::AttachedMesh::AttachedMesh(), StdMeshInstance::AttachMeshImpl(), StdMeshInstanceAnimationNode::CompileFunc(), StdMeshInstance::PlayAnimation(), StdMeshUpdate::StdMeshUpdate(), StdMeshUpdate::Update(), and StdMeshInstance::UpdateBoneTransforms().

Here is the caller graph for this function:

◆ GetSubMesh()

const StdSubMesh& StdMesh::GetSubMesh ( size_t  i) const
inline

Definition at line 198 of file StdMesh.h.

198 { return SubMeshes[i]; }

Referenced by StdMeshInstance::SetCompletion(), StdMeshInstance::SetFaceOrdering(), StdMeshInstance::SetFaceOrderingForClrModulation(), StdMeshInstance::StdMeshInstance(), StdMeshMaterialUpdate::Update(), StdMeshUpdate::Update(), and StdMeshInstance::UpdateIBO().

Here is the caller graph for this function:

◆ GetVAOID()

unsigned int StdMesh::GetVAOID ( ) const
inline

Definition at line 214 of file StdMesh.h.

214 { return vaoid; }

Referenced by StdMeshInstance::GetVAOID().

Here is the caller graph for this function:

◆ GetVBO()

GLuint StdMesh::GetVBO ( ) const
inline

Definition at line 212 of file StdMesh.h.

212 { return vbo; }

◆ PostInit()

void StdMesh::PostInit ( )

Definition at line 569 of file StdMesh.cpp.

570 {
571 #ifndef USE_CONSOLE
572  // Order submeshes so that opaque submeshes come before non-opaque ones
573  std::sort(SubMeshes.begin(), SubMeshes.end(), StdMeshSubMeshVisibilityCmpPred());
574  UpdateVBO();
575  UpdateIBO();
576 
577  // Allocate a VAO ID as well
578  assert(vaoid == 0);
579  vaoid = pGL->GenVAOID();
580 #endif
581 }
unsigned int GenVAOID()
Definition: C4DrawGL.cpp:927

References CStdGL::GenVAOID(), and pGL.

Here is the call graph for this function:

◆ SetLabel()

void StdMesh::SetLabel ( const std::string &  label)
inline

Definition at line 217 of file StdMesh.h.

217 { Label = label; }

Friends And Related Function Documentation

◆ StdMeshLoader

friend class StdMeshLoader
friend

Definition at line 189 of file StdMesh.h.

◆ StdMeshMaterialUpdate

friend class StdMeshMaterialUpdate
friend

Definition at line 190 of file StdMesh.h.


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