|
@@ -36,81 +36,66 @@ public:
|
|
|
const VertexAttribute attrib, const U32 lod, const U32 texChannel,
|
|
const VertexAttribute attrib, const U32 lod, const U32 texChannel,
|
|
|
Vbo* vbo, U32& size, GLenum& type, U32& stride, U32& offset) = 0;
|
|
Vbo* vbo, U32& size, GLenum& type, U32& stride, U32& offset) = 0;
|
|
|
|
|
|
|
|
- virtual U32 getVerticesCount() const = 0;
|
|
|
|
|
-
|
|
|
|
|
- virtual U32 getIndicesCount(U32 lod) const = 0;
|
|
|
|
|
-
|
|
|
|
|
- virtual U32 getTextureChannelsCount() const = 0;
|
|
|
|
|
-
|
|
|
|
|
- virtual Bool hasWeights() const = 0;
|
|
|
|
|
-
|
|
|
|
|
- virtual U32 getLodsCount() const = 0;
|
|
|
|
|
-
|
|
|
|
|
- virtual const Obb& getBoundingShape() const = 0;
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-/// Mesh Resource. It contains the geometry packed in VBOs
|
|
|
|
|
-class Mesh: public MeshBase
|
|
|
|
|
-{
|
|
|
|
|
-public:
|
|
|
|
|
- /// @name Constructors
|
|
|
|
|
- /// @{
|
|
|
|
|
-
|
|
|
|
|
- /// Default constructor. Do nothing
|
|
|
|
|
- Mesh()
|
|
|
|
|
- {}
|
|
|
|
|
-
|
|
|
|
|
- /// Load file
|
|
|
|
|
- Mesh(const char* filename)
|
|
|
|
|
- {
|
|
|
|
|
- load(filename);
|
|
|
|
|
- }
|
|
|
|
|
- /// @}
|
|
|
|
|
-
|
|
|
|
|
- /// Does nothing
|
|
|
|
|
- ~Mesh()
|
|
|
|
|
- {}
|
|
|
|
|
-
|
|
|
|
|
- /// @name Accessors
|
|
|
|
|
- /// @{
|
|
|
|
|
-
|
|
|
|
|
- /// Implements MeshBase::getVerticesCount
|
|
|
|
|
U32 getVerticesCount() const
|
|
U32 getVerticesCount() const
|
|
|
{
|
|
{
|
|
|
return vertsCount;
|
|
return vertsCount;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /// Implements MeshBase::getIndicesCount
|
|
|
|
|
- U32 getIndicesCount(U32 lod) const
|
|
|
|
|
|
|
+ U32 getIndicesCount(U32 lod)
|
|
|
{
|
|
{
|
|
|
return indicesCount[lod];
|
|
return indicesCount[lod];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /// Implements MeshBase::getTextureChannelsCount
|
|
|
|
|
U32 getTextureChannelsCount() const
|
|
U32 getTextureChannelsCount() const
|
|
|
{
|
|
{
|
|
|
return texChannelsCount;
|
|
return texChannelsCount;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /// Implements MeshBase::hasWeights
|
|
|
|
|
Bool hasWeights() const
|
|
Bool hasWeights() const
|
|
|
{
|
|
{
|
|
|
return weights;
|
|
return weights;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /// Implements MeshBase::getLodsCount
|
|
|
|
|
U32 getLodsCount() const
|
|
U32 getLodsCount() const
|
|
|
{
|
|
{
|
|
|
- return indicesVbos.size();
|
|
|
|
|
|
|
+ return indicesCount.size();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /// Implements MeshBase::getBoundingShape
|
|
|
|
|
const Obb& getBoundingShape() const
|
|
const Obb& getBoundingShape() const
|
|
|
{
|
|
{
|
|
|
return visibilityShape;
|
|
return visibilityShape;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+protected:
|
|
|
|
|
+ U32 vertsCount;
|
|
|
|
|
+ Vector<U32> indicesCount; ///< Indices count per level
|
|
|
|
|
+ U32 texChannelsCount;
|
|
|
|
|
+ Bool weights;
|
|
|
|
|
+ Obb visibilityShape;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+/// Mesh Resource. It contains the geometry packed in VBOs
|
|
|
|
|
+class Mesh: public MeshBase
|
|
|
|
|
+{
|
|
|
|
|
+public:
|
|
|
|
|
+ /// @name Constructors
|
|
|
|
|
+ /// @{
|
|
|
|
|
+
|
|
|
|
|
+ /// Default constructor. Do nothing
|
|
|
|
|
+ Mesh()
|
|
|
|
|
+ {}
|
|
|
|
|
+
|
|
|
|
|
+ /// Load file
|
|
|
|
|
+ Mesh(const char* filename)
|
|
|
|
|
+ {
|
|
|
|
|
+ load(filename);
|
|
|
|
|
+ }
|
|
|
/// @}
|
|
/// @}
|
|
|
|
|
|
|
|
|
|
+ /// Does nothing
|
|
|
|
|
+ ~Mesh()
|
|
|
|
|
+ {}
|
|
|
|
|
+
|
|
|
/// Load from a file
|
|
/// Load from a file
|
|
|
void load(const char* filename);
|
|
void load(const char* filename);
|
|
|
|
|
|
|
@@ -123,13 +108,6 @@ private:
|
|
|
Vbo vbo;
|
|
Vbo vbo;
|
|
|
Vector<Vbo> indicesVbos;
|
|
Vector<Vbo> indicesVbos;
|
|
|
|
|
|
|
|
- U32 vertsCount;
|
|
|
|
|
- Vector<U32> indicesCount; ///< Indices count per level
|
|
|
|
|
- Bool weights;
|
|
|
|
|
- U32 texChannelsCount;
|
|
|
|
|
-
|
|
|
|
|
- Obb visibilityShape;
|
|
|
|
|
-
|
|
|
|
|
/// Create the VBOs using the mesh data
|
|
/// Create the VBOs using the mesh data
|
|
|
void createVbos(const MeshLoader& meshData);
|
|
void createVbos(const MeshLoader& meshData);
|
|
|
|
|
|