Search found 486 matches

by drleviathan
Fri Feb 15, 2019 5:20 pm
Forum: General Bullet Physics Support and Feedback
Topic: rotate a crate around me when i Turn
Replies: 4
Views: 189

Re: rotate a crate around me when i Turn

Sorry that code doesn't work. I haven't had time to actually setup a bt6dofConstraint to test, debug, and fix. Yes, characterToWorld would be worldToCharacter.inverse() . Order matters for transforms because they don't commute, so what is the right order? A useful trick I use is to imagine the trans...
by drleviathan
Sun Feb 10, 2019 7:16 pm
Forum: General Bullet Physics Support and Feedback
Topic: rotate a crate around me when i Turn
Replies: 4
Views: 189

Re: rotate a crate around me when i Turn

The btGeneric6DofConstraint class has two CTORs: btGeneric6DofConstraint(btRigidBody& rbA, btRigidBody& rbB, const btTransform& frameInA, const btTransform& frameInB ,bool useLinearReferenceFrameA); btGeneric6DofConstraint(btRigidBody& rbB, const btTransform& frameInB, bool useLinearReferenceFrameB)...
by drleviathan
Wed Feb 06, 2019 4:18 pm
Forum: General Bullet Physics Support and Feedback
Topic: performance of collisions of 'voxel' shapes
Replies: 6
Views: 410

Re: performance of collisions of 'voxel' shapes

BTW, are you sharing one btBoxShape instance for all of the subshapes? Or are you creating a new instance for each?

I've never not shared and am curious to know how noticeable would be the performance difference between the two cases.
by drleviathan
Sun Feb 03, 2019 2:37 am
Forum: General Bullet Physics Support and Feedback
Topic: Combining collision flag
Replies: 2
Views: 211

Re: Combining collision flag

Combining those two flags should work fine, however if you're changing the MotionType from STATIC to KINEMATIC then you need to first remove the body from the World and re-add it. You can't change between those two MotionTypes on the fly because the bodies live on distinct internal lists inside the ...
by drleviathan
Sun Feb 03, 2019 2:30 am
Forum: General Bullet Physics Support and Feedback
Topic: performance of collisions of 'voxel' shapes
Replies: 6
Views: 410

Re: performance of collisions of 'voxel' shapes

I've noticed the same performance problem: a medium number of btCompoundShapes, each with a medium number of subshapes all colliding together can slow down the stepSimulation() call. As I recall my example was only about 20 objects, each with about 18 subshapes. It didn't slow down to 2Hz, but the s...
by drleviathan
Sat Feb 02, 2019 3:51 pm
Forum: General Bullet Physics Support and Feedback
Topic: Getting the direction an object would move
Replies: 1
Views: 164

Re: Getting the direction an object would move

Here is method might work for you. It does have a theoretical side-effect on the "pushing" objects : they will lose momentum as if they really did move the "non-movable" objects. Also, it would require your non-movable objects to be "active" in the simulation, which will "activate" other objects tha...
by drleviathan
Fri Feb 01, 2019 4:47 pm
Forum: General Bullet Physics Support and Feedback
Topic: activate object after size changes...
Replies: 5
Views: 350

Re: activate object after size changes...

Here is the relevant code from btCollisionWorld.cpp: void btCollisionObject::setActivationState(int newState) const { if ( (m_activationState1 != DISABLE_DEACTIVATION) && (m_activationState1 != DISABLE_SIMULATION)) m_activationState1 = newState; } void btCollisionObject::forceActivationState(int new...
by drleviathan
Tue Jan 29, 2019 10:01 pm
Forum: General Bullet Physics Support and Feedback
Topic: Rolling ball
Replies: 3
Views: 194

Re: Rolling ball

What do you really want to do? Do you want the ball to literally track a circular path around a known center? or do you want to be able to turn the ball around a corner and just assume it would follow something like a circular arc when doing so? Assuming you just want to steer the ball around I woul...
by drleviathan
Tue Jan 29, 2019 5:55 pm
Forum: General Bullet Physics Support and Feedback
Topic: Rolling ball
Replies: 3
Views: 194

Re: Rolling ball

Assuming the body is dynamic you need to:
(1) Make sure the body is active.
(2) Apply a force or torque on the ball.
by drleviathan
Tue Jan 29, 2019 5:34 pm
Forum: General Bullet Physics Support and Feedback
Topic: Extra/ConvexDecomposition No way to construct a ConvexDecompInterface
Replies: 1
Views: 83

Re: Extra/ConvexDecomposition No way to construct a ConvexDecompInterface

ConvexDecompInterface is pure virtual. It defines an interface, hence the Interface part of its name. Pure virtual classes cannot be instantiated. You need to derive your own custom class (say MyConvexDecomp) from it, implement the MyConvexDecomp::ConvexDecompResult() method to do what you want, an...
by drleviathan
Mon Jan 28, 2019 10:04 pm
Forum: General Bullet Physics Support and Feedback
Topic: Accurate simulation of complex mechanical system
Replies: 1
Views: 148

Re: Accurate simulation of complex mechanical system

(1) Yes it is possible. (2) I don't know the boundaries for all of your variables. You're just going to have to explore. Start conservatively then push the envelope. (3) The default collision margin is 0.04 "distance units". If you're using meters then that would correspond to 4cm. The margin reall...
by drleviathan
Thu Jan 17, 2019 4:35 pm
Forum: General Bullet Physics Support and Feedback
Topic: Vehicle Raycasting gets high rotation and movement when colliding
Replies: 4
Views: 225

Re: Vehicle Raycasting gets high rotation and movement when colliding

If all your substepa are about 0.017 then your simulation rate is 1.0/0.017 ~= 59 Hz which should be sufficient for stability in most cases. Your vehicle looks too light. I assume 100 means 100kg. First thing to try: increase the mass of your vehicle. This will also increase its inertia tensor and w...
by drleviathan
Wed Jan 16, 2019 3:33 pm
Forum: General Bullet Physics Support and Feedback
Topic: btbvhtrianglemeshshape on separated objects
Replies: 2
Views: 156

Re: btbvhtrianglemeshshape on separated objects

When you add lots of Objects to the World, the cost of adding/removing each successive Object goes up. I hear this doesn't really become noticeable until you have a few tens of thousands of Objects, however on various hardware mileage will vary. If you aren't constantly adding/removing Objects to th...
by drleviathan
Wed Jan 16, 2019 3:19 pm
Forum: General Bullet Physics Support and Feedback
Topic: Vehicle Raycasting gets high rotation and movement when colliding
Replies: 4
Views: 225

Re: Vehicle Raycasting gets high rotation and movement when colliding

It sounds like the vehicle action is going semi-unstable. What is the duration of your substep? If it is too big perhaps decreasing it would increase stability. A problem that I've encountered in the past is a bad inertia tensor. If the inertia tensor is too small for the torques being applied to th...
by drleviathan
Wed Jan 16, 2019 3:06 pm
Forum: General Bullet Physics Support and Feedback
Topic: compound collisoin shape position inside btRigidBody
Replies: 2
Views: 167

Re: compound collisoin shape position inside btRigidBody

I see a copy-n-paste error in the second part at this line:

Code: Select all

p1->addChildShape(tLocal, box2);
I think you meant to do:

Code: Select all

p2->addChildShape(tLocal, box2);