Spin Speed is the speed to rotate the object on each axis (preferably in degrees per second). Local is whether the rotation should be done based on world axes or object axes. Starting Rotation is the initial rotation of the object.
Normally I would use Transform.Rotate to do the rotation, but in this case I have to make the rotation a function of time, so you can pass in any time value and it will return what the rotation should be at that time.
Here is an example (this doesn't work properly for either world or object axis rotation):
private Quaternion getRotation(float time)
return Quaternion.Euler(InitialRotation + SpinSpeed * time);
I just need some help figuring out the math behind calculating rotations for both world and object axes. I think that matrices can be used but I honestly don't remember anything about how to use them.
Here's an example of using world axes with a SpinSpeed of 180 on the y axis and an initial rotation of 45 on the x axis: https://i.gyazo.com/d7f41b6a88425b5d8b8237cd7ac40878.gif
An example of using local axes with the same parameters as above: https://i.gyazo.com/d453b3dd239c9f77b86ce372c499d068.gif