34 #ifndef MESH_VERTEXBUFFERBASE_H
35 #define MESH_VERTEXBUFFERBASE_H
43 class VertexBufferDist;
50 class VertexBufferData;
51 class VertexBufferState;
54 class VertexBufferBase
57 virtual ~VertexBufferBase() {};
59 virtual void draw( VertexBufferState& state )
const = 0;
60 void drawBoundingSphere( VertexBufferState& state )
const;
61 virtual Index getNumberOfVertices()
const = 0;
63 const BoundingSphere& getBoundingSphere()
const
64 {
return _boundingSphere; }
66 const float* getRange()
const {
return &_range[0]; }
68 virtual const VertexBufferBase* getLeft()
const {
return 0; }
69 virtual const VertexBufferBase* getRight()
const {
return 0; }
71 virtual const BoundingSphere& updateBoundingSphere() = 0;
74 VertexBufferBase() : _boundingSphere( 0.0f )
80 virtual void toStream( std::ostream& os )
82 os.write( reinterpret_cast< char* >( &_boundingSphere ),
83 sizeof( BoundingSphere ) );
84 os.write( reinterpret_cast< char* >( &_range ),
sizeof( Range ) );
87 virtual void fromMemory(
char** addr, VertexBufferData& globalData )
89 memRead( reinterpret_cast< char* >( &_boundingSphere ), addr,
90 sizeof( BoundingSphere ) );
91 memRead( reinterpret_cast< char* >( &_range ), addr,
95 virtual void setupTree( VertexData& data,
const Index start,
96 const Index length,
const Axis axis,
98 VertexBufferData& globalData ) = 0;
100 virtual void updateRange() = 0;
102 BoundingSphere _boundingSphere;
110 #endif // MESH_VERTEXBUFFERBASE_H
co::Object to distribute a model, holds a VertexBufferBase node.