| 139 | } |
| 140 | |
| 141 | void GeomUtils::createQuad(VertexData*& vertexData) |
| 142 | { |
| 143 | assert(vertexData); |
| 144 | |
| 145 | vertexData->vertexCount = 4; |
| 146 | vertexData->vertexStart = 0; |
| 147 | |
| 148 | VertexDeclaration* vertexDecl = vertexData->vertexDeclaration; |
| 149 | VertexBufferBinding* bind = vertexData->vertexBufferBinding; |
| 150 | |
| 151 | vertexDecl->addElement(0, 0, VET_FLOAT3, VES_POSITION); |
| 152 | |
| 153 | HardwareVertexBufferSharedPtr vbuf = |
| 154 | HardwareBufferManager::getSingleton().createVertexBuffer( |
| 155 | vertexDecl->getVertexSize(0), |
| 156 | vertexData->vertexCount, |
| 157 | HardwareBuffer::HBU_STATIC_WRITE_ONLY); |
| 158 | |
| 159 | // Bind buffer |
| 160 | bind->setBinding(0, vbuf); |
| 161 | // Upload data |
| 162 | float data[]={ |
| 163 | -1,1,-1, // corner 1 |
| 164 | -1,-1,-1, // corner 2 |
| 165 | 1,1,-1, // corner 3 |
| 166 | 1,-1,-1}; // corner 4 |
| 167 | vbuf->writeData(0, sizeof(data), data, true); |
| 168 | } |
| 169 | |
| 170 | void GeomUtils::createCone(const Ogre::String& strName , float radius , float height, int nVerticesInBase) |
| 171 | { |
nothing calls this directly
no test coverage detected