Erwin Coumans wrote:
edl wrote:
Great work, can i ask a stupid question? when I build a plane(as the land), and then divided it into several regions (mesh), according to the sample, an update mesh needs to be done(calculateAabbBruteForce & refitTree), but how to determine which mesh need to be updated?(when i update all the mesh,the cpu consume is quite a lot!) Is there any easy function can be used? when the scene is big, to determine the need for update of the mesh would be a trouble thing... ...
Can you make the question more clear?
1) Bullet has no 'mesh', what do you mean by that? Did you mean a btBvhTriangleMeshShape?
2) why do you need to update the btBvhTriangleMeshShape at run-time? Do you want to deform some triangles at run-time?
3) What do you mean by 'update of the mesh' exactly? refitTree? Or do you want a faster / incremental version of btGenerateInternalEdgeInfo, only for the triangles that changed?
Thanks,
Erwin
sorry for my poor words. i build the plane made of btBvhTriangleMeshShape, and make concave shape move on the btBvhTriangleMeshShape,i see the sample "ConcavePhysicsDemo.cpp" ,
it run
Code:
trimeshShape->getMeshInterface()->calculateAabbBruteForce(aabbMin,aabbMax);
trimeshShape->refitTree(aabbMin,aabbMax);
in the clientMoveAndDisplay(); function. it is in the displayCallback .i don't wan't to deform some triangles in run-time
my 'update of the mesh' means ,update the refitTree, i see the refitTree function has been call every frame,so i call it.
i am sorry, i just see that ,it only needed when it is a m_animatedMesh.....