Karsten,
I won't be surprised if this stuff is my fault but I am testing VC and have noticed a couple things.
attached a run-ready zip file, but Ill try to explain....
1) My dynamic object wont wrap itself around the static track object, even though according to ShowObjectBounds(objNum,1)<--boxOnly shows the wireframe for the collision bounds says it should. (Picture an upside-down U over a monorail). The car object decends with gravity ok, but when it gets to the track it stops above the track, not wrapped around it. It moves forward, then obviously falls off the world because it wont follow the path of the track
2) Not an issue yet but will be, the 90 degree curves in the track show collision bounding that is not following the path but forms a box the overall size of the object itself.
you can see what I mean if you run the exe in the zip
here is the main source:
Imports CDarkGDK
Module modMain
Dim iMouseX, iMouseY As Integer
Dim sngCamSpeed As Single = 0.5F
Sub Main()
CDarkGDK.InitDarkGDK(sDGDK_NET_Key)
SetupGUI()
SetupObjects()
While oDBP.LoopGDK
'//main loop
oDB3D.MoveObject(2, 0.02F)
VanillaLib.clsVanillaCollision.VanillaCollision(1.0F, 0.0F, 1, 2)
VanillaLib.clsVanillaCollision.VanillaGravity(0.1F, 1, 2)
MouseCam()
oDBCore.Sync()
End While
End Sub
Private Sub MouseCam()
iMouseX += oDBInput.MouseMoveX()
iMouseY += oDBInput.MouseMoveY()
oDBCamera.RotateCamera(iMouseY / 2.0F, iMouseX / 2.0F, 0)
If oDBInput.UpKey() = 1 Then
oDBCamera.MoveCameraUp(0, sngCamSpeed)
End If
If oDBInput.DownKey() = 1 Then
oDBCamera.MoveCameraDown(0, sngCamSpeed)
End If
If oDBInput.LeftKey() = 1 Then
oDBCamera.MoveCameraLeft(0, sngCamSpeed)
End If
If oDBInput.RightKey() = 1 Then
oDBCamera.MoveCameraRight(0, sngCamSpeed)
End If
If oDBInput.MouseClick() = 1 Then
oDBCamera.MoveCamera(sngCamSpeed)
End If
If oDBInput.MouseClick() = 2 Then
oDBCamera.MoveCamera(-sngCamSpeed)
End If
End Sub
Private Sub SetupObjects()
oDB3D.LoadObject(Application.StartupPath & "vc_test_dxzm.x", 1)
oDB3D.LoadObject(Application.StartupPath & "vc_car_dxzm.x", 2) : oDB3D.PositionObject(2, -0.1F, 10.0F, 0.0F)
oDB3D.SetObjectCollisionToPolygons(1)
oDB3D.SetObjectCollisionToSpheres(2)
oDB3D.ShowObjectBounds(1, 1)
oDB3D.ShowObjectBounds(2, 1)
End Sub
Private Sub SetupGUI()
oDBDisplay.SetWindowTitle("Vanilla Collision Test by CattleRustler - DGDK.NET")
oDBDisplay.SetDisplayMode(1024, 768, 32)
oDBDisplay.SetWindowPosition(250, 128)
oDBCamera.AutoCamOff()
oDBCore.SyncOn()
oDBCamera.BackdropOn()
oDBCamera.ColorBackdrop(oDB2D.RGBC(0, 0, 0))
oDBCamera.PositionCamera(0.0F, 30.0F, -30.0F)
oDBCamera.PointCamera(0.0F, 0.0F, 0.0F)
'oDBCamera.SetCameraFOV(60)
'oDBLight.SetAmbientLight(50)
End Sub
End Module
thanks
EDIT: forgot to mention the camera is controlled by the mouse so when the exe starts move the mouse down to see the test scene (the red object will already be falling and moving forward). You can zoom in by using the LMB, zoom out with RMB.
My DBP plugins page is now hosted [href]
here[/href]