What hits BasicRay?

Blackbeard

26-03-2007 20:26:07

Hi, i wonder whats wrong.
I use BasicRaycast to see where i hit a plane.
Plane's scene node position is 0,0,0.

It hits something, but only if Ray's endpoint (Vector3 end) is X!=0 ??

Is the fault by me, OgreNewt or MogreNewt? :cry:



NWorld = new World();
MogreNewt.Debugger.Instance.init(mgr);
MogreNewt.CollisionPrimitives.TreeCollisionSceneParser stat_col = new MogreNewt.CollisionPrimitives.TreeCollisionSceneParser(NWorld);
stat_col.parseScene(snode, true);
MogreNewt.Body bod = new MogreNewt.Body(NWorld, stat_col);
stat_col.Dispose();

bod.attachToNode(snode);
bod.setPositionOrientation(new Vector3(0.0f, 0.0f, 0.0f), Quaternion.IDENTITY);

Vector3 start = new Vector3(0.0f, 200.0f, -100.0f);
Vector3 end = new Vector3(10.0f, 0.0f, 0.0f); //???

BasicRaycast nray = new BasicRaycast(NWorld, start, end);
if (nray.getHitCount() > 0) {return true;}

Blackbeard

26-03-2007 21:38:02

Ah, yes. TreeCollisionSceneParser seems broken?
TreeCollision seems to work, so i will take this.