Search found 74 matches

by c0der
Sat Jan 19, 2013 11:33 am
Forum: Research and development discussion about Collision Detection and Physics Simulation
Topic: Clipping and contacts using SAT
Replies: 7
Views: 11049

Re: Clipping and contacts using SAT

Problem solved. The problem was with the contact manifold and this was masked in the small timestep I was using. After drawing the manifold and outputting some data, the simulation is near perfect. I can now use 100 iterations on 6 bodies without slowing my frame rate due to the handling of the fixe...
by c0der
Fri Jan 18, 2013 8:15 am
Forum: Research and development discussion about Collision Detection and Physics Simulation
Topic: Clipping and contacts using SAT
Replies: 7
Views: 11049

Re: Clipping and contacts using SAT

Thanks Dirk. I didn't use constraints to derive the impulses, but I think I will give that a go now since regular impulses don't seem to be adequate in my varied timestep. I derive the impulse as follows based on the coefficient of restitution equation: e = vba' / vab Rel vel in the direction of the...
by c0der
Fri Jan 18, 2013 2:12 am
Forum: Research and development discussion about Collision Detection and Physics Simulation
Topic: Clipping and contacts using SAT
Replies: 7
Views: 11049

Re: Clipping and contacts using SAT

Thanks Dirk. I have gone through the Box2D code and I couldn't find where the variable timestep was used, only for profiling. In the manual, it says that it uses a fixed timestep of 60Hz. Box2D lite is also too fast on my PC and this is not realistic when I load a terrain, perform collisions, which ...
by c0der
Tue Jan 15, 2013 2:38 am
Forum: Research and development discussion about Collision Detection and Physics Simulation
Topic: Clipping and contacts using SAT
Replies: 7
Views: 11049

Clipping and contacts using SAT

Hi, I am trying to support a variable timestep as follows since I am having problems when loading terrains, which slow the frame rate and fixing this to 60Hz is no longer adequate. I fix the timestep to less than 0.005f and the simulation is stable when stacking boxes. When I raise this further, the...
by c0der
Sun Jan 13, 2013 3:25 am
Forum: Research and development discussion about Collision Detection and Physics Simulation
Topic: Collision with a quad terrain
Replies: 6
Views: 11142

Collision with a quad terrain

Hi, I have a terrain partitioned into a quadtree and the rendering is fast, but collision detection for physics is slow. I am trying to test an OBB against the terrain as follows: Basically, if the node is in the viewing frustum, and we are at the leaf node, I check if the OBB is above that visible ...
by c0der
Thu Jan 10, 2013 1:26 pm
Forum: Research and development discussion about Collision Detection and Physics Simulation
Topic: Line constraint
Replies: 3
Views: 6546

Re: Line constraint

Thanks Dirk. I have the original line constraint working without limits, however I have a question about the behaviour. Say that body 2 is at the anchor point and body 1 is the fixed body that the line moves with. Is the anchor point supposed to move with body 2 and that r2 stays fixed while r1 chan...
by c0der
Sat Jan 05, 2013 11:50 pm
Forum: Research and development discussion about Collision Detection and Physics Simulation
Topic: Line constraint
Replies: 3
Views: 6546

Line constraint

Hi all,

What is the best way to impose a limit on a line constraint? Currently, I have a distance constraint running alongside it but don't know if that's the best way. Should I add another Jacobian and combine it with the line joint?

Thanks for your help
by c0der
Fri Jan 04, 2013 11:11 pm
Forum: Research and development discussion about Collision Detection and Physics Simulation
Topic: Hinge constraint
Replies: 11
Views: 18842

Re: Hinge constraint

Thanks a lot Dirk. I transformed my tangent axes with the frame they vary with and it still works both ways, regardless of our Jacobians being different, it was a good mistake on my part to learn from.

Thanks for the tips on quaternion constraints, you are most helpful.
by c0der
Fri Jan 04, 2013 10:50 am
Forum: Research and development discussion about Collision Detection and Physics Simulation
Topic: Multiplication by time step in Sequential Impulses
Replies: 4
Views: 9935

Re: Multiplication by time step in Sequential Impulses

The way I understood it is, since the impulse is applied almost instantly, there is no need to integrate the force over time and assume it occurs instantaneously, therefore making P=JT*lambda rather than JT*lambda*h. Is this a correct assumption or should I multiply by the timestep regardless? I hav...
by c0der
Fri Jan 04, 2013 10:44 am
Forum: Research and development discussion about Collision Detection and Physics Simulation
Topic: Hinge constraint
Replies: 11
Views: 18842

Re: Hinge constraint

Thanks Dirk! That makes alot more sense The way I am following your process is as follows: dC1/dt = u2.w1 dC1/dt = u2.d/dt(w1) + d(u2)/dt.w1 (Product rule) dC1/dt = u2.Cross(omegaB, w1) + Cross(omegaA, u2).w1 (Since w1 varies with frame B and u2 changes wrt to frame A) dC1/dt = omegaB.Cross(w1, u2) ...
by c0der
Sat Dec 29, 2012 8:51 am
Forum: Research and development discussion about Collision Detection and Physics Simulation
Topic: Hinge constraint
Replies: 11
Views: 18842

Re: Hinge constraint

Talking to myself here again ... I have managed to implement the hinge joint properly and test it with success. Also, chain of 3 bodies connected with revolute joints works well. I am now trying to test the following and am having erratic velocities: Body1 is anchored to an immovable body3 using a r...
by c0der
Thu Dec 27, 2012 9:07 am
Forum: Research and development discussion about Collision Detection and Physics Simulation
Topic: Hinge constraint
Replies: 11
Views: 18842

Re: Hinge constraint

I have built a hinge constraint with a 5x5 K matrix. My problem is when the bodies rotate about a constrained axis, the solver blows up. If I initialise the constraint to allow rotation about the Z axis of body1, it works fine provided that the bodies do not have a velocity about the other two axes....
by c0der
Wed Dec 26, 2012 11:00 am
Forum: Research and development discussion about Collision Detection and Physics Simulation
Topic: Inverting a matrix of any size
Replies: 1
Views: 4940

Inverting a matrix of any size

Hi, I have managed to implement a Gauss-Jordan elimination function and tested it in inverting a 6x6 matrix successfully. It's a lot faster than cofactors (which I wasted time on) and hopefully it'll help anyone who needs it and save you a lot of pain when dealing with 5 and 6 D.O.F constraint block...
by c0der
Fri Dec 21, 2012 12:52 am
Forum: Research and development discussion about Collision Detection and Physics Simulation
Topic: Hinge constraint
Replies: 11
Views: 18842

Hinge constraint

Hi, I am having trouble implementing this restricted angle inequality constraint about an arbitrary axis. I am imposing a revolute joint constraint separately to this, to form a hinge constraint The procedure I am following is shown in the code below: 1) Convert the restricted axis to local coords 2...
by c0der
Thu Dec 20, 2012 9:52 am
Forum: Research and development discussion about Collision Detection and Physics Simulation
Topic: Inverse of a block K matrix
Replies: 2
Views: 7112

Re: Inverse of a block K matrix

That's cool, I did it in Matlab and it's a 32MB file, so it's much simpler to just apply two constraints to a point separately.