Creating Bullet ridgid Body from Octree in Real-Time

Physics APIs, Physics file formats, Maya, Max, XSI, Cinema 4D, Lightwave, Blender, thinkingParticles™ and other simulation tools, exporters and importers
Post Reply
chasester
Posts: 1
Joined: Tue May 30, 2017 8:52 am

Creating Bullet ridgid Body from Octree in Real-Time

Post by chasester » Tue May 30, 2017 9:14 am

So this may get a little complex but ill try to keep it fairly simplified. (this is C++)
Currently I have
struct cube - basic node of the octree
struct vtxarray - render information of the above cube which is updated on every change of the octree (only in spots needed)

I have a vector of vtxarrays which I used to derive the information for

Code: Select all

        m_indexVertexArrays = new btTriangleIndexVertexArray(TriCount,
		Indices,
		indexStride,
		VertexCount,(btScalar*) &Vertices[0].x(),vertStride);
        trimeshShape  = new btBvhTriangleMeshShape(m_indexVertexArrays,useQuantizedAabbCompression,aabbMin,aabbMax);
	btCollisionShape* groundShape = trimeshShape;
Is there a way to link into the mesh directly, so I can manipulate it more fluidly.

Would making every cube (non-empty) in the octree its own mesh be better for realtime manipulation, or is there a better way to build a shape in bullet where I have more control over the verticies. Or are there call backs that I can use to handle collision differently?

It works right now but its kinda slow on larger sizes (say 100k verts it takes about 1 sec to calculate).

I can post the code more fluidly if you have any question

thanx
chasester

Post Reply