# How can I force two shapes to intersect with small velocities?

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

## Recommended Posts

If I have a touching contact where tEnter = 0.0f how can I force the moving shape into the other shape in the collision pair so that they are intersecting?

For example if I have a shape moving with a velocity of:

{X:0.02845758 Y:8.023456E-11 Z:0}

and the contact has an entry time of 0.0f. How then can I make sure the two colliding shapes intersect?

if (finalContact.tEnter == 0.0f)
{
// Touching contact, move shape by a small amount to make sure it is intersecting (the following doesn't work)
//Vector3 v = Vector3.Normalize(velocity);
shape.Position += velocity;

if (Detection3D.TestStaticShapeShape(shape, shape2, ref currentContact))
{
shape.Position += currentContact.nEnter * currentContact.penetration;
}
}

This way TestStaticShapeShape will always solve the interpentrating shapes should tEnter be 0.0f.

EDIT: Almost parallel movement is a pain.

[Edited by - Spa8nky on August 23, 2010 5:55:01 AM]

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

• 13
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633722
• Total Posts
3013549
×