![]() |
V-Gears 0
Free Final Fantasy VII engine.
|
A manually handled object. More...
#include <VGearsManualObject.h>
Public Types | |
enum | BufferBinding { BB_POSITION , BB_NORMAL , BB_COLOUR , BB_TEXTURE , BINDING_COUNT } |
Buffer indexes for object properties. More... | |
Public Member Functions | |
ManualObject (Ogre::Mesh *mesh) | |
Constructor. More... | |
virtual | ~ManualObject () |
Destructor. More... | |
virtual void | begin (const String &name, const String &material_name, size_t vertex_count, size_t index_count) |
Begins creating a object section. More... | |
virtual void | position (const Ogre::Vector3 &position) |
Sets the object position. More... | |
virtual void | normal (const Ogre::Vector3 &normal) |
Sets the object normal vector. More... | |
virtual void | colour (const Ogre::ColourValue &colour) |
Sets the object colour. More... | |
virtual void | textureCoord (const Ogre::Vector2 &texture_coordinate) |
Sets the object texture coordinates. More... | |
virtual void | index (const uint32 idx) |
Sets the object index. More... | |
virtual void | bone (const uint32 idx, const uint16 bone_handle, const Ogre::Real weight=1) |
Adds a bone to the object. More... | |
virtual void | end () |
End the current section. More... | |
Protected Member Functions | |
template<typename BufferType > | |
BufferType * | createBuffer (const BufferBinding binding, Ogre::VertexElementType type, Ogre::VertexElementSemantic semantic) |
Creates a buffer. More... | |
virtual void | createPositionBuffer () |
Creates a position buffer in {. More... | |
virtual void | createNormalBuffer () |
Creates a normal buffer in {. More... | |
virtual void | createColourBuffer () |
Creates a colour buffer in {. More... | |
virtual void | createTextureCoordinateBuffer () |
Creates a texture coordinate buffer in {. More... | |
virtual void | createIndexBuffer () |
Creates a index buffer in {. More... | |
virtual void | resetBuffers () |
Resets all buffers in {. More... | |
template<typename BufferSharedPtr > | |
void | resetBuffer (BufferSharedPtr &buffer) const |
Resets any of the buffers in {. More... | |
Private Types | |
typedef Ogre::HardwareVertexBufferSharedPtr | VertexBuffer |
typedef Ogre::HardwareIndexBufferSharedPtr | IndexBuffer |
Private Attributes | |
Ogre::Mesh * | _mesh |
The object mesh. More... | |
Ogre::SubMesh * | _section |
The currently open section. More... | |
Ogre::AxisAlignedBox | _bbox |
Ogre::Real | _radius |
VertexBuffer | _vertex_buffers [BINDING_COUNT] |
The object vetex buffer. More... | |
IndexBuffer | _indexbuffer_ |
The index buffer. More... | |
Ogre::Vector3 * | _position |
The position buffer. More... | |
Ogre::Vector3 * | _normal |
The normal buffer. More... | |
uint32 * | colour_ |
The colour buffer. More... | |
Ogre::Vector2 * | _texture_coordinate |
The texture buffer. More... | |
uint16 * | _index |
The object index. More... | |
const Ogre::VertexElementType | colour_type_ |
The colour type. More... | |
A manually handled object.
When parsing files this is used to create the rendering engine object. E.g. when a bone is found in the file being parsed, then bone() is called to add it.
|
private |
|
private |
|
explicit |
Constructor.
[in] | mesh | The object mesh |
|
virtual |
Destructor.
|
virtual |
Begins creating a object section.
It doesn't set position, normal or texture.
[in] | name | Name for the object. |
[in] | material_name | Name of the object's material. |
[in] | vertex_count | Number of vertices in the object. |
[in] | index_count |
|
virtual |
Sets the object colour.
[in] | colour | Object colour. |
|
protected |
Creates a buffer.
[in] | binding | Buffer binding. |
[in] | type | Type Buffer type. |
[in] | semantic | Buffer semantic. |
|
protectedvirtual |
Creates a colour buffer in {.
|
protectedvirtual |
Creates a index buffer in {.
|
protectedvirtual |
Creates a normal buffer in {.
|
protectedvirtual |
Creates a position buffer in {.
|
protectedvirtual |
Creates a texture coordinate buffer in {.
|
virtual |
End the current section.
A section must have been started with {
Ogre::Exception::ERR_INVALIDPARAMS | if a section has not been started. |
|
virtual |
Sets the object index.
[in] | idx | Object index. |
|
virtual |
Sets the object normal vector.
[in] | normal | Normal vector. |
|
virtual |
Sets the object position.
[in] | position | Position vector. |
|
protected |
|
protectedvirtual |
Resets all buffers in {.
|
virtual |
Sets the object texture coordinates.
[in] | texture_coordinate | Coordinate vector. |
|
private |
|
private |
The object index.
|
private |
The index buffer.
|
private |
The object mesh.
|
private |
The normal buffer.
|
private |
The position buffer.
|
private |
|
private |
The currently open section.
|
private |
The texture buffer.
|
private |
The object vetex buffer.
|
private |
The colour buffer.
|
private |
The colour type.