Page 1 of 1

Collision between scene nodes

Posted: Sat Jan 08, 2011 7:40 am
by wsw1231
I am now learning tutorial 07 and I notice that the camera cannot move through walls because of the collision response animator.

I am wondering if I can use this animator to handle the collision between scene nodes other than camera. That is, if there are 2 scene nodes on the screen, how to move one node but disallow it to move through the other node?

Could someone please give me an example code?
Thanks a lot!

Re: Collision between scene nodes

Posted: Sun Jan 09, 2011 3:34 pm
by Jiang
wsw1231 wrote:I am now learning tutorial 07 and I notice that the camera cannot move through walls because of the collision response animator.

I am wondering if I can use this animator to handle the collision between scene nodes other than camera. That is, if there are 2 scene nodes on the screen, how to move one node but disallow it to move through the other node?
IIRC, collision response animator works for nodes other than camera, you just need to tell them how your node looks like (size ... ) and where is it. Check getCollisionResultPosition and getCollisionTriangle in ISceneNodeAnimatorCollisionResponse please.

BTW, if you need accurate collision detection (for example, for physics calculation), then you need special collision detection libraries, such as SOLID, Opcode and Bullet.

Regards,

Jiang