Spinning camera

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
Mokgra
Posts: 11
Joined: Wed Oct 24, 2012 3:16 am

Spinning camera

Post by Mokgra »

I'm trying to adopt the DemoGames Camera class into my game (I like how elegant it is compared to my brute camera). When I load into my world, the camera seems to be spinning like crazy! I can move my mouse around and eventually slow it to see my world is rendering fine. Any ideas what could be causing this? I suspect there may be some mouse initialization I'm missing (?).
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Spinning camera

Post by Norbo »

If the camera is controlled using the difference in mouse position from some fixed central position, make sure the mouse is reset to that central position every frame. Otherwise, you could hold the mouse out 20 pixels away from the center and stationary and it will still spin by itself. You can set the mouse position in XNA using the Mouse.SetPosition method.
Mokgra
Posts: 11
Joined: Wed Oct 24, 2012 3:16 am

Re: Spinning camera

Post by Mokgra »

Perfect! Thanks! That fixed the mouse look.

I love this physics engine by the way!
Post Reply