How to know in what object I'm colliding???

Jan 24, 2008 at 5:08 PM
Edited Jan 24, 2008 at 5:53 PM
Hi again,,,

I'm doing a test:

- teapot (my character)
- Area A (left)
- bridge(a flyer box, travelling left/right and right/left)
- Area B (right)


my problem is detect the collision when my teapot (character) moving around move to up of bridge, because when the bridge move, the character should to go too...



I'm adding the objects in:

floorBodies = new List<Body>();
floorBodies.Add(areaAPhysic.PhysicsBody);
floorBodies.Add(areaBPhysic.PhysicsBody);
floorBodies.Add(bridgePhysic.PhysicsBody);
floorBodies.Add(teapotPhysic.PhysicsBody);



I'm too adding them to collision system:

collisionSystem.AddCollisionSkin(areaAPhysic.PhysicsSkin);
collisionSystem.AddCollisionSkin(areaBPhysic.PhysicsSkin);
collisionSystem.AddCollisionSkin(bridgePhysic.PhysicsSkin);
collisionSystem.AddCollisionSkin(teapotPhysic.PhysicsSkin);



and, in the method update, I test every time IF occour a collision:

collisionSystem.DetectAllCollisions(floorBodies, collisionFunctor, null, -0.05f);

if (collisions.Count > 0)
{
// ...
}


now, how do to know in what object I'm colliding, to move my character together with bridge???

I know exist the member "collisionsnumber of collision.SkinInfo.Skin0.ID", but dont have some descritive???? a propertie name???

or some other way do same thing...

thanks...

Coordinator
Jan 24, 2008 at 9:41 PM
mhhh, i don't fully understand your problem because your english is even worse than mine :P But have you tried to use the SkinInfo.Skin0.Owner Property? That should return the correct body.
Jan 25, 2008 at 12:14 AM
:-) rsrsrsrs (laughs),

I'm sorry my english...

but, I understand, thank's by your tip... :-)