Does collision detection only work with bsp maps or can I get it to work with .x files .. and other types of meshes .. ??
I tried to write a program to do it from .x mesh but it didn't work ... any help ?
Collision detection
Works with other formats too.
Managed code example:
Managed code example:
Code: Select all
//Add mesh
IAnimatedMesh mesh = smgr.GetMesh("scene.my3d");
ISceneNode meshNode = smgr.AddOctTreeSceneNode(mesh, null, 0, 128);
meshNode.Position = new Vector3D(0, 0, 0);
//Set collision
ITriangleSelector selector = smgr.CreateOctTreeTriangleSelector(mesh.GetMesh(0), meshNode, 128);
ISceneNodeAnimator anim = smgr.CreateCollisionResponseAnimator(selector, camera, new Vector3D(60, 100, 60), new Vector3D(0, 0, 0), new Vector3D(0, 50, 0), 0.0005f);
camera.AddAnimator(anim);-
lazar.mihai
- Posts: 2
- Joined: Mon Jul 17, 2006 11:57 am
Sorry.. it still doesn't work
I tried what you said .. but I still can't get it to work .. I think it has something to do with the Managed implementation of Irrlicht.. cause in native code worked fine ... but in .NET it doesn't work ... I can't figure out why ...
Also .. why isn't there a IMeshBuffer written for Irrlicht.NET ? I thought the alpha phase was over and done with .. but I see there are more to work on still ...
Also .. why isn't there a IMeshBuffer written for Irrlicht.NET ? I thought the alpha phase was over and done with .. but I see there are more to work on still ...
Lazar Mihai
Re: Sorry.. it still doesn't work
HELLO! TRY THIS!
//Add mesh
IAnimatedMesh mesh = smgr.GetMesh("scene.my3d");
ISceneNode meshNode = smgr.AddOctTreeSceneNode(mesh, null, 0, 128);
meshNode.Position = new Vector3D(0, 0, 0);
//Set collision
ITriangleSelector selector = smgr.CreateOctTreeTriangleSelector(mesh.GetMesh(0), meshNode, 128);
ISceneNodeAnimator anim = smgr.CreateCollisionResponseAnimator(selector, camera, new Vector3D(1, 1, 1), new Vector3D(0, 0, 0), new Vector3D(0, 1, 0), 0.0005f);
camera.AddAnimator(anim);
I had the same problem and i have solve this way!you must be care ful with the parameters of CreateCollisionResponseAnimator.
by!
//Add mesh
IAnimatedMesh mesh = smgr.GetMesh("scene.my3d");
ISceneNode meshNode = smgr.AddOctTreeSceneNode(mesh, null, 0, 128);
meshNode.Position = new Vector3D(0, 0, 0);
//Set collision
ITriangleSelector selector = smgr.CreateOctTreeTriangleSelector(mesh.GetMesh(0), meshNode, 128);
ISceneNodeAnimator anim = smgr.CreateCollisionResponseAnimator(selector, camera, new Vector3D(1, 1, 1), new Vector3D(0, 0, 0), new Vector3D(0, 1, 0), 0.0005f);
camera.AddAnimator(anim);
I had the same problem and i have solve this way!you must be care ful with the parameters of CreateCollisionResponseAnimator.
by!