Search found 849 matches

by drleviathan
Tue May 30, 2017 11:16 pm
Forum: General Bullet Physics Support and Feedback
Topic: btBvhTriangleMeshShape and streamed 3D models
Replies: 4
Views: 13399

Re: btBvhTriangleMeshShape and streamed 3D models

I think the serialization format is relatively stable: it does NOT change on every new version of Bullet.
by drleviathan
Tue May 30, 2017 11:14 pm
Forum: General Bullet Physics Support and Feedback
Topic: btBvhTriangleMeshShape + instances
Replies: 2
Views: 8979

Re: btBvhTriangleMeshShape + instances

Yes, you can share one shape instance across many RigidBodies. Getting it done is simple enough: just pass the shape pointer to each RigidBody as normal, however the tricky bit comes down to keeping track of how many bodies are using each shape and when to delete the shape, if ever. Depending on wha...
by drleviathan
Thu Apr 27, 2017 5:02 pm
Forum: General Bullet Physics Support and Feedback
Topic: First Person Shoot Game !! Basic Physics
Replies: 8
Views: 6916

Re: First Person Shoot Game !! Basic Physics

i7.strelok, I'm happy to try to help but I don't think I will be effective at debugging your code remotely via the Bullet forums. If you have a particular question or problem please describe it clearly here. If I think I know the answer then I will reply.
by drleviathan
Wed Apr 26, 2017 3:48 pm
Forum: General Bullet Physics Support and Feedback
Topic: First Person Shoot Game !! Basic Physics
Replies: 8
Views: 6916

Re: First Person Shoot Game !! Basic Physics

btVector3 dirCam(_camera->getRealDirection().x, _camera->getRealDirection().y, _camera->getRealDirection().z); btVector3 shootDirection = dirCam * localZ; No that is not right. You're multiplying two vectors together. I think that operation multiplies each component of vectorA with the correspondin...
by drleviathan
Wed Apr 26, 2017 6:53 am
Forum: General Bullet Physics Support and Feedback
Topic: First Person Shoot Game !! Basic Physics
Replies: 8
Views: 6916

Re: First Person Shoot Game !! Basic Physics

I don't know Ogre so it isn't clear to me if you are computing the correct oriWeapon. Try using the _camera->getRealOrientation() to compute the bulletDirection to see if that works.
by drleviathan
Tue Apr 25, 2017 11:32 pm
Forum: General Bullet Physics Support and Feedback
Topic: First Person Shoot Game !! Basic Physics
Replies: 8
Views: 6916

Re: First Person Shoot Game !! Basic Physics

Most of your code looks okay to me. If the bullet only shoots along Z-axis then my guess is: oriWeapon is not getting the values you expect. Print out the values of oriWeapon to verify that its values change with the mouse. By the way, I notice that you set the value of oriWeapon twice before you us...
by drleviathan
Tue Apr 25, 2017 5:09 pm
Forum: General Bullet Physics Support and Feedback
Topic: How to simule shoots from a weapon with Bullet+Ogre
Replies: 5
Views: 5400

Re: How to simule shoots from a weapon with Bullet+Ogre

Your weapon has local XYZ axes. I will assume it shoots along the local-Z axis. In order to shoot in the correct direction in the world-frame you need to figure out the direction your weapon's Z-axis points when transformed into the world-frame. Get the transform of your weapon in the world-frame an...
by drleviathan
Tue Apr 25, 2017 3:39 pm
Forum: General Bullet Physics Support and Feedback
Topic: Kinematic body motion -- how to make "smooth"?
Replies: 13
Views: 12984

Re: Kinematic body motion -- how to make "smooth"?

Bullet comes with a library called VHACD which has utilities for computing the convex decomposition. That is, it comes with the Bullet install but it is its own separate library and you need to link it in separately. Running VHACD is not something you would want to do real-time. Depending on the par...
by drleviathan
Tue Apr 25, 2017 3:25 pm
Forum: General Bullet Physics Support and Feedback
Topic: How to simule shoots from a weapon with Bullet+Ogre
Replies: 5
Views: 5400

Re: How to simule shoots from a weapon with Bullet+Ogre

By default a btRigidBody is initialized to be static . In other words: the btCollisionObject::m_collisionFlags data member is initialized to btCollisionObject::CF_STATIC_OBJECT . In order to create a dynamic object you need remove the static flag before you add it to the btDynamicsWorld : _fallingBo...
by drleviathan
Tue Apr 25, 2017 3:12 pm
Forum: General Bullet Physics Support and Feedback
Topic: Kinematic body motion -- how to make "smooth"?
Replies: 13
Views: 12984

Re: Kinematic body motion -- how to make "smooth"?

Bullet does not support btBvhTriangleMeshShape having velocity during collisions, which means you should only use it for static objects. The system does not prevent you from trying to use it for kinematic, but you'll tend to get more penetrations, tunneling and other glitches. Also, the btBvhTriangl...
by drleviathan
Tue Apr 25, 2017 12:07 am
Forum: General Bullet Physics Support and Feedback
Topic: Calculate volume for convex shapes?
Replies: 2
Views: 4297

Re: Calculate volume for convex shapes?

I don't think there is a Bullet utility for that. The good news is that you probably don't need high accuracy to get results that are "good enough" for the human eye. Unless you're working on a high-accuracy application then use an approximate method.
by drleviathan
Mon Apr 24, 2017 11:34 pm
Forum: General Bullet Physics Support and Feedback
Topic: Kinematic body motion -- how to make "smooth"?
Replies: 13
Views: 12984

Re: Kinematic body motion -- how to make "smooth"?

The popping you're seeing is probably the penetration resolution code kicking in every so many frames. The first thing I wold wonder is: what is the collision margin of your kinematic object? You say it uses a "triangle mesh"? Which mesh shape exactly? btGImpactShape , btBvhTriangleMeshSha...
by drleviathan
Wed Apr 12, 2017 4:46 pm
Forum: General Bullet Physics Support and Feedback
Topic: Bullet wiki is broken?
Replies: 3
Views: 5427

Bullet wiki is broken?

I was going to reference the Bullet wiki in a forum post and noticed that the wiki pages appear to be unable to format the "source" exerpts. Specifically this page: http://www.bulletphysics.org/mediawiki-1.5.8/index.php/Collision_Filtering For me the source snippets all show up like this: ...
by drleviathan
Wed Apr 12, 2017 4:16 pm
Forum: General Bullet Physics Support and Feedback
Topic: Struggling to get colliding body's pointer/index
Replies: 2
Views: 3843

Re: Struggling to get colliding body's pointer/index

It looks to me like you're getting the pointers to the objects just fine: const btCollisionObject *objA = contactManifold->getBody0(); const btCollisionObject *objB = contactManifold->getBody1(); Interestingly, I've never seen the btCollisionObject::getUserIndex() method. I don't find it mentioned i...
by drleviathan
Fri Mar 10, 2017 12:10 am
Forum: General Bullet Physics Support and Feedback
Topic: Creating a rigidBody at a point in camera space?
Replies: 2
Views: 2878

Re: Creating a rigidBody at a point in camera space?

You can slam the RigidBody transform directly, however if the body is dynamic and inactive when you do this then you should activate it:

Code: Select all

body->setWorldTransform(transform);
if (!body->isStaticOrKinematicObject() && !body->isActive()) {
    body->activate();
}