hi,
after along night on the PC... I coded this.
[STAThread]
static void Main(string[] args)
{
float fX = 0;
float fY = 0;
int ActiveTime = 0;
if (!CDGDK.InitializeDGDK("........."))
return;
CDGDK.oDBCore.SyncOn();
CDGDK.oDBCore.SyncRate(0);
CDGDK.oDBCamera.AutoCamOff();
CDGDK.oDBCamera.PositionCamera(0, 0, 0);
CDGDK.oDBCamera.PointCamera(0, 0, 0);
CDGDK.oDBDisplay.SetDisplayMode(1280, 800, 32);
CDGDK.oDBDisplay.SetWindowOff();
CDGDK.oDBWorld.SetBSPCollisionOff(1);
CDGDK.oDBWorld.SetBSPCameraCollision(1, 0, 1.0f, 0);
CDGDK.oDBWorld.SetBSPCamera(0);
CDGDK.oDBWorld.SetBSPMultiTexturingOn();
CDGDK.oDBWorld.SetBSPCollisionThreshhold(1, 0.1f);
//CDGDK.oDBWorld.LoadBSP("ikzdm1.pk3", "ikzdm1.bsp");
CDGDK.oDBWorld.LoadBSP(@"C:\Programme\Quake III Arena\baseq3\pak0.pk3", "q3dm6.bsp");
CDGDK.oDB3D.LoadObject("sky.x", 1);
CDGDK.oDB3D.ScaleObject(1, 8, 8, 8);
//CDGDK.oDB3D.LoadEffect("Skybox.fx", 1, 1);
//CDGDK.oDB3D.SetObjectEffect(1, 1);
while (CDGDK.oDBP.LoopGDK)
{
fY += CDGDK.oDBInput.MouseMoveX();
fX += CDGDK.oDBInput.MouseMoveY();
CDGDK.oDBCamera.ControlCameraUsingArrowKeys(0, 0.2f, 1);
CDGDK.oDBCamera.RotateCamera(fX, fY, 0);
//Bullet Time
if (CDGDK.oDBInput.MouseClick() == 1)
{
CDGDK.oDBCore.SyncRate(16);
ActiveTime = 1;
}
//normal FPS
if (CDGDK.oDBInput.MouseClick() == 2)
{
CDGDK.oDBCore.SyncRate(0);
ActiveTime = 0;
}
if (ActiveTime == 1)
{
CDGDK.oDBText.Text(0, 20, "Bullet Time");
}
else
{
CDGDK.oDBText.Text(0, 20, "Full Speed");
}
CDGDK.oDBCamera.PositionCamera(CDGDK.oDBCamera.CameraPositionX(), CDGDK.oDBCamera.CameraPositionY() - 0.15f, CDGDK.oDBCamera.CameraPositionZ());
CDGDK.oDBText.Text(0, 0, "FPS: " + CDGDK.oDBDisplay.ScreenFPS().ToString());
CDGDK.oDBCore.Sync();
}
}
the collision works, but not perfect...
if i set this line
"CDGDK.oDBWorld.SetBSPCameraCollision(1, 0, 1.0f, 0);"
to this
"CDGDK.oDBWorld.SetBSPCameraCollision(1, 0, 1.5f, 0);"
the collision is ok on all walls, but i can't walk through doors.
Another question is... a few maps have a script for open Doors or what ever... work this?
Flow