Roll causes noisy angular velocity?
-
So I’m sitting here rather stumped by this.
I’m reading the angular velocity of the player’s ship to use for interpolation and animation and that works perfectly when it comes to yaw and pitch. I do so using PhySys::GetAngularVelocityOS, though I tried CObject::get_angular_velocity with identical results.
So this all works fine for yaw and pitch, but if the player begins rolling, the angular velocity becomes extremely noisy, frequently shifting between values multiple times per second. Worse, it’s not just the roll component: every angular velocity component is similarly affected.
I’ve graphed the result here:
https://dl.dropboxusercontent.com/u/486813/data.pdfIn the first zone, I do mostly yaw movements, which affects the blue curve. Then I switch to pitch, which affects the yellow curve. Both of these are smooth and work exactly as you’d expect.
However, when I start to apply roll, all three values begin exhibiting a sawblade pattern which persists for as long as roll is applied and affects all three components.
The dark orange line near the origin is the time delta, which doesn’t seem affected by this problem (so it’s not the provided time delta that goes crazy).
Since rolling wasn’t enabled by default, it’s possible that there’s a bug with it somewhere, but I’m not sure what that could be. I’ve tried to apply the roll component myself to the player’s IBehaviorManager through update_current_behavior_direction, which works fine but doesn’t solve the issue.
Does anyone have any clue what could be the problem?