#### Archived

This topic is now archived and is closed to further replies.

# Ragdoll Physics and Collision Response

This topic is 5308 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Thanks...just checking. Actually, i like your notation better as it makes more sense. I was sticking to the notation used in Jakobsen''s paper as it made me feel safer :D

Matt

##### Share on other sites
(Mind you I'm extremely tired, so bear with me. )

I was just thinking of how to (complicate matters and..) use triangles that potentially exist within the particle system (they are formed by groups of (3) particles and their constraints (A-B,A-C,B-C)) to "make the body more solid" (lol..I'm tired..remember). Let's say I have a couple of "triangles" that just so happen to exist within the particle - particle-constraint aspect, and I want to make it so that not only do the particles "never penetrate" any surface, but these "triangles" also never penetrate any surface. I was thinking I could test if any edges of the "triangle" intersect any of the surface triangles, and somehow reverse this whole setup...or is any of that even necessary?

[edited by - mattbbangin on March 8, 2004 6:31:25 AM]

##### Share on other sites
ok, so you want to do constraint / obstacle collision and response? that''s feasable, and I actually thought of updating my little demo with that feature.

but for a start, I''ll be modifying the code so that I do first particle / constraint collision (for car / car collisions). Constraint / constraint is not required. Then I''ll do Constraint / obstacle as a last addition.

remember that for the constraint you use as a collision obstacle, use the CurrPos of the particles cosntraint as the collision segements, else you''ll have collision errors.

I''ll probably remove the cars from the simulation, and replace them with triangle bodies, for simplicity and debugging. cars have way too many particles and constraints.

##### Share on other sites
hmmm on second thoughts, I've got the feeling that won't work, since the CurrPos of the particle is moved while doing teh collision test. I will try with the first version of the demo, the one that does no collision response. that would work a lot better.

EDIT : to make the swept test work, you'll need to sort all collisions in the game in a list, process the earliest one, remove collision packets involving the two object in collision from the earliest collision, and test objects colliding with these two objects again... quite complicated for what it's worth.

[edited by - oliii on March 8, 2004 7:50:51 AM]

##### Share on other sites
Ok, this is going to sound really stupid, but bear with me please

Are the particles supposed to bounce when using the basic Jakobsen mthod outlined earlier in this topic?

The reason i ask is that up till now i have only used a maximum of 2 particles constrained by a ridged stick. These appeared not to bounce when they hit the constraint limit. Now, however, I am now using a number of particles in a row, each constrained to the next by a rigid stick. This is then given a sideways force , which allows a large velocity to build up. When they hit the constraint they visably bounce sideways, repeating until they come to rest!

Now it looks great, but i cant for the life of me work out (it late ) whether they are doing this as they are meant to, or i have a bug in my code somewhere.

If you have implemented this sytem, please can you let me know whther this is the correct behaviour!

Matt

##### Share on other sites
msm: I too have this problem, but i think ive worked out why it happens.

I have say 3 particles joined by constraints:

A-------B
\ /
\ /
\ /
C

If B collides with the wall the velocities of A and C will cause (through the constraint) B to move sideways (and backwards if you stuffed up like I did with the dampening). Also I think it would depend on what the velocity of B was.. ie if it had only one direction to its velocity.
B[x,y,z]
B[1,4,2] --> hits wall at z so now B is [1,0,2] (+/- feedback from the constraints)

Prehaps if you calculated your constraints in a different order? ie B-A, B-C, A-C looped a few times
(thats what im going to try next)

make any sence at all?

*dribble*

A.

##### Share on other sites
		bool dir = true;		for (int iter = 0; iter < 4; iter ++)		{			dir = !dir;			for(int i = 0; i < m_iNumConstraints; i ++)			{				if (dir)					m_xConstraints[i].SatisfyConstraints();				else					m_xConstraints[(m_iNumConstraints-1)-i].SatisfyConstraints();			}		}

I have this to prevent the constraints to be biased towards a direction. However, it makes very little difference.

as for your problem, there must be a bug. a demo would be nice, to see the problem.

##### Share on other sites
Been thinking about it today and it is, as oliii says, definately a bug. I will take a look tonight and work itout, but i think it is to do with setting up constrints.

I would post a demo, but it is c# so you would have to install the .net framwork

Matt

##### Share on other sites
Got it. The problem was i was not using enough iterations and very small values (using directx, and dealing with ranges 0 to 1 - bad coding i know but was just doing a test . Therefore, after a single iterations the small differences in the values between oldpos and currentpos, and the subsequent moving of currentpos due to constraints between the particles, was enough to represent a large difference in my replay, and therefore gave the impression they were bouncing.

##### Share on other sites
quote:
Original post by msm
Got it. The problem was i was not using enough iterations and very small values (using directx, and dealing with ranges 0 to 1 - bad coding i know but was just doing a test .

Good to hear!

Heh, my bug was the opposite... I was over dampening (large dampen, small constraint) - so the constraints kept overshooting the correct length.

The biggest problem i have with this is how cool it looks for no effort! ie particles->constraints->rope->cloth. Tweaking is my evil nemisis.

A.

1. 1
2. 2
Rutin
21
3. 3
4. 4
frob
16
5. 5

• 9
• 12
• 9
• 33
• 13
• ### Forum Statistics

• Total Topics
632593
• Total Posts
3007271

×