Plane3d and getIntersectionLine

Irrlicht.Net is no longer developed or supported, Irrlicht.Net Cross Platform is a much more complete wrapper. Please ask your C# related questions on their forums first.
Locked
cdrwolfe
Posts: 100
Joined: Thu Nov 15, 2007 5:38 pm
Location: Cranfield University

Plane3d and getIntersectionLine

Post by cdrwolfe »

It seems that getIntersectionLine is missing form the .NET irrlicht engine, i've been trying to implement a simple RTS mouse click movement system.

Code taken from another thread has proved useful however as it's in 3D and i want the posititon not to change in height for the moment it doesn't quite work as intended.

I'd though i'd try one of vitek's methods but as it involves the use of getIntersectionLine i can't. Has anyone managed to implement something similar to a point and click system of movement?

Code: Select all

Line3D line = device.SceneManager.SceneCollisionManager.GetRayFromScreenCoordinates(Mouse, null);
            Vector3D camPos = device.SceneManager.ActiveCamera.Position;
            Vector3D nodePos = selectedSceneNode.Position;
            Vector3D nodeDist = nodePos - camPos;
            Vector3D destPos = line.GetVector();
            destPos.Normalize();
            destPos = new Vector3D(destPos.X * (float)nodeDist.Length, destPos.Y * (float)nodeDist.Length, destPos.Z * (float)nodeDist.Length);
            selectedSceneNode.Position = destPos + camPos;
Regards Wolfe
Locked