OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
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 189 of file StdMesh.h.

Member Typedef Documentation

Definition at line 198 of file StdMesh.h.

Constructor & Destructor Documentation

StdMesh::~StdMesh ( )

Definition at line 565 of file StdMesh.cpp.

References CStdGL::FreeVAOID(), and pGL.

566 {
567 #ifndef USE_CONSOLE
568  if (ibo)
569  glDeleteBuffers(1, &ibo);
570  if (vbo)
571  glDeleteBuffers(1, &vbo);
572  if (vaoid)
573  pGL->FreeVAOID(vaoid);
574 #endif
575 }
void FreeVAOID(unsigned int vaoid)
Definition: C4DrawGL.cpp:976
CStdGL * pGL
Definition: C4DrawGL.cpp:914

Here is the call graph for this function:

Member Function Documentation

const StdMeshBox& StdMesh::GetBoundingBox ( ) const
inline

Definition at line 208 of file StdMesh.h.

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

208 { return BoundingBox; }

Here is the caller graph for this function:

float StdMesh::GetBoundingRadius ( ) const
inline

Definition at line 209 of file StdMesh.h.

Referenced by CStdGL::PerformMesh().

209 { return BoundingRadius; }

Here is the caller graph for this function:

GLuint StdMesh::GetIBO ( ) const
inline

Definition at line 215 of file StdMesh.h.

215 { return ibo; }
size_t StdMesh::GetNumSubMeshes ( ) const
inline

Definition at line 201 of file StdMesh.h.

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

201 { return SubMeshes.size(); }

Here is the caller graph for this function:

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

Definition at line 203 of file StdMesh.h.

203 { return SharedVertices; }
const StdMeshSkeleton& StdMesh::GetSkeleton ( ) const
inline

Definition at line 205 of file StdMesh.h.

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

205 { return *Skeleton; }

Here is the caller graph for this function:

StdMeshSkeleton& StdMesh::GetSkeleton ( )
inline

Definition at line 206 of file StdMesh.h.

206 { return *Skeleton; }
const StdSubMesh& StdMesh::GetSubMesh ( size_t  i) const
inline

Definition at line 200 of file StdMesh.h.

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

200 { return SubMeshes[i]; }

Here is the caller graph for this function:

unsigned int StdMesh::GetVAOID ( ) const
inline

Definition at line 216 of file StdMesh.h.

216 { return vaoid; }
GLuint StdMesh::GetVBO ( ) const
inline

Definition at line 214 of file StdMesh.h.

214 { return vbo; }
void StdMesh::PostInit ( )

Definition at line 577 of file StdMesh.cpp.

References CStdGL::GenVAOID(), and pGL.

578 {
579 #ifndef USE_CONSOLE
580  // Order submeshes so that opaque submeshes come before non-opaque ones
581  std::sort(SubMeshes.begin(), SubMeshes.end(), StdMeshSubMeshVisibilityCmpPred());
582  UpdateVBO();
583  UpdateIBO();
584 
585  // Allocate a VAO ID as well
586  assert(vaoid == 0);
587  vaoid = pGL->GenVAOID();
588 #endif
589 }
unsigned int GenVAOID()
Definition: C4DrawGL.cpp:934
CStdGL * pGL
Definition: C4DrawGL.cpp:914

Here is the call graph for this function:

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

Definition at line 219 of file StdMesh.h.

Referenced by C4DefGraphics::LoadMesh().

219 { Label = label; }

Here is the caller graph for this function:

Friends And Related Function Documentation

friend class StdMeshLoader
friend

Definition at line 191 of file StdMesh.h.

friend class StdMeshMaterialUpdate
friend

Definition at line 192 of file StdMesh.h.


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