Search found 456 matches

by Flix
Thu Jul 01, 2010 10:43 am
Forum: General Bullet Physics Support and Feedback
Topic: Iterate over objects ina bounding box?
Replies: 15
Views: 20742

Re: Iterate over objects ina bounding box?

I wrote this code quite a while ago... As far as I remember the line: btWorld->getBroadphase()->getOverlappingPairCache()->setInternalGhostPairCallback(new btGhostPairCallback()); is needed once at initialization to enable ghost objects in the Bullet engine. But I don't know if things are changed in...
by Flix
Sun Jun 27, 2010 8:31 am
Forum: General Bullet Physics Support and Feedback
Topic: Augmenting btRigidBody: Composition or Subtyping?
Replies: 4
Views: 4085

Re: Augmenting btRigidBody: Composition or Subtyping?

But maybe I'm missing something here. No, you're right; I was thinking that with composition you could possibly pass the some pointer to different btRigidBodies, but this (if possible) is probably useless anyway. the inheritance way is convenient in a lot of cases Yes, but with composition you can ...
by Flix
Thu Jun 24, 2010 11:14 am
Forum: General Bullet Physics Support and Feedback
Topic: Augmenting btRigidBody: Composition or Subtyping?
Replies: 4
Views: 4085

Re: Augmenting btRigidBody: Composition or Subtyping?

Tried both ways, without any problem. (If you use a static method to perform upcasts in your class, you can just change the code inside it so that you can compare the two approaches easily.) Could it have negative impact on the overall performance of bullet, because the object gets bigger by the stu...
by Flix
Sun Jun 13, 2010 7:44 am
Forum: General Bullet Physics Support and Feedback
Topic: Just rotation by btTransform
Replies: 3
Views: 3591

Re: Just rotation by btTransform

btVector3 rotatedVect = transf*vect-transf.getOrigin(); (I don't like that there is transf twice.) I would write: btVector3 rotatedVect = transf.getBasis() * vect; so that I can just use the btMatrix3x3 reference that's already embedded inside the btTransform (without using its "origin" c...
by Flix
Sun Jun 13, 2010 7:23 am
Forum: General Bullet Physics Support and Feedback
Topic: Rotations of Objects
Replies: 7
Views: 10438

Re: Rotations of Objects

Thank you so much for your advice and help. I'm sorry for the late reply, but I haven't been able to work on this for the past week. I will give it a try and get back to you :) No problem :) . I've finally written this piece of code that seems to work (although it should be further tested to be sur...
by Flix
Sun Jun 13, 2010 7:12 am
Forum: Applications, Games, Demos or Movies using Bullet
Topic: Simple boat buoyancy demo
Replies: 10
Views: 72424

Re: Simple boat buoyancy demo

Thank you for your explanation :D !
by Flix
Thu Jun 10, 2010 10:07 am
Forum: General Bullet Physics Support and Feedback
Topic: Explosion
Replies: 9
Views: 10203

Re: Explosion

But what do you do if the radius of your explosion can be arbitrary? Why you're asking it ? If you want to use a contact test, but don't want to create a different collision shape each time, you can probaly use setLocalScaling() many times on the same sphere collision shape. P.S. As I wrote before,...
by Flix
Thu Jun 10, 2010 9:38 am
Forum: General Bullet Physics Support and Feedback
Topic: What does btRigidBody::setCenterOfMassTransform do?
Replies: 3
Views: 5427

Re: What does btRigidBody::setCenterOfMassTransform do?

these interpolated velocities etc, are they used in continuous collision detection? I'm wondering if the intention is to use this function with btContinuousDynamicsWorld (when it's finished ;) ) I honestly don' know it... Maybe interpolated velocities are just used to calculate interpolated transfo...
by Flix
Thu Jun 10, 2010 9:31 am
Forum: Applications, Games, Demos or Movies using Bullet
Topic: Simple boat buoyancy demo
Replies: 10
Views: 72424

Re: Simple boat buoyancy demo

Nice video and physic effect :) ! Buoyancy is modelled by attaching floats to the body which simply apply a force acording to their depth below the surface at discrete points. Could you please explain a little further the approach you used ? From what you've written I presume you attached some rigid...
by Flix
Tue Jun 08, 2010 2:00 pm
Forum: General Bullet Physics Support and Feedback
Topic: btCompoundShape with a non-dynamic child as a sensor
Replies: 2
Views: 3234

Re: btCompoundShape with a non-dynamic child as a sensor

The best method I can think of is to have a sphere added at the 'head' of the compound shape, which detects collisions and thus triggers a callback (e.g. gContactProcessedCallback), but then disable that child object's interaction with the dynamics engine. However, I can't find any way to do this. ...
by Flix
Sun Jun 06, 2010 6:53 am
Forum: General Bullet Physics Support and Feedback
Topic: What does btRigidBody::setCenterOfMassTransform do?
Replies: 3
Views: 5427

Re: What does btRigidBody::setCenterOfMassTransform do?

Good question. From the Bullet source code: void btCollisionObject::setWorldTransform(const btTransform& worldTrans) { m_worldTransform = worldTrans; } void btRigidBody::setCenterOfMassTransform(const btTransform& xform) { if (isStaticOrKinematicObject()) { m_interpolationWorldTransform = m_...
by Flix
Thu Jun 03, 2010 11:14 am
Forum: General Bullet Physics Support and Feedback
Topic: Rotations of Objects
Replies: 7
Views: 10438

Re: Rotations of Objects

Some additional thing and ideas you can try (I didn't): Basically you have an (old) transform for your body (let's call it T), and you must move it "inside" the space of your rotation transform (let's call it TR). Now you must calculate the new value of T. You can simply try: T(new) = TR *...
by Flix
Thu Jun 03, 2010 10:43 am
Forum: General Bullet Physics Support and Feedback
Topic: Rotations of Objects
Replies: 7
Views: 10438

Re: Rotations of Objects

How can I rotate the object around a different point? Well, this is a much more complicated question! (and I suppose that shifting the center of mass of your body through a compound shape isn't an option...). I believe It's possible to do it through multiplication of two other transforms, one place...
by Flix
Thu Jun 03, 2010 10:27 am
Forum: General Bullet Physics Support and Feedback
Topic: Explosion
Replies: 9
Views: 10203

Re: Explosion

But what exactly do those aabbTest/contactTest queries mean? Is there an interface for them or do you implement them yourself? Please read this post for further info (I didn't try it myself at the moment): http://bulletphysics.org/Bullet/phpBB3/viewtopic.php?f=9&t=5147&p=18791&hilit=con...
by Flix
Tue Jun 01, 2010 1:44 pm
Forum: General Bullet Physics Support and Feedback
Topic: Rotations of Objects
Replies: 7
Views: 10438

Re: Rotations of Objects

[...] how to make rotations in bullet [...] The btQuaternion class has has a ctr that takes a btVector3 (the axis of rotation) and a btScalar (the amount of rotation). Now I don't remember exactly the order in which these two arguments appear in the ctr, but if you want for example your body to be ...