E.g., this is the vertex declaration ...
Code: Select all
Ogre::VertexElement2Vec vertexElements;
vertexElements.push_back(Ogre::VertexElement2(Ogre::VET_FLOAT3, Ogre::VES_POSITION));
vertexElements.push_back(Ogre::VertexElement2(Ogre::VET_FLOAT3, Ogre::VES_NORMAL));
Code: Select all
CubeVertices *cubeVertices = reinterpret_cast<CubeVertices*>(OGRE_MALLOC_SIMD(sizeof(CubeVertices) * 8, Ogre::MEMCATEGORY_GEOMETRY));
Code: Select all
memcpy(cubeVertices, c_originalVertices, sizeof(CubeVertices) * 8);
I have a vertex struct similar to the following.
Code: Select all
struct CubeVertices
{
float px, py, pz; //Position
float nx, ny, nz; //Normals
std::vector<float> coords;
std::vector<float> normals;
CubeVertices() {}
CubeVertices( float _px, float _py, float _pz,
float _nx, float _ny, float _nz ) :
px( _px ), py( _py ), pz( _pz ),
nx( _nx ), ny( _ny ), nz( _nz )
{
}
};