public void Act() { // check for angle when implemented float currentVelocity = c_playerData.f_currentSpeed; float deceleration = c_playerData.f_brakePower; float slowScaling = c_playerInputData.f_inputAxisLVert * -1; Vector3 currentPosition = c_playerData.v_currentPosition; Vector3 currentNormal = c_playerData.v_currentNormal; Quaternion currentRotation = c_playerData.q_currentRotation; AccelerationCartridge.Decelerate(ref currentVelocity, deceleration * slowScaling); AccelerationCartridge.DecelerateFriction(ref currentVelocity, 0.1f, currentRotation); VelocityCartridge.UpdatePositionTwo(ref currentPosition, ref currentRotation, ref currentVelocity); c_playerData.f_currentSpeed = currentVelocity; c_playerData.v_currentPosition = currentPosition; c_playerData.v_currentNormal = currentNormal.normalized; c_playerData.v_currentDown = currentNormal.normalized * -1; c_playerData.q_currentRotation = currentRotation; }
public void Act() { // check for angle when implemented float currentVelocity = c_playerData.f_currentSpeed; Vector3 currentPosition = c_playerData.v_currentPosition; Quaternion currentRotation = c_playerData.q_currentRotation; Quaternion currentModelRotation = c_playerPositionData.q_currentModelRotation; AccelerationCartridge.AccelerateGravity(ref currentVelocity, c_playerData.f_gravity, c_playerData.f_topSpeed, ref currentRotation, ref currentModelRotation); AccelerationCartridge.DecelerateFriction(ref currentVelocity, 0.1f, currentRotation); VelocityCartridge.UpdatePositionTwo(ref currentPosition, ref currentRotation, ref currentVelocity); c_playerData.f_currentSpeed = currentVelocity; c_playerData.v_currentPosition = currentPosition; c_playerData.q_currentRotation = currentRotation; }