Gates

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
Ittallas
Posts: 5
Joined: Sat May 28, 2005 4:29 pm
Location: Lithuania
Contact:

Gates

Post by Ittallas »

Hi all,

I'm creating a game and so far i have some problems..the purpose of the game is to reach gates where player can teleport to another level. So my question how to do that when player come on gates something happen?
I was tried to comparison positions of camera and the gates (gates is an object), but unsuccesfully. Any advices?
Boring life. Let's make it funny!
Guest

Post by Guest »

that's strange, it should work...an option is adding an empty scene node and chek for collision, but the distance check is a better solution...should work
Ittallas
Posts: 5
Joined: Sat May 28, 2005 4:29 pm
Location: Lithuania
Contact:

Post by Ittallas »

So...maybe any examples of working code? Would be very nice from your side...thanks!
Boring life. Let's make it funny!
Guest

Post by Guest »

no one is required to write code for you. the 3d distance formula is d=sqr((x2-x1)^2+(y2-y1)^2+(z2-z1)^2) you do the rest.
MasterD
Posts: 153
Joined: Sun Feb 15, 2004 4:17 pm
Location: Lübeck, Germany
Contact:

Post by MasterD »

if(PlayerPosition.getDistanceFrom(gatePosition) < 500.f)
{
// Do it!
}

should work, nope?
YASS - Yet another Space Shooter
under Devolpment, see http://yass-engine.de
Post Reply