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 187 of file StdMesh.h.

Member Typedef Documentation

Definition at line 196 of file StdMesh.h.

Constructor & Destructor Documentation

StdMesh::~StdMesh ( )

Definition at line 555 of file StdMesh.cpp.

References CStdGL::FreeVAOID(), and pGL.

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

Here is the call graph for this function:

Member Function Documentation

const StdMeshBox& StdMesh::GetBoundingBox ( ) const
inline

Definition at line 206 of file StdMesh.h.

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

206 { return BoundingBox; }

Here is the caller graph for this function:

float StdMesh::GetBoundingRadius ( ) const
inline

Definition at line 207 of file StdMesh.h.

Referenced by CStdGL::PerformMesh().

207 { return BoundingRadius; }

Here is the caller graph for this function:

GLuint StdMesh::GetIBO ( ) const
inline

Definition at line 213 of file StdMesh.h.

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

Definition at line 199 of file StdMesh.h.

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

199 { return SubMeshes.size(); }

Here is the caller graph for this function:

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

Definition at line 201 of file StdMesh.h.

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

Definition at line 203 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().

203 { return *Skeleton; }

Here is the caller graph for this function:

StdMeshSkeleton& StdMesh::GetSkeleton ( )
inline

Definition at line 204 of file StdMesh.h.

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

Definition at line 198 of file StdMesh.h.

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

198 { return SubMeshes[i]; }

Here is the caller graph for this function:

unsigned int StdMesh::GetVAOID ( ) const
inline

Definition at line 214 of file StdMesh.h.

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

Definition at line 212 of file StdMesh.h.

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

Definition at line 567 of file StdMesh.cpp.

References CStdGL::GenVAOID(), and pGL.

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

Here is the call graph for this function:

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

Definition at line 217 of file StdMesh.h.

Referenced by C4DefGraphics::LoadMesh().

217 { Label = label; }

Here is the caller graph for this function:

Friends And Related Function Documentation

friend class StdMeshLoader
friend

Definition at line 189 of file StdMesh.h.

friend class StdMeshMaterialUpdate
friend

Definition at line 190 of file StdMesh.h.


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