Gyro Stabilization - Spinning faster on one axis stabilizes spin on other axes (Need advice on how to do this)
Easier than you might think! It's pretty much automatic. Try this in the demos:
Code: Select all
CompoundBody top = new CompoundBody(new[]
{
new CompoundShapeEntry(new ConeShape(1, 1), Quaternion.CreateFromAxisAngle(Vector3.Forward, MathHelper.Pi)),
new CompoundShapeEntry(new CylinderShape(.5f, .2f), new RigidTransform(new Vector3(0, 0.5f, 0), Quaternion.Identity))
}, 10);
top.AngularDamping = 0;
top.AngularVelocity = new Vector3(0, 100, 0);
top.Position = new Vector3(0, 5, 5);
Space.Add(top);
The engine does, however, take some shortcuts for greater stability. To make it more realistic, you can turn on angular momentum conservation and RK4 angular integration:
Code: Select all
MotionSettings.UseRk4AngularIntegration = true;
MotionSettings.ConserveAngularMomentum = true;
These settings probably won't have much of an effect on the result, though.
Magnus Effect - A force is applied at the cross product of the direction of velocity and the axis of rotation and the force is scaled by the angular velocity and linear velocity.
The direction of the velocities does not need to be computed here; the cross product can take the linear velocity and angular velocity directly. An arbitrary scalar can be applied to tune the result; my guess is that it will end up being fairly tiny for a frisbee.
Lift/Drag - We figure out the angle of the frisbee by getting the dot product of the normalized velocity and the up of the frisbee then apply a force towards the up vector of the frisbee that is scaled by the angle and the velocity.
Angular lift? - I'm thinking I would also need to apply a change in angular velocity so that it changes its rotation as it flies.
That would be a decent approximation.
Applying an impulse a bit off center to represent lift will introduce angular motion without having to worry about a separate force. This is an approximation of how reality works- the lift force is distributed over the surface, but not perfectly uniformly. Instead, the net force ends up being a bit ahead of the center of mass. The imbalance tilts the frisbee.
Of course, there's comes a point where a level of approximation must be decided on. Using some parts of a detailed approximation and some parts of a much more relaxed approximation could result in noticeably non-frisbeelike behavior. For example, including only one part of 'realistic' angular motion from lift forces could end up requiring
other details to balance out the behavior and prevent constant looping.
Would this be all of the forces that I need?
Unfortunately, I have no special insights about frisbees. I did not play with them enough to gather a detailed appreciation for all of their subtle workings
How much you 'need' depends on what your goals are. I'd recommend just trying out some implementations and seeing how they feel. If something seems to be missing, google around for the mechanics of frisbee flight and try to fill in the gap.