public void move(Vector3 offset, SimObjectFollowerWithRotation follower) { keyframe.OrbitRadius += offset.z; }
public Quaternion getRotation(SimObjectFollowerWithRotation follower) { return(follower.Owner.Rotation); }
public void setRotation(Quaternion rotation, SimObjectFollowerWithRotation follower) { keyframe.OrbitRotation = follower.TargetSimObject.Rotation.inverse() * rotation; }
public Vector3 getTranslation(SimObjectFollowerWithRotation follower) { return(follower.Owner.Translation); }
public Quaternion getRotation(SimObjectFollowerWithRotation follower) { return(follower.TargetSimObject.Rotation * keyframe.OrbitRotation); }
public void move(Vector3 offset, SimObjectFollowerWithRotation follower) { keyframe.OrbitTranslation += Quaternion.quatRotate(follower.TargetSimObject.Rotation.inverse(), offset); }
public Vector3 getTranslation(SimObjectFollowerWithRotation follower) { return(follower.TargetSimObject.Translation + Quaternion.quatRotate(follower.TargetSimObject.Rotation, keyframe.OrbitTranslation)); }
public void preview(SimObjectFollowerWithRotation follower) { blendFrom(this, 0.0f, follower); }
public void blendFrom(OffsetModifierKeyframe previousFrame, float percentage, SimObjectFollowerWithRotation follower) { var orbitPreviousFrame = previousFrame as OrbitOffsetModifierKeyframe; if (orbitPreviousFrame != null) { Vector3 orbitTranslationOffset = orbitPreviousFrame.orbitTranslation.lerp(ref orbitTranslation, ref percentage); Quaternion orbitRotationOffset = orbitPreviousFrame.orbitRotation.nlerp(ref orbitRotation, ref percentage); float radiusOffset = orbitPreviousFrame.orbitRadius.interpolate(orbitRadius, percentage); Quaternion orbiterAdditionalRotationOffset = orbitPreviousFrame.orbiterAdditionalRotation.nlerp(ref orbiterAdditionalRotation, ref percentage); follower.TranslationOffset = orbitTranslationOffset + Quaternion.quatRotate(orbitRotationOffset, orbitStartDirection * radiusOffset); follower.RotationOffset = orbitRotationOffset * orbiterAdditionalRotationOffset; follower.computePosition(); } }