Castor3D
..
|
The submesh representation. More...
Classes | |
class | BinaryParser |
MovableObject loader. More... | |
class | TextLoader |
Submesh text loader. More... | |
Public Member Functions | |
C3D_API | Submesh (Engine &p_engine, MeshRPtr p_mesh, uint32_t p_id=1) |
Constructor. More... | |
C3D_API | ~Submesh () |
Destructor. More... | |
C3D_API void | Initialise () |
Initialises the submesh. More... | |
C3D_API void | Cleanup () |
Cleans the submesh. More... | |
C3D_API void | ComputeContainers () |
Computes the containers (cube and sphere) More... | |
C3D_API uint32_t | GetFaceCount () const |
C3D_API uint32_t | GetPointsCount () const |
C3D_API int | IsInMyPoints (Castor::Point3r const &p_vertex, double p_precision) |
Tests if the given Point3r is in mine. More... | |
C3D_API BufferElementGroupSPtr | AddPoint (real x, real y, real z) |
Creates and adds a vertex to my list. More... | |
C3D_API BufferElementGroupSPtr | AddPoint (Castor::Point3r const &p_v) |
Adds a vertex to my list. More... | |
C3D_API BufferElementGroupSPtr | AddPoint (real *p_v) |
Creates and adds a vertex to my list. More... | |
C3D_API void | AddPoints (stVERTEX_GROUP const &p_vertices) |
Adds a points list to my list. More... | |
C3D_API void | AddBoneDatas (stVERTEX_BONE_DATA const *const p_boneDataBegin, stVERTEX_BONE_DATA const *const p_boneDataEnd) |
Adds bone datas. More... | |
void | AddBoneDatas (stVERTEX_BONE_DATA const *const p_boneData, uint32_t p_count) |
Adds bone datas. More... | |
void | AddBoneDatas (std::vector< stVERTEX_BONE_DATA > const &p_boneData) |
Adds bone datas. More... | |
template<uint32_t Count> | |
void | AddBoneDatas (stVERTEX_BONE_DATA const (&p_boneData)[Count]) |
Adds bone datas. More... | |
C3D_API void | ClearFaces () |
Clears this submesh's face array. More... | |
C3D_API Face | AddFace (uint32_t a, uint32_t b, uint32_t c) |
Creates and adds a face to the submesh. More... | |
C3D_API void | AddFaceGroup (stFACE_INDICES *p_faces, uint32_t p_count) |
Creates and adds faces to the submesh. More... | |
C3D_API void | AddQuadFace (uint32_t a, uint32_t b, uint32_t c, uint32_t d, Castor::Point3r const &p_minUV=Castor::Point3r(), Castor::Point3r const &p_maxUV=Castor::Point3r(1, 1, 1)) |
Creates and adds a quad face to the submesh. More... | |
C3D_API SubmeshSPtr | Clone () |
Clones the submesh and returns the clone. More... | |
C3D_API void | ResetGpuBuffers () |
Recreates the Vertex and Index buffers. More... | |
C3D_API void | Draw (ShaderProgram const &p_program) |
Draws the submesh. More... | |
C3D_API void | DrawInstanced (ShaderProgram const &p_program, uint32_t p_count) |
Draws the submesh. More... | |
C3D_API void | ComputeFacesFromPolygonVertex () |
Creates faces from the points. More... | |
C3D_API void | ComputeNormals (bool p_reverted=false) |
Generates normals and tangents. More... | |
C3D_API void | ComputeNormals (Face const &p_face) |
Computes normal and tangent for each vertex of the given face. More... | |
C3D_API void | ComputeTangents (Face const &p_face) |
Computes tangent for each vertex of the given face. More... | |
C3D_API void | ComputeTangentsFromNormals () |
Computes tangent for each vertex of the submesh. More... | |
C3D_API void | ComputeTangentsFromBitangents () |
Computes tangent for each vertex of the submesh. More... | |
C3D_API void | ComputeBitangents () |
Computes bitangent for each vertex of the submesh. More... | |
C3D_API void | SortFaces (Castor::Point3r const &p_cameraPosition) |
Sorts the face from farthest to nearest from the camera. More... | |
C3D_API void | Ref (MaterialSPtr p_material) |
Increments instance count. More... | |
C3D_API void | UnRef (MaterialSPtr p_material) |
Decrements instance count. More... | |
C3D_API uint32_t | GetRefCount (MaterialSPtr p_material) const |
Retrieves the instances count. More... | |
C3D_API eTOPOLOGY | GetTopology () const |
C3D_API void | SetTopology (eTOPOLOGY p_value) |
Sets the topology. More... | |
SkeletonSPtr | GetSkeleton () const |
Retrieves the skeleton. More... | |
void | SetDefaultMaterial (MaterialSPtr p_mat) |
Sets the material. More... | |
BufferElementGroupSPtr | operator[] (uint32_t p_index) const |
Retrieves the point at given index. More... | |
BufferElementGroupSPtr | GetPoint (uint32_t p_index) const |
Retrieves the point at given index. More... | |
MaterialSPtr | GetDefaultMaterial () const |
Retrieves the material. More... | |
Castor::CubeBox const & | GetCubeBox () const |
Retrieves the cube bounding box. More... | |
Castor::CubeBox & | GetCubeBox () |
Retrieves the cube bounding box. More... | |
Castor::SphereBox const & | GetSphere () const |
Retrieves the sphere bounding box. More... | |
Castor::SphereBox & | GetSphere () |
Retrieves the sphere bounding box. More... | |
VertexPtrArray const & | GetPoints () const |
Retrieves the points array. More... | |
VertexPtrArray & | GetPoints () |
Retrieves the points array. More... | |
Face const & | GetFace (uint32_t p_index) const |
Retrieves the face at given index. More... | |
FaceArray const & | GetFaces () const |
Retrieves the faces array. More... | |
FaceArray & | GetFaces () |
Retrieves the faces array. More... | |
bool | HasVertexBuffer () const |
bool | HasIndexBuffer () const |
bool | HasBonesBuffer () const |
bool | HasMatrixBuffer () const |
VertexBuffer const & | GetVertexBuffer () const |
VertexBuffer & | GetVertexBuffer () |
IndexBuffer const & | GetIndexBuffer () const |
IndexBuffer & | GetIndexBuffer () |
VertexBuffer const & | GetBonesBuffer () const |
VertexBuffer & | GetBonesBuffer () |
VertexBuffer const & | GetMatrixBuffer () const |
VertexBuffer & | GetMatrixBuffer () |
bool | IsInitialised () const |
Retrieves the initialisation status. More... | |
MeshRPtr | GetParent () const |
Retrieves the parent mesh. More... | |
uint32_t | GetProgramFlags () const |
Retrieves the shader program flags. More... | |
template<uint32_t Count> | |
void | AddFaceGroup (stFACE_INDICES(&p_faces)[Count]) |
Creates and adds faces to the submesh. More... | |
Friends | |
class | GeometryBuffers |
The submesh representation.
C3D_API Castor3D::Submesh::Submesh | ( | Engine & | p_engine, |
MeshRPtr | p_mesh, | ||
uint32_t | p_id = 1 |
||
) |
Constructor.
[in] | p_mesh | The parent mesh |
[in] | p_engine | The core engine |
[in] | p_id | The submesh ID |
C3D_API Castor3D::Submesh::~Submesh | ( | ) |
Destructor.
C3D_API void Castor3D::Submesh::AddBoneDatas | ( | stVERTEX_BONE_DATA const *const | p_boneDataBegin, |
stVERTEX_BONE_DATA const *const | p_boneDataEnd | ||
) |
Adds bone datas.
[in] | p_boneDataBegin | The bone datas begin. |
[in] | p_boneDataEnd | The bone datas end. |
Referenced by AddBoneDatas().
|
inline |
Adds bone datas.
[in] | p_boneData | The bone datas. |
[in] | p_count | The data count. |
References AddBoneDatas().
|
inline |
Adds bone datas.
[in] | p_boneData | The bone datas. |
References AddBoneDatas().
|
inline |
Adds bone datas.
[in] | p_boneData | The bone datas. |
References AddBoneDatas().
C3D_API Face Castor3D::Submesh::AddFace | ( | uint32_t | a, |
uint32_t | b, | ||
uint32_t | c | ||
) |
Creates and adds a face to the submesh.
[in] | a | The first face's vertex index |
[in] | b | The second face's vertex index |
[in] | c | The third face's vertex index |
C3D_API void Castor3D::Submesh::AddFaceGroup | ( | stFACE_INDICES * | p_faces, |
uint32_t | p_count | ||
) |
Creates and adds faces to the submesh.
[in] | p_faces | The faces |
[in] | p_count | The faces count |
Referenced by AddFaceGroup().
|
inline |
Creates and adds faces to the submesh.
[in] | p_faces | The faces |
References AddFaceGroup().
C3D_API BufferElementGroupSPtr Castor3D::Submesh::AddPoint | ( | real | x, |
real | y, | ||
real | z | ||
) |
Creates and adds a vertex to my list.
[in] | x | The vertex X coordinate |
[in] | y | The vertex Y coordinate |
[in] | z | The vertex Z coordinate |
C3D_API BufferElementGroupSPtr Castor3D::Submesh::AddPoint | ( | Castor::Point3r const & | p_v | ) |
Adds a vertex to my list.
[in] | p_v | The vertex to add |
C3D_API BufferElementGroupSPtr Castor3D::Submesh::AddPoint | ( | real * | p_v | ) |
Creates and adds a vertex to my list.
[in] | p_v | The vertex coordinates |
C3D_API void Castor3D::Submesh::AddPoints | ( | stVERTEX_GROUP const & | p_vertices | ) |
Adds a points list to my list.
[in] | p_vertices | The vertices |
C3D_API void Castor3D::Submesh::AddQuadFace | ( | uint32_t | a, |
uint32_t | b, | ||
uint32_t | c, | ||
uint32_t | d, | ||
Castor::Point3r const & | p_minUV = Castor::Point3r() , |
||
Castor::Point3r const & | p_maxUV = Castor::Point3r(1, 1, 1) |
||
) |
Creates and adds a quad face to the submesh.
[in] | a | The first face's vertex index |
[in] | b | The second face's vertex index |
[in] | c | The third face's vertex index |
[in] | d | The fourth face's vertex index |
[in] | p_minUV | The UV of the bottom left corner |
[in] | p_maxUV | The UV of the top right corner |
C3D_API void Castor3D::Submesh::Cleanup | ( | ) |
Cleans the submesh.
C3D_API void Castor3D::Submesh::ClearFaces | ( | ) |
Clears this submesh's face array.
C3D_API SubmeshSPtr Castor3D::Submesh::Clone | ( | ) |
Clones the submesh and returns the clone.
C3D_API void Castor3D::Submesh::ComputeBitangents | ( | ) |
Computes bitangent for each vertex of the submesh.
C3D_API void Castor3D::Submesh::ComputeContainers | ( | ) |
Computes the containers (cube and sphere)
C3D_API void Castor3D::Submesh::ComputeFacesFromPolygonVertex | ( | ) |
Creates faces from the points.
C3D_API void Castor3D::Submesh::ComputeNormals | ( | bool | p_reverted = false | ) |
Generates normals and tangents.
C3D_API void Castor3D::Submesh::ComputeNormals | ( | Face const & | p_face | ) |
Computes normal and tangent for each vertex of the given face.
[in] | p_face | The face |
C3D_API void Castor3D::Submesh::ComputeTangents | ( | Face const & | p_face | ) |
Computes tangent for each vertex of the given face.
[in] | p_face | The face |
C3D_API void Castor3D::Submesh::ComputeTangentsFromBitangents | ( | ) |
Computes tangent for each vertex of the submesh.
C3D_API void Castor3D::Submesh::ComputeTangentsFromNormals | ( | ) |
Computes tangent for each vertex of the submesh.
C3D_API void Castor3D::Submesh::Draw | ( | ShaderProgram const & | p_program | ) |
Draws the submesh.
[in] | p_program | The shader program. |
C3D_API void Castor3D::Submesh::DrawInstanced | ( | ShaderProgram const & | p_program, |
uint32_t | p_count | ||
) |
Draws the submesh.
[in] | p_program | The shader program. |
[in] | p_count | The instances count. |
|
inline |
|
inline |
|
inline |
Retrieves the cube bounding box.
|
inline |
Retrieves the cube bounding box.
|
inline |
Retrieves the material.
|
inline |
Retrieves the face at given index.
[in] | p_index | The index |
C3D_API uint32_t Castor3D::Submesh::GetFaceCount | ( | ) | const |
|
inline |
Retrieves the faces array.
|
inline |
Retrieves the faces array.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Retrieves the parent mesh.
Referenced by GetSkeleton().
|
inline |
Retrieves the point at given index.
[in] | p_index | The index |
|
inline |
Retrieves the points array.
|
inline |
Retrieves the points array.
C3D_API uint32_t Castor3D::Submesh::GetPointsCount | ( | ) | const |
|
inline |
Retrieves the shader program flags.
C3D_API uint32_t Castor3D::Submesh::GetRefCount | ( | MaterialSPtr | p_material | ) | const |
Retrieves the instances count.
[in] | p_material | The material for which the instance count is retrieved |
|
inline |
Retrieves the skeleton.
References GetParent().
|
inline |
Retrieves the sphere bounding box.
|
inline |
Retrieves the sphere bounding box.
C3D_API eTOPOLOGY Castor3D::Submesh::GetTopology | ( | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
C3D_API void Castor3D::Submesh::Initialise | ( | ) |
Initialises the submesh.
|
inline |
Retrieves the initialisation status.
true
if initialised C3D_API int Castor3D::Submesh::IsInMyPoints | ( | Castor::Point3r const & | p_vertex, |
double | p_precision | ||
) |
Tests if the given Point3r is in mine.
[in] | p_vertex | The vertex to test |
[in] | p_precision | The comparison precision |
|
inline |
Retrieves the point at given index.
[in] | p_index | The index |
C3D_API void Castor3D::Submesh::Ref | ( | MaterialSPtr | p_material | ) |
Increments instance count.
[in] | p_material | The material for which the instance count is incremented |
C3D_API void Castor3D::Submesh::ResetGpuBuffers | ( | ) |
Recreates the Vertex and Index buffers.
|
inline |
Sets the material.
[in] | p_mat | The new value |
C3D_API void Castor3D::Submesh::SetTopology | ( | eTOPOLOGY | p_value | ) |
Sets the topology.
[in] | p_value | The new value. |
C3D_API void Castor3D::Submesh::SortFaces | ( | Castor::Point3r const & | p_cameraPosition | ) |
Sorts the face from farthest to nearest from the camera.
[in] | p_cameraPosition | The camera position, relative to submesh |
C3D_API void Castor3D::Submesh::UnRef | ( | MaterialSPtr | p_material | ) |
Decrements instance count.
[in] | p_material | The material for which the instance count is decremented |
|
friend |