Here is the .NET translated code if anybody needs it. It also works with maps created with FPSC.
' DarkGDK.NET Startup project
'
Imports DarkGDK
Imports DGDKPlugins
Imports DarkGDK.Camera
''' <summary>
''' Our main application class
''' </summary>
''' <remarks></remarks>
Public Class Application
Shared v As Double
Shared x As Double = 10
Shared y As Double = 10
Shared z As Double = 10
Shared tmp As Double
Shared gravedad As Double = 0
Shared gr As Integer
Shared gr2 As Integer
Shared c As Integer = 2
Public Shared Sub GameLoop()
CDarkGDK.oDBLight.SetAmbientLight(100)
'CDarkGDK.oDB3D.LoadObject("iglesia.x", 1)
'CDarkGDK.oDB3D.LoadObject("universe.dbo", 1)
CDarkGDK.oDB3D.LoadObject("levelbank/testlevel/universe.dbo", 1)
CDarkGDK.oDB3D.ScaleObject(1, 800, 800, 800)
CDarkGDK.oDB3D.PositionObject(1, 0, 0, 0)
CDarkGDK.oDB3D.MakeObjectSphereB(2, 150)
v = CDarkGDK.oDB3D.ObjectSize(2)
CDarkGDK.oDB3D.HideObject(2)
CDarkGDK.oDBCamera.SetCameraRange(0.1, 50000)
CDarkGDK.oDB3D.PositionObject(2, 10, 10, 10)
CDarkGDK.oDBCamera.PositionCamera(10, 10, 10)
While DarkGDK.Engine.LoopGDK()
MapCollision()
CDarkGDK.oDBCore.Sync()
End While
End Sub
Public Shared Sub MapCollision()
x = CDarkGDK.oDB3D.ObjectPositionX(2)
y = CDarkGDK.oDB3D.ObjectPositionY(2)
z = CDarkGDK.oDB3D.ObjectPositionZ(2)
' collision with X
tmp = CDarkGDK.oDB3D.IntersectObject(1, x, y, z, x + v, y, z)
If tmp > 0 Then x = x - (v - tmp)
tmp = CDarkGDK.oDB3D.IntersectObject(1, x, y, z, x - v, y, z)
If tmp > 0 Then x = x + (v - tmp)
' collision with Z
tmp = CDarkGDK.oDB3D.IntersectObject(1, x, y, z, x, y, z + v)
If tmp > 0 Then z = z - (v - tmp)
tmp = CDarkGDK.oDB3D.IntersectObject(1, x, y, z, x, y, z - v)
If tmp > 0 Then z = z + (v - tmp)
'collision with Y
tmp = CDarkGDK.oDB3D.IntersectObject(1, x, y, z, x, y - v, z)
If tmp > 0 Then y = y + (v - tmp) / 3
'Gravity
tmp = CDarkGDK.oDB3D.IntersectObject(1, x, y, z, x, y - v, z)
If tmp = 0 Then gravedad = 2 Else gravedad = 1
gr = CDarkGDK.oDBCore.WrapValue(gr + CDarkGDK.oDBInput.MouseMoveX() / 3)
gr2 = CDarkGDK.oDBCore.WrapValue(gr2 + CDarkGDK.oDBInput.MouseMoveY() / 3)
'camera movements
CDarkGDK.oDBCamera.RotateCamera(gr2, 0, 0)
CDarkGDK.oDBCamera.YRotateCamera(gr)
'camera rotation limits
If gr2 <= 290 And gr2 > 180 Then gr2 = 290
If gr2 >= 70 And gr2 < 180 Then gr2 = 70
'player movements
If CDarkGDK.oDBInput.KeyState(17) Then x = CDarkGDK.oDBCore.NewXValue(x, gr, c)
If CDarkGDK.oDBInput.KeyState(17) Then z = CDarkGDK.oDBCore.NewZValue(z, gr, c)
If CDarkGDK.oDBInput.KeyState(31) Then x = CDarkGDK.oDBCore.NewXValue(x, gr, -c)
If CDarkGDK.oDBInput.KeyState(31) Then z = CDarkGDK.oDBCore.NewZValue(z, gr, -c)
'slide
If CDarkGDK.oDBInput.LeftKey Then x = CDarkGDK.oDBCore.NewXValue(x, gr - 90, c)
If CDarkGDK.oDBInput.LeftKey Then z = CDarkGDK.oDBCore.NewXValue(z, gr - 90, c)
If CDarkGDK.oDBInput.RightKey Then x = CDarkGDK.oDBCore.NewXValue(x, gr - 90, -c)
If CDarkGDK.oDBInput.RightKey Then z = CDarkGDK.oDBCore.NewXValue(z, gr - 90, -c)
'camera and player position
CDarkGDK.oDB3D.PositionObject(2, x, y - gravedad, z)
CDarkGDK.oDBCamera.PositionCamera(x, 22 + y - gravedad, z)
End Sub
End Class