private void HandlePitch(Vector3 towardGravity) { float angle = Vector3.SignedAngle(Vector3.forward, towardGravity, Vector3.right); float relativeAmount = angle / ANGLE_MAX; _Pitch.Invoke(RelativeInputEvent.WithinFullRange(relativeAmount)); }
private void HandleYaw(Vector3 towardGravity) { float angle = Vector3.SignedAngle(Vector3.down, towardGravity, Vector3.up); float relativeAmount = angle / ANGLE_MAX; _Roll.Invoke(RelativeInputEvent.WithinFullRange(relativeAmount)); }
public override Vector3 GetPointFromRelativeInput(float relativeInput) { float internalRelative; if (_FullRange) { internalRelative = RelativeInputEvent.WithinFullRange(relativeInput); } else { internalRelative = RelativeInputEvent.WithinPositiveRange(relativeInput); } return(DeterminePointInSpaceFromRelativeInput(internalRelative)); }
private void NotifyNewInput() { float value = RelativeInputEvent.WithinFullRange(Curve.Evaluate(_TimeSeconds)); InputConsumers.Invoke(value); }