I’ve seen problems with the triangle mesh collision shape. I don’t think it’s an issue with osgBullet.
I know Bullet works well when all collision shapes are convex. I’m not exactly sure why Bullet provides a (potentially non-convex) triangle mesh Shape class that doesn’t behave as other collision shapes. I investigated this issue in the past, convinced myself it was a Bullet issue and not an osgBullet issue, asked about it on the Bullet forum, was told “use convex shapes instead”, and never pursued it further.
If I remember correctly, non-convex triangle meshes have some application as a type of ground plane. I think Doug use a triangle mesh for a ground plane at ISU. Doug, do you have any information on this, or are you getting too rusty on it also? It’s been years since I’ve looked at this.
-Paul
--
You received this message because you are subscribed to the Google Groups "osgbullet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osgbullet-use...@googlegroups.com.
To post to this group, send email to osgbull...@googlegroups.com.
Visit this group at https://groups.google.com/group/osgbullet-users.
For more options, visit https://groups.google.com/d/optout.
hai
Bullet has a bounding box for each shape. When they don’t intersect, frame rate should be really good because Bullet does almost no work.
Once the bounding boxes intersect, Bullet has to do a lot more work, adding and removing collition points and computing constraints on active collision points. The computation time goes up linearly with the complexity of the collision shapes.
You might try one of the parallel solvers, but I must admit I’m not an expert in optimizing Bullet collision detection. In the past, I have always contacted Bullet exsperts for advice on this, using the Bullet discussion forum.
Also, it has been a long time sinceI did anything with Bullet. Last time I checked, they were developing a Cuda solver that performed collision detection directly on the GPU in parallel. I’m not sure what the status of this work is, or if it would help in your case. But you might want to look into this.
-Paul
From: osgbull...@googlegroups.com [mailto:osgbull...@googlegroups.com] On Behalf Of Jayasimha
Sent: Monday, December 26, 2016 10:20 PM
To: osgbullet-users
Subject: [osgbullet-users] Re: bullet Collision Shape
hai
Now i am using for Static Object "TriMeshCollisionShape" and Dynamic Object "ConvexHullCollisionShape". the collision Detection Absolutely accurate but after touching and intersecting frame rate reducing too much about 3 to 5 FPM from 50FPM.
Can you tell me what is the reason for this? is it because of any Computation ?
--
It sounds like one of your collision shapes has been created with the incorrect transformation. You can verify this by using the debug drawer class, which will render your collision shapes as wireframe. If the collision transform is correct, the sollision shape will align with the visual representation. If the transform is wrong, then your visual representation will be rendered in one part of your scene, and your corresponding collision shape in another part. That will be an indication to you to examine the code for creating the collision shape and its transformation. See the osgBullet example code for how to use this class. Also see the osgBullet example code for how to create collision shapes with correct transformations. The order of function calls is critical.
While osgBullet will automatically create collision shapes from OSG Geometry node data, the collision shapes might not be optimal. It is always better to manually model the collision shapes, just as you manually create the visual model itself.
Bullet is most efficient when using analytic shapes (implicitly defined with an equation and parameters, such as a plane, box, cylinder, sphere, cone, etc.). However, there is no artificial intelligence in osgBullet to analyze random OSG Geometry node data and determine an analytic shape with parameters for best fit. For this reason, you would have to create the collision shapes manually.
You could approximate an aircraft using a cylinder shape for the fuselage, cones for the nose and tail, boxes for the wings, and cylinders for the tires, then assemble these shapes together using a btCompoundShape. You probably do not need individual collision shapes for ailerons, flaps, rudder, etc., and in fact, adding collision shapes for these objects will dramatically slow physics computation because they will almost certainly be in contact with other collision shapes all the time, causing Bullet to constantly spend cycles resolving the constraints.
Disclaimer. I am not a Bullet expert. I strongly encourage you to raise these topics on the Bullet discussion forum, where you will almost certainly receive higher quality and more up-to-date information.
osgBullet does nothing to add or remove contact points. They are all managed by Bullet.
I believe Bullet has an interface to query contact points from an object or collision shape. If you use that interface, you should have access to all the contact points that Bullet is tracking. If you believe this isn’t the case, it is an issue that is best discussed in the Bullet forum.
-Paul
--