Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 259 vs 270 for /trunk/Source Code/Geometry/Shapes/Headers/SubMesh.h

Diff revisions: vs.
  @@ -39,49 +39,47 @@
39 39 */
40 40
41 41 #include "core.h"
42 - #include "Hardware/Video/Buffers/VertexBuffer/Headers/VertexBuffer.h"
42 + #include "Mesh.h"
43 43
44 - class Mesh;
45 44 class SubMesh : public Object3D {
46 45 public:
47 - SubMesh(const std::string& name, ObjectFlag flag = OBJECT_FLAG_NONE) :
48 - Object3D(name,SUBMESH,TRIANGLES,flag),
49 - _visibleToNetwork(true),
50 - _render(true),
51 - _id(0),
52 - _parentMesh(nullptr),
53 - _parentMeshSGN(nullptr)
54 - {
55 - }
56 -
57 - virtual ~SubMesh();
58 -
59 - bool unload() { return SceneNode::unload(); }
60 -
61 - bool computeBoundingBox(SceneGraphNode* const sgn);
62 -
63 - inline U32 getId() {return _id;}
64 - /// When loading a submesh, the ID is the node index from the imported scene
65 - /// scene->mMeshes[n] == (SubMesh with _id == n)
66 - inline void setId(U32 id) {_id = id;}
67 - virtual void postLoad(SceneGraphNode* const sgn);
68 - inline Mesh* getParentMesh() {return _parentMesh;}
69 - inline void setSceneMatrix(const mat4<F32>& sceneMatrix){ _sceneRootMatrix = sceneMatrix; }
46 + SubMesh(const std::string& name, ObjectFlag flag = OBJECT_FLAG_NONE);
47 +
48 + virtual ~SubMesh();
49 +
50 + bool unload() { return SceneNode::unload(); }
51 +
52 + bool computeBoundingBox(SceneGraphNode* const sgn);
53 +
54 + inline U32 getId() {return _id;}
55 + /// When loading a submesh, the ID is the node index from the imported scene
56 + /// scene->mMeshes[n] == (SubMesh with _id == n)
57 + inline void setId(U32 id) {_id = id;}
58 + virtual void postLoad(SceneGraphNode* const sgn);
59 + inline Mesh* getParentMesh() {return _parentMesh;}
60 + inline void setSceneMatrix(const mat4<F32>& sceneMatrix){ _sceneRootMatrix = sceneMatrix; }
70 61
71 62 protected:
72 - friend class Mesh;
73 - inline void setParentMesh(Mesh* const parentMesh) {_parentMesh = parentMesh;}
63 + friend class Mesh;
64 + inline void setParentMesh(Mesh* const parentMesh) { _parentMesh = parentMesh; }
74 65 inline void setParentMeshSGN(SceneGraphNode* const meshSGN) { _parentMeshSGN = meshSGN; }
75 66
76 - friend class DVDConverter;
77 - mat4<F32> _sceneRootMatrix;
67 + void render(SceneGraphNode* const sgn, const SceneRenderState& sceneRenderState);
68 +
69 + friend class DVDConverter;
70 + mat4<F32> _sceneRootMatrix;
78 71
72 + inline void setGeometryPartitionId(size_t idx) { _geometryPartitionId = (U32)idx; }
73 + inline void setGeometryLimits(const vec3<F32>& min, const vec3<F32>& max) { _importBB.set(min, max);}
74 +
79 75 protected:
80 - bool _visibleToNetwork;
81 - bool _render;
82 - U32 _id;
83 - Mesh* _parentMesh;
76 + bool _visibleToNetwork;
77 + bool _render;
78 + U32 _id;
79 + U32 _geometryPartitionId;
80 + Mesh* _parentMesh;
84 81 SceneGraphNode* _parentMeshSGN;
82 + BoundingBox _importBB;
85 83 };
86 84
87 85 #endif