Disregard my previous post. Here is the correct code. It appears "Mouse.MoveX" or "Mouse.MoveY" are not recognized, but "Mouse.MoveXAlternate" and "Mouse.MoveYAlternative" is.
Here is my method/routine(s) for controlling the camera with the mouse.
First, create a boolean variable at the module level;
Public rmb as boolean
Create additional global variables like I have:
Public Xcangle as single = 0.0f
Public Ycangle as single = 0.0f
Public xnewangle as single = 0.0f
Public MMY as single = 0.0f
Public MMX as single = 0.0f
Then, create this routine to be called anytime rmb is True.
Public Sub PointCameraUsingMouse()
Xcangle = DarkGDK.Camera.DefaultCamera.CurrentAngleX
Ycangle = DarkGDK.Camera.DefaultCamera.CurrentAngleY
xnewangle = Xcangle + (MMY * 0.25)
ynewangle = Ycangle + (MMX * 0.25)
DarkGDK.Camera.DefaultCamera.RotateCurrent(xnewangle, ynewangle, 0)
mmx = DarkGDK.IO.Mouse.MoveXAlternative
mmy = DarkGDK.IO.Mouse.MoveYAlternative
End Sub
rmb is set to true with the mouse down event attached to the CtlDarkGDKViewPort1 here when the right mouse button is pressed:
Private Sub CtlDarkGDKViewport1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles CtlDarkGDKViewport1.MouseDown
If e.Button = Windows.Forms.MouseButtons.Right Then
rmb = True
End If
The mouse up event resets the rmb boolean back to false:
Private Sub CtlDarkGDKViewport1_MouseUp(sender As Object, e As MouseEventArgs) Handles CtlDarkGDKViewport1.MouseUp
rmb = False
End Sub
In the main game loop, call the routine anytime the rmb is true;
Public Shared Sub GameLoop()
While DarkGDK.Engine.LoopGDK()
mmx = DarkGDK.IO.Mouse.MoveXAlternative
mmy = DarkGDK.IO.Mouse.MoveYAlternative
If rmb = True Then
PointCameraUsingMouse()
End If
DarkGDK.Core.Sync()
End While
End Sub
mmx and mmy are constantly updated to track where the mouse is before the call to PointCameraUsingMouse()