Hi Everyone!
I was wondering if anyone knew how I could calculate the velocity of a sine wave at any give time. I’m using a sine wave to calculate a characters jump motion and need to get the velocity from that curve.
I woudn’t usually calulate a jump this way but the project I’m working on requires this method for accuracy and predictability.
I have tried just comparing the changes between each frame and calculating it that way but I need a true velocity not an average between the last 2 points.
//Get Current Progress Of Jump (0.0f - 1.0f)
float fJumpProgess = (Time.fixedTime - fJumpStart) / (fJumpEnd - fJumpStart);
//Make Sure We Don't Go Too Far
fJumpProgess = Mathf.Min (fJumpProgess, 1.0f);
//Apply A Sine Curve To Y Axis
position = new Vector3(0.0f, Mathf.Sin (fJumpProgess * Mathf.PI ) * fJumpMagnitude, 0.0f);
Any advice would be usefull to me!
Thanks in advance!
David