Page 1 of 1

Check what's in front of the object (solved)

Posted: Wed May 20, 2009 11:40 am
by nayon
Hi everyone, I have a problem.

I want to check, via getSceneNodeFromRayBB, what is in front of a given scene node. I know the position and rotation of the node (obviously), but for the life of me I cannot calculate what parameters should I pass as the line ending point and beginning points. The line ending point should be a given amount, let's say "dist" amount of units in front of the object in the direction it's facing. The beginning should also be in front of the object as not to collide with the object itself. Can anyone give me a hand here?

Posted: Thu May 21, 2009 8:26 am
by Katsankat
Hi, what part did you not understand in examples/demo ?

Posted: Thu May 21, 2009 12:18 pm
by nayon
I don't think what I asked had something to do with the examples, but I solved it. I create a vector (1,0,0), then use rotateXZBy to rotate it around the node's rotation, then add it to the position of the node. That's all.