[solved] Why btHeightfieldTerrainShape is so slow?

Post Reply
andrey5000
Posts: 2
Joined: Mon Oct 05, 2015 11:15 am

[solved] Why btHeightfieldTerrainShape is so slow?

Post by andrey5000 »

I have terrain 257x8193 and one sphere. And it cause very low performance level on android device.
With 50-100 balls i get low perfomance on pc also. But if replace terrain with just a plane - everything is nice.

What can i do? It's unexpectedly that terrain in bullet is so slow.
Last edited by andrey5000 on Wed Oct 07, 2015 10:03 pm, edited 1 time in total.
LHLaurini
Posts: 9
Joined: Tue Sep 08, 2015 6:40 pm

Re: Why btHeightfieldTerrainShape is so slow?

Post by LHLaurini »

I'm assuming you are trying to use btHeightfieldTerrainShape as a shape for the "scenario".
Are you sure you created the btRigidBody as a static object (mass=0)? If you are, could you try to change btHeightfieldTerrainShape to btBvhTriangleMeshShape?
xexuxjy
Posts: 225
Joined: Wed Jan 07, 2009 11:43 am
Location: London

Re: Why btHeightfieldTerrainShape is so slow?

Post by xexuxjy »

Also how big is the ball in relation to the terrain, and how quickly does it move? TerrainMeshShape basically works by testing each triangle within the projected rectangle of the balls movement on the terrain.
This post might be of help : http://www.bulletphysics.org/Bullet/php ... f=9&t=8755
andrey5000
Posts: 2
Joined: Mon Oct 05, 2015 11:15 am

Re: Why btHeightfieldTerrainShape is so slow?

Post by andrey5000 »

LHLaurini wrote:I'm assuming you are trying to use btHeightfieldTerrainShape as a shape for the "scenario".
Are you sure you created the btRigidBody as a static object (mass=0)? If you are, could you try to change btHeightfieldTerrainShape to btBvhTriangleMeshShape?
Bhv mesh solve my problem. Thank you!
LHLaurini
Posts: 9
Joined: Tue Sep 08, 2015 6:40 pm

Re: Why btHeightfieldTerrainShape is so slow?

Post by LHLaurini »

andrey5000 wrote:
LHLaurini wrote:I'm assuming you are trying to use btHeightfieldTerrainShape as a shape for the "scenario".
Are you sure you created the btRigidBody as a static object (mass=0)? If you are, could you try to change btHeightfieldTerrainShape to btBvhTriangleMeshShape?
Bhv mesh solve my problem. Thank you!
You're welcome. I'm glad to hear you've got it to work.
Post Reply