A Colision Problem By Hitting The Ground!!!!!!
Posted: Mon May 14, 2007 3:02 pm
Hello, I wrote some colisions and i compiled the program, but when i executed program i fall from air way the ground and when the moment comes when i must touth the ground i see nothing. Sorry for me English. Compile the belowe code to see what i mean.
Code: Select all
using System;
using Irrlicht;
using Irrlicht.Video;
using Irrlicht.Core;
using Irrlicht.Scene;
namespace MyFirstApplicationInCSharp
{
class Program
{
static void Main(string[] args)
{
Program newGame = new Program();
newGame.uruchomGre();
}
public void uruchomGre()
{
IrrlichtDevice oknoGry = new IrrlichtDevice(DriverType.DIRECT3D8, new Irrlicht.Core.Dimension2D(800, 600), 32, false, true, false);
oknoGry.WindowCaption = "KSEkspert Gra";
oknoGry.FileSystem.AddZipFileArchive("media/map-20kdm2.pk3");
IAnimatedMesh poziomGry = oknoGry.SceneManager.GetMesh("20kdm2.bsp");
ISceneNode wezelPoziomuGry = oknoGry.SceneManager.AddOctTreeSceneNode(poziomGry.GetMesh(0), null, 0);
wezelPoziomuGry.Position = new Vector3D(0, 0, 0);
ICameraSceneNode wezelKamery = oknoGry.SceneManager.AddCameraSceneNodeFPS(null, 100, 300, 0);
wezelKamery.Position = new Vector3D(1000,1000,500);
wezelKamery.Rotation = new Vector3D(0,180,0);
oknoGry.CursorControl.Visible = false;
ITriangleSelector selektor = oknoGry.SceneManager.CreateOctTreeTriangleSelector(poziomGry.GetMesh(0), wezelPoziomuGry, 128);
ISceneNodeAnimator detektorKolizjiKamery = oknoGry.SceneManager.CreateCollisionResponseAnimator(selektor, wezelKamery, new Vector3D(30, 40, 30), new Vector3D(0, 0.0f, 0), new Vector3D(0,15,0),0);
wezelKamery.AddAnimator(detektorKolizjiKamery);
while (oknoGry.Run())
{
if (oknoGry.WindowActive)
{
oknoGry.VideoDriver.BeginScene(true, true, new Color(0, 200, 200, 200));
oknoGry.SceneManager.DrawAll();
oknoGry.VideoDriver.EndScene();
}
}
}
}
}