//! \cond // ---------------- public void ApplyUnclampedVec(Vector2 v) //, JoystickConfig.ClampMode sourceClampMode) { if (this.config.clampMode == JoystickConfig.ClampMode.Circle) { v = CFUtils.ClampInsideUnitCircle(v); } else { v = CFUtils.ClampInsideUnitSquare(v); } this.nextFramePos.x = CFUtils.ApplyDeltaInput(this.nextFramePos.x, v.x); this.nextFramePos.y = CFUtils.ApplyDeltaInput(this.nextFramePos.y, v.y); }
// ------------------ public Vector2 ClampNormalizedPos(Vector2 np) { return((this.clampMode == ClampMode.Circle) ? CFUtils.ClampInsideUnitCircle(np) : CFUtils.ClampPerAxisInsideUnitSquare(np)); //CFUtils.ClampInsideUnitSquare(np)); }