| Linderdaum Engine: clMesh Class Reference | ![]() |
#include <Mesh.h>
Public Member Functions | |
| clMesh () | |
| virtual | ~clMesh () |
| clMesh * | CloneMesh () const |
| Internal copy routine. Temporarily implemented using Save-Load pair. | |
| void | MergeRigids (int Idx1, int Idx2) |
| Merge some vertex attribs in a mesh. No animation support yet. | |
| void | MergeSimilarRigids () |
| Merge all similar (determined by rigid name) | |
| void | MergeWith (clMesh *M) |
| Add all rigids from another mesh. Won't work (yet) with hierarchical meshes. | |
| void | Transform (const LMatrix4 &T) |
| Transform every root node of the mesh by the given matrix. | |
| void | FlattenMesh () |
| Transform vertices of each rigid to global coordinates. | |
| void | CopyMaterialsFrom (const clMesh *M) |
| bool | LoadMesh (const std::string &FileName) |
| bool | SaveMesh (const std::string &FileName) |
| void | SaveToStream (iOStream *Stream) const |
| bool | LoadFromStream (iIStream *Stream) |
| void | SaveToBinaryFile (const std::string &FName) const |
| void | LoadFromBinaryFile (const std::string &FName) |
| sAnimSequence | GetAnimSequenceByName (const std::string &Name) const |
| clAnimation * | GetAnimation () const |
| std::string | GetAnimSequenceName (size_t i) const |
| size_t | GetNumAnimSequences () const |
| void | LoadAnimStates (const std::string &FileName) |
| int | AddVertexAttribs (const std::string &Name, clVertexAttribs *Attribs, const LMatrix4 &GlobalTransform, int ParentID, int MaterialID) |
| add new part to the mesh and return its ID and take ownership of Attribs | |
| void | RemoveVertexAttribs (int RigidID) |
| Remove the rigid from mesh. WARNING: no mesh hierarchy checks are done. So if there are child nodes something can crash. | |
| int | FindRigidByName (const std::string &Name) const |
| int | AddMaterial (const sMaterialDesc &Material) |
| add new material to the mesh and return its ID | |
| void | RecalculateLocalFromGlobal () |
| fills the FLocalTransforms array based on FGlobalTransforms | |
| LAABoundingBox | GetBoundingBox () const |
| recalculate and return AABB for the entire mesh | |
| LAABoundingBox | GetCachedBoundingBox () const |
| return cached AABB for the entire mesh | |
| void | PrecalculateBoundingBoxes () |
| size_t | GetMaterialsCount () const |
| sMaterialDesc | GetMaterialDesc (int i) const |
| size_t | GetRigidsCount () const |
| clVertexAttribs * | GetRigid (size_t i) const |
| std::string | GetRigidName (size_t i) const |
| int | GetParentRef (size_t i) const |
| int | GetRigidMaterial (size_t i) const |
| const sMaterialDesc * | GetMaterial (size_t i) const |
| const LMatrix4 & | GetLocalTransform (size_t i) const |
| iVertexArray * | GetVertexArray (size_t i) const |
| iTexture * | GetPackedSkeleton (size_t i) const |
| bool | IntersectWithRay (const LVector3 &P, const LVector3 &A, LVector3 &isect) const |
| Check intersection with ray and calculate intersection point. | |
| bool | IntersectWithRayIdx (const LVector3 &P, const LVector3 &A, LVector3 &isect, int &Rigid) const |
| Check intersection with ray and calculate intersection point and return rigid index. | |
Private Attributes | |
| std::vector< clVertexAttribs * > | FRigids |
| Collection of rigid parts of the mesh. | |
| std::vector< std::string > | FNames |
| Names of the rigids. | |
| sAttribStream< LMatrix4 > | FLocalTransforms |
| Local transformation for every rigid. | |
| sAttribStream< LMatrix4 > | FGlobalTransforms |
| Precached global transformations. | |
| sAttribStream< int > | FParentRef |
| Parent index for every rigid. -1 if none. | |
| sAttribStream< int > | FMaterialRef |
| Material index for every rigid. No multimaterials are possible here. | |
| sAttribStream< sMaterialDesc > | FMaterials |
| Collection of mesh materials. | |
| clAnimation * | FAnimations |
| Collection of named animations. | |
| std::vector< iVertexArray * > | FVertexArrays |
| Precached rendering vertex arrays used by RenderDirect() | |
| std::vector< iTexture * > | FPackedSkeletons |
| LAABoundingBox | FAABB |
| Precached AABB. | |
| bool | FAABBValid |
| clMesh::clMesh | ( | ) |
| clMesh::~clMesh | ( | ) | [virtual] |
| int clMesh::AddMaterial | ( | const sMaterialDesc & | Material | ) |
add new material to the mesh and return its ID
| int clMesh::AddVertexAttribs | ( | const std::string & | Name, |
| clVertexAttribs * | Attribs, | ||
| const LMatrix4 & | GlobalTransform, | ||
| int | ParentID, | ||
| int | MaterialID | ||
| ) |
add new part to the mesh and return its ID and take ownership of Attribs
| clMesh * clMesh::CloneMesh | ( | ) | const |
Internal copy routine. Temporarily implemented using Save-Load pair.
| void clMesh::CopyMaterialsFrom | ( | const clMesh * | M | ) |
| int clMesh::FindRigidByName | ( | const std::string & | Name | ) | const |
| void clMesh::FlattenMesh | ( | ) |
Transform vertices of each rigid to global coordinates.
| clAnimation* clMesh::GetAnimation | ( | ) | const [inline] |
| sAnimSequence clMesh::GetAnimSequenceByName | ( | const std::string & | Name | ) | const |
| std::string clMesh::GetAnimSequenceName | ( | size_t | i | ) | const |
| LAABoundingBox clMesh::GetBoundingBox | ( | ) | const |
recalculate and return AABB for the entire mesh
| LAABoundingBox clMesh::GetCachedBoundingBox | ( | ) | const |
return cached AABB for the entire mesh
| const LMatrix4& clMesh::GetLocalTransform | ( | size_t | i | ) | const [inline] |
| const sMaterialDesc* clMesh::GetMaterial | ( | size_t | i | ) | const [inline] |
| sMaterialDesc clMesh::GetMaterialDesc | ( | int | i | ) | const [inline] |
| size_t clMesh::GetMaterialsCount | ( | ) | const [inline] |
| size_t clMesh::GetNumAnimSequences | ( | ) | const |
| iTexture * clMesh::GetPackedSkeleton | ( | size_t | i | ) | const |
| int clMesh::GetParentRef | ( | size_t | i | ) | const [inline] |
| clVertexAttribs* clMesh::GetRigid | ( | size_t | i | ) | const [inline] |
| int clMesh::GetRigidMaterial | ( | size_t | i | ) | const [inline] |
| std::string clMesh::GetRigidName | ( | size_t | i | ) | const [inline] |
| size_t clMesh::GetRigidsCount | ( | ) | const [inline] |
| iVertexArray * clMesh::GetVertexArray | ( | size_t | i | ) | const |
Check intersection with ray and calculate intersection point.
| bool clMesh::IntersectWithRayIdx | ( | const LVector3 & | P, |
| const LVector3 & | A, | ||
| LVector3 & | isect, | ||
| int & | Rigid | ||
| ) | const |
Check intersection with ray and calculate intersection point and return rigid index.
| void clMesh::LoadAnimStates | ( | const std::string & | FileName | ) |
| void clMesh::LoadFromBinaryFile | ( | const std::string & | FName | ) |
| bool clMesh::LoadFromStream | ( | iIStream * | Stream | ) |
| bool clMesh::LoadMesh | ( | const std::string & | FileName | ) |
Merge some vertex attribs in a mesh. No animation support yet.
| void clMesh::MergeSimilarRigids | ( | ) |
Merge all similar (determined by rigid name)
While there are still items to merge
| void clMesh::MergeWith | ( | clMesh * | M | ) |
Add all rigids from another mesh. Won't work (yet) with hierarchical meshes.
| void clMesh::PrecalculateBoundingBoxes | ( | ) |
| void clMesh::RecalculateLocalFromGlobal | ( | ) |
fills the FLocalTransforms array based on FGlobalTransforms
| void clMesh::RemoveVertexAttribs | ( | int | RigidID | ) |
Remove the rigid from mesh. WARNING: no mesh hierarchy checks are done. So if there are child nodes something can crash.
| bool clMesh::SaveMesh | ( | const std::string & | FileName | ) |
| void clMesh::SaveToBinaryFile | ( | const std::string & | FName | ) | const |
| void clMesh::SaveToStream | ( | iOStream * | Stream | ) | const |
| void clMesh::Transform | ( | const LMatrix4 & | T | ) |
Transform every root node of the mesh by the given matrix.
LAABoundingBox clMesh::FAABB [mutable, private] |
Precached AABB.
bool clMesh::FAABBValid [mutable, private] |
clAnimation* clMesh::FAnimations [private] |
Collection of named animations.
sAttribStream<LMatrix4> clMesh::FGlobalTransforms [private] |
Precached global transformations.
sAttribStream<LMatrix4> clMesh::FLocalTransforms [private] |
Local transformation for every rigid.
sAttribStream<int> clMesh::FMaterialRef [private] |
Material index for every rigid. No multimaterials are possible here.
sAttribStream<sMaterialDesc> clMesh::FMaterials [private] |
Collection of mesh materials.
std::vector< std::string > clMesh::FNames [private] |
Names of the rigids.
std::vector<iTexture*> clMesh::FPackedSkeletons [mutable, private] |
sAttribStream<int> clMesh::FParentRef [private] |
Parent index for every rigid. -1 if none.
std::vector<clVertexAttribs*> clMesh::FRigids [private] |
Collection of rigid parts of the mesh.
std::vector<iVertexArray*> clMesh::FVertexArrays [mutable, private] |
Precached rendering vertex arrays used by RenderDirect()