forked from mirror/openmw-tes3mp
BulletNifLoader: preallocate the btTriangleMesh's vertices/indices
This commit is contained in:
parent
293f3f30b5
commit
eb92b853fe
1 changed files with 3 additions and 0 deletions
|
@ -319,6 +319,9 @@ void BulletNifLoader::handleNiTriShape(const Nif::NiTriShape *shape, int flags,
|
|||
const osg::Vec3Array& vertices = *data->vertices;
|
||||
const osg::DrawElementsUShort& triangles = *data->triangles;
|
||||
|
||||
mStaticMesh->preallocateVertices(data->vertices->size());
|
||||
mStaticMesh->preallocateIndices(data->triangles->size());
|
||||
|
||||
size_t numtris = data->triangles->size();
|
||||
for(size_t i = 0;i < numtris;i+=3)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue