other ways for collision detection

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
irrlicher
Posts: 9
Joined: Sat Jul 01, 2006 9:27 am

other ways for collision detection

Post by irrlicher »

Hello everybody!I have a question about collision detection:
I know how to create CollisionResponseAnimator but it only checks the collision and repsonse the object by not moving it.But i want to when my camera collides with an object i want that object disappear.I've tried many things but i couldn't do it. :(
And that was my code:

Code: Select all

if (camera->getPosition()==object->getPosition)
{
//blablabla
}
But it only works when i get very close to get the object.
How can i do it?Thanks in advance!
Do you think 13 year aged children can't make 3d games? :)
area51
Posts: 338
Joined: Thu Mar 18, 2004 10:20 pm
Location: UK
Contact:

Post by area51 »

You could try something like this:

Code: Select all

if( object->getPosition().getDistanceFrom(camera->getPosition()) < 100)
{
// blablabla
}
100 is the trigger region, increase or decrease this as required
________
Colorado Medical Marijuana Dispensaries
Last edited by area51 on Fri Feb 25, 2011 12:03 am, edited 1 time in total.
irrlicher
Posts: 9
Joined: Sat Jul 01, 2006 9:27 am

Post by irrlicher »

That worked well now!Thanks area51!! :)
Do you think 13 year aged children can't make 3d games? :)
Post Reply