i need to have the distance between the camera and the ground.
Code: Select all
Private Function GetOverGround(ByVal isnode As Irrlicht.Scene.ISceneNode) As Long
Dim il3dHelp As Irrlicht.Core.Line3D
Dim v3dCollision As Irrlicht.Core.Vector3D
Dim test As Irrlicht.Core.Triangle3D
il3dHelp.start = isnode.Position
il3dHelp.end = New Irrlicht.Core.Vector3D(isnode.Position.X, -3000, isnode.Position.Z)
smgr.SceneCollisionManager.GetCollisionPoint(il3dHelp, selector, v3dCollision, test)
GetOverGround = isnode.Position.Y - v3dCollision.Y
End Function
The idea was to create a line to get the collsionpoint. (Just look at the source. ) The problem is, that "v3dCollision.Y" is 0 ...
Do you have any idea why? Is the source correct?
Thank You