Page 1 of 1

Collision detection with cubescenenode

Posted: Fri May 25, 2007 7:08 am
by VinZ
Hi,
I'm new to irrlicht.net, currently i'm working in collision detection between maya camera node and cubescenenode. i tried a lot, but it is not working,
my code is,

ICameraSceneNode cam =
device.SceneManager.AddCameraSceneNodeMaya(null,5000.0f, 5000.0f, 150.0f,-1);

device.SceneManager.ActiveCamera = cam;

cam.Position = new Vector3D(10,50,-80);
cam.Rotation = new Vector3D(0.0f, 0.0f, 0.0f);

ISceneNode node = device.SceneManager.AddCubeSceneNode(100,
null, -1, new Vector3D(0,-50,0));

node.SetMaterialTexture(0, texWall);
node.SetMaterialFlag(MaterialFlag.LIGHTING, false);


ITriangleSelector selector = null;

selector = device.SceneManager.CreateTriangleSelectorFromBoundingBox(node);
//node.SetTriangleSelector(selector);

ISceneNodeAnimator anim = device.SceneManager.CreateCollisionResponseAnimator(
selector, cam, new Vector3D(30,50,30),
new Vector3D(0,-3,0),
new Vector3D(0,50,0),10.0f);
cam.AddAnimator(anim);


any one can pls help me and solve the problem,
thanks in advance.