| | | 1 | | //======================================================================= |
| | | 2 | | // LSCapsuleCollider2D.cs |
| | | 3 | | //======================================================================= |
| | | 4 | | // MIT License, Copyright (c) 2026-present David Oravsky (mrdav30) |
| | | 5 | | // See LICENSE file in the project root for full license information. |
| | | 6 | | //======================================================================= |
| | | 7 | | |
| | | 8 | | using Chronicler; |
| | | 9 | | using FixedMathSharp; |
| | | 10 | | using FixedMathSharp.Geometry; |
| | | 11 | | using System; |
| | | 12 | | using System.Runtime.CompilerServices; |
| | | 13 | | |
| | | 14 | | namespace Gravitas.Colliders; |
| | | 15 | | |
| | | 16 | | /// <summary> |
| | | 17 | | /// Pure 2D capsule collider whose local center segment follows local 2D Y. |
| | | 18 | | /// </summary> |
| | | 19 | | public sealed class LSCapsuleCollider2D : LSCollider2D |
| | | 20 | | { |
| | | 21 | | private Fixed64 _radius; |
| | | 22 | | private Fixed64 _height; |
| | | 23 | | private Fixed64 _scaledRadius; |
| | | 24 | | private Fixed64 _axisLength; |
| | | 25 | | private Fixed64 _preparedRadius; |
| | | 26 | | private Fixed64 _preparedAxisLength; |
| | | 27 | | private Vector2d _preparedAxis; |
| | | 28 | | |
| | | 29 | | /// <summary>Creates a pure 2D capsule with authored dimensions.</summary> |
| | 707 | 30 | | public LSCapsuleCollider2D(Fixed64 radius, Fixed64 height) |
| | | 31 | | { |
| | 707 | 32 | | ValidateDimensions(radius, height); |
| | 706 | 33 | | _radius = radius; |
| | 706 | 34 | | _height = height; |
| | 706 | 35 | | MarkShapeDirty(); |
| | 706 | 36 | | } |
| | | 37 | | |
| | | 38 | | /// <summary>Creates a runtime capsule from an authored shape definition.</summary> |
| | 26 | 39 | | public LSCapsuleCollider2D(ColliderShapeDefinition2D definition) |
| | | 40 | | { |
| | 26 | 41 | | definition.EnsureKind(ColliderShapeDefinition2DKind.Capsule); |
| | 26 | 42 | | Material = definition.Material; |
| | 26 | 43 | | Fixed64 radius = definition.Radius; |
| | 26 | 44 | | Fixed64 height = definition.Size.Y; |
| | 26 | 45 | | ValidateDimensions(radius, height); |
| | 26 | 46 | | _radius = radius; |
| | 26 | 47 | | _height = height; |
| | 26 | 48 | | MarkShapeDirty(); |
| | 26 | 49 | | } |
| | | 50 | | |
| | | 51 | | /// <inheritdoc/> |
| | 1244 | 52 | | public override ColliderType2D Shape => ColliderType2D.Capsule; |
| | | 53 | | |
| | | 54 | | /// <summary> |
| | | 55 | | /// Gets or sets the unscaled semicircle radius. |
| | | 56 | | /// </summary> |
| | | 57 | | public Fixed64 Radius |
| | | 58 | | { |
| | | 59 | | [MethodImpl(MethodImplOptions.AggressiveInlining)] |
| | 9 | 60 | | get => _radius; |
| | | 61 | | set |
| | | 62 | | { |
| | 6 | 63 | | ValidateDimensions(value, _height); |
| | 4 | 64 | | if (_radius == value) |
| | 3 | 65 | | return; |
| | | 66 | | |
| | 1 | 67 | | _radius = value; |
| | 1 | 68 | | MarkShapeDirty(); |
| | 1 | 69 | | } |
| | | 70 | | } |
| | | 71 | | |
| | | 72 | | /// <summary> |
| | | 73 | | /// Gets or sets the unscaled full end-to-end capsule height. |
| | | 74 | | /// </summary> |
| | | 75 | | public Fixed64 Height |
| | | 76 | | { |
| | | 77 | | [MethodImpl(MethodImplOptions.AggressiveInlining)] |
| | 10 | 78 | | get => _height; |
| | | 79 | | set |
| | | 80 | | { |
| | 5 | 81 | | ValidateDimensions(_radius, value); |
| | 4 | 82 | | if (_height == value) |
| | 3 | 83 | | return; |
| | | 84 | | |
| | 1 | 85 | | _height = value; |
| | 1 | 86 | | MarkShapeDirty(); |
| | 1 | 87 | | } |
| | | 88 | | } |
| | | 89 | | |
| | | 90 | | /// <summary> |
| | | 91 | | /// Gets the radius after compound/local scaling. |
| | | 92 | | /// </summary> |
| | | 93 | | public Fixed64 ScaledRadius |
| | | 94 | | { |
| | | 95 | | [MethodImpl(MethodImplOptions.AggressiveInlining)] |
| | | 96 | | get |
| | | 97 | | { |
| | 6233 | 98 | | GetMassPropertyGeometry( |
| | 6233 | 99 | | out Fixed64 radius, |
| | 6233 | 100 | | out _); |
| | 6233 | 101 | | return radius; |
| | | 102 | | } |
| | | 103 | | } |
| | | 104 | | |
| | | 105 | | /// <summary> |
| | | 106 | | /// Gets the derived normalized world-space direction of the capsule's |
| | | 107 | | /// conceptual center axis. Exact geometry remains authoritative in the |
| | | 108 | | /// collider's planar rigid frame. |
| | | 109 | | /// </summary> |
| | | 110 | | public Vector2d WorldAxis { get; private set; } = Vector2d.Forward; |
| | | 111 | | |
| | | 112 | | /// <summary> |
| | | 113 | | /// Gets the full length of the conceptual center axis. |
| | | 114 | | /// </summary> |
| | | 115 | | public Fixed64 AxisLength |
| | | 116 | | { |
| | | 117 | | [MethodImpl(MethodImplOptions.AggressiveInlining)] |
| | | 118 | | get |
| | | 119 | | { |
| | 7001 | 120 | | if (HasCommittedShape) |
| | 6281 | 121 | | return _axisLength; |
| | | 122 | | |
| | 720 | 123 | | GetMassPropertyGeometry( |
| | 720 | 124 | | out _, |
| | 720 | 125 | | out Fixed64 axisLength); |
| | 720 | 126 | | return axisLength; |
| | | 127 | | } |
| | | 128 | | } |
| | | 129 | | |
| | | 130 | | /// <inheritdoc/> |
| | | 131 | | public override bool ContainsPoint(Vector2d point) |
| | 398 | 132 | | => FixedSegment2d.ContainsPointInCenteredCapsule( |
| | 398 | 133 | | point, |
| | 398 | 134 | | Center, |
| | 398 | 135 | | Rotation, |
| | 398 | 136 | | AxisLength, |
| | 398 | 137 | | ScaledRadius, |
| | 398 | 138 | | Fixed64.Zero, |
| | 398 | 139 | | strict: false); |
| | | 140 | | |
| | | 141 | | /// <inheritdoc/> |
| | | 142 | | public override Vector2d GetClosestPoint(Vector2d point) |
| | | 143 | | { |
| | 4 | 144 | | Vector2d direction = FixedSegment2d.GetDirectionFromCenteredAxis( |
| | 4 | 145 | | point, |
| | 4 | 146 | | Center, |
| | 4 | 147 | | Rotation, |
| | 4 | 148 | | AxisLength); |
| | 4 | 149 | | if (direction == Vector2d.Zero) |
| | 3 | 150 | | direction = Rotate(Vector2d.Right, Rotation).Normalized; |
| | 4 | 151 | | if (FixedSegment2d.TryGetSurfacePointOnCenteredCapsule( |
| | 4 | 152 | | point, |
| | 4 | 153 | | Center, |
| | 4 | 154 | | Rotation, |
| | 4 | 155 | | AxisLength, |
| | 4 | 156 | | ScaledRadius, |
| | 4 | 157 | | direction, |
| | 4 | 158 | | out Vector2d surfacePoint)) |
| | 2 | 159 | | return surfacePoint; |
| | | 160 | | |
| | 2 | 161 | | throw new InvalidOperationException("The closest capsule surface point is outside the Fixed64 coordinate domain. |
| | | 162 | | } |
| | | 163 | | |
| | | 164 | | internal Vector2d GetNormalFromCenteredAxis(Vector2d point) |
| | | 165 | | { |
| | 660 | 166 | | Vector2d direction = FixedSegment2d.GetDirectionFromCenteredAxis( |
| | 660 | 167 | | point, |
| | 660 | 168 | | Center, |
| | 660 | 169 | | Rotation, |
| | 660 | 170 | | AxisLength); |
| | 660 | 171 | | return direction != Vector2d.Zero |
| | 660 | 172 | | ? direction |
| | 660 | 173 | | : Rotate(Vector2d.Right, Rotation).Normalized; |
| | | 174 | | } |
| | | 175 | | |
| | | 176 | | internal bool TryGetSurfacePointFromCenteredAxis( |
| | | 177 | | Vector2d point, |
| | | 178 | | Vector2d normal, |
| | | 179 | | out Vector2d surfacePoint) => |
| | 2 | 180 | | TryGetSurfacePoint(point, normal, out surfacePoint); |
| | | 181 | | |
| | | 182 | | /// <inheritdoc/> |
| | | 183 | | public override Vector2d GetSupportPoint(Vector2d direction) |
| | | 184 | | { |
| | 13 | 185 | | if (TryGetSupportPoint(direction, out Vector2d support)) |
| | 12 | 186 | | return support; |
| | | 187 | | |
| | 1 | 188 | | throw new InvalidOperationException("The capsule support point is outside the Fixed64 coordinate domain."); |
| | | 189 | | } |
| | | 190 | | |
| | | 191 | | [MethodImpl(MethodImplOptions.AggressiveInlining)] |
| | | 192 | | internal bool TryGetSupportPoint(Vector2d direction, out Vector2d support) |
| | | 193 | | { |
| | 13 | 194 | | Vector2d supportDirection = direction == Vector2d.Zero |
| | 13 | 195 | | ? Rotate(Vector2d.Right, Rotation) |
| | 13 | 196 | | : direction; |
| | 13 | 197 | | return FixedSegment2d.TryGetCenteredCapsuleSupport( |
| | 13 | 198 | | Center, |
| | 13 | 199 | | Rotation, |
| | 13 | 200 | | AxisLength, |
| | 13 | 201 | | ScaledRadius, |
| | 13 | 202 | | supportDirection, |
| | 13 | 203 | | out support); |
| | | 204 | | } |
| | | 205 | | |
| | | 206 | | private bool TryGetSurfacePoint( |
| | | 207 | | Vector2d point, |
| | | 208 | | Vector2d worldNormal, |
| | | 209 | | out Vector2d surfacePoint) => |
| | 2 | 210 | | FixedSegment2d.TryGetSurfacePointOnCenteredCapsule( |
| | 2 | 211 | | point, |
| | 2 | 212 | | Center, |
| | 2 | 213 | | Rotation, |
| | 2 | 214 | | AxisLength, |
| | 2 | 215 | | ScaledRadius, |
| | 2 | 216 | | worldNormal, |
| | 2 | 217 | | out surfacePoint); |
| | | 218 | | |
| | | 219 | | internal override ExactMassWeight CalculateAreaForMassProperties() |
| | | 220 | | { |
| | 71 | 221 | | GetMassPropertyGeometry( |
| | 71 | 222 | | out Fixed64 radius, |
| | 71 | 223 | | out Fixed64 cylinderLength); |
| | 71 | 224 | | return GetRectangleWeight(radius, cylinderLength) |
| | 71 | 225 | | .Add(GetCircleWeight(radius)); |
| | | 226 | | } |
| | | 227 | | |
| | | 228 | | internal override ExactMassWeight CalculatePreparedAreaForMassProperties() => |
| | 43 | 229 | | GetRectangleWeight(_preparedRadius, _preparedAxisLength) |
| | 43 | 230 | | .Add(GetCircleWeight(_preparedRadius)); |
| | | 231 | | |
| | | 232 | | internal override Fixed64 CalculateCenterOfMassMoment(Fixed64 mass) |
| | | 233 | | { |
| | 1375 | 234 | | GetMassPropertyGeometry( |
| | 1375 | 235 | | out Fixed64 radius, |
| | 1375 | 236 | | out Fixed64 cylinderLength); |
| | 1375 | 237 | | return CalculateCenteredMoment(mass, radius, cylinderLength); |
| | | 238 | | } |
| | | 239 | | |
| | | 240 | | private protected override void PrepareShape(in ColliderShapeSnapshot2D snapshot) |
| | | 241 | | { |
| | 754 | 242 | | Fixed64 radiusX = ColliderScalePolicy.ScalePositive( |
| | 754 | 243 | | _radius, |
| | 754 | 244 | | snapshot.OwnerScale.X, |
| | 754 | 245 | | snapshot.PartScale.X); |
| | 754 | 246 | | Fixed64 radiusY = ColliderScalePolicy.ScalePositive( |
| | 754 | 247 | | _radius, |
| | 754 | 248 | | snapshot.OwnerScale.Y, |
| | 754 | 249 | | snapshot.PartScale.Y); |
| | 754 | 250 | | _preparedRadius = FixedMath.Max(radiusX, radiusY); |
| | 754 | 251 | | SwiftThrowHelper.ThrowIfArgument( |
| | 754 | 252 | | !HasValidScaledDimensions( |
| | 754 | 253 | | _radius, |
| | 754 | 254 | | _height, |
| | 754 | 255 | | snapshot.OwnerScale, |
| | 754 | 256 | | snapshot.PartScale), |
| | 754 | 257 | | nameof(snapshot), |
| | 754 | 258 | | "Scaled 2D capsule height must be at least the capsule diameter."); |
| | 752 | 259 | | SwiftThrowHelper.ThrowIfArgument( |
| | 752 | 260 | | !Fixed64.TryMultiplySubtractClamped( |
| | 752 | 261 | | _height, |
| | 752 | 262 | | snapshot.OwnerScale.Y, |
| | 752 | 263 | | snapshot.PartScale.Y, |
| | 752 | 264 | | Fixed64.One, |
| | 752 | 265 | | _radius, |
| | 752 | 266 | | Fixed64.Two, |
| | 752 | 267 | | snapshot.OwnerScale.X, |
| | 752 | 268 | | snapshot.PartScale.X, |
| | 752 | 269 | | out Fixed64 axisLengthX) |
| | 752 | 270 | | | !Fixed64.TryMultiplySubtractClamped( |
| | 752 | 271 | | _height, |
| | 752 | 272 | | snapshot.OwnerScale.Y, |
| | 752 | 273 | | snapshot.PartScale.Y, |
| | 752 | 274 | | Fixed64.One, |
| | 752 | 275 | | _radius, |
| | 752 | 276 | | Fixed64.Two, |
| | 752 | 277 | | snapshot.OwnerScale.Y, |
| | 752 | 278 | | snapshot.PartScale.Y, |
| | 752 | 279 | | out Fixed64 axisLengthY), |
| | 752 | 280 | | nameof(snapshot), |
| | 752 | 281 | | "Scaled 2D capsule center-axis length must be representable."); |
| | 752 | 282 | | _preparedAxisLength = FixedMath.Min(axisLengthX, axisLengthY); |
| | 752 | 283 | | _preparedAxis = Rotate(Vector2d.Forward, snapshot.Rotation).Normalized; |
| | 752 | 284 | | SetPreparedBounds(FixedBoundArea.FromCenteredRotatedCapsuleClippedToDomain( |
| | 752 | 285 | | snapshot.Center, |
| | 752 | 286 | | snapshot.Rotation, |
| | 752 | 287 | | _preparedAxisLength, |
| | 752 | 288 | | _preparedRadius)); |
| | 752 | 289 | | } |
| | | 290 | | |
| | | 291 | | private protected override void PublishShape() |
| | | 292 | | { |
| | 749 | 293 | | _scaledRadius = _preparedRadius; |
| | 749 | 294 | | _axisLength = _preparedAxisLength; |
| | 749 | 295 | | WorldAxis = _preparedAxis; |
| | 749 | 296 | | } |
| | | 297 | | |
| | | 298 | | /// <inheritdoc/> |
| | | 299 | | protected override void RecordShapeData(IChronicler chronicler) |
| | | 300 | | { |
| | 4 | 301 | | Fixed64 radius = _radius; |
| | 4 | 302 | | Fixed64 height = _height; |
| | 4 | 303 | | RecordValues.Look(chronicler, ref radius, "Radius", Fixed64.Half); |
| | 4 | 304 | | RecordValues.Look(chronicler, ref height, "Height", Fixed64.One); |
| | 4 | 305 | | if (chronicler.Mode == SerializationMode.Loading) |
| | | 306 | | { |
| | 2 | 307 | | ValidateDimensions(radius, height); |
| | 2 | 308 | | _radius = radius; |
| | 2 | 309 | | _height = height; |
| | | 310 | | } |
| | 4 | 311 | | } |
| | | 312 | | |
| | | 313 | | private void GetMassPropertyGeometry( |
| | | 314 | | out Fixed64 radius, |
| | | 315 | | out Fixed64 axisLength) |
| | | 316 | | { |
| | 8399 | 317 | | if (HasCommittedShape) |
| | | 318 | | { |
| | 5514 | 319 | | radius = _scaledRadius; |
| | 5514 | 320 | | axisLength = _axisLength; |
| | 5514 | 321 | | return; |
| | | 322 | | } |
| | | 323 | | |
| | 2885 | 324 | | GetCurrentScaleFactors( |
| | 2885 | 325 | | out Vector2d ownerScale, |
| | 2885 | 326 | | out Vector2d partScale); |
| | 2885 | 327 | | Fixed64 radiusX = ColliderScalePolicy.Scale( |
| | 2885 | 328 | | _radius, |
| | 2885 | 329 | | ownerScale.X, |
| | 2885 | 330 | | partScale.X); |
| | 2885 | 331 | | Fixed64 radiusY = ColliderScalePolicy.Scale( |
| | 2885 | 332 | | _radius, |
| | 2885 | 333 | | ownerScale.Y, |
| | 2885 | 334 | | partScale.Y); |
| | 2885 | 335 | | radius = FixedMath.Max(radiusX, radiusY); |
| | 2885 | 336 | | SwiftThrowHelper.ThrowIfTrue( |
| | 2885 | 337 | | !HasValidScaledDimensions( |
| | 2885 | 338 | | _radius, |
| | 2885 | 339 | | _height, |
| | 2885 | 340 | | ownerScale, |
| | 2885 | 341 | | partScale), |
| | 2885 | 342 | | nameof(CalculateAreaForMassProperties), |
| | 2885 | 343 | | "Scaled 2D capsule height must be at least the capsule diameter."); |
| | 2885 | 344 | | bool representable = Fixed64.TryMultiplySubtractClamped( |
| | 2885 | 345 | | _height, |
| | 2885 | 346 | | ownerScale.Y, |
| | 2885 | 347 | | partScale.Y, |
| | 2885 | 348 | | Fixed64.One, |
| | 2885 | 349 | | _radius, |
| | 2885 | 350 | | Fixed64.Two, |
| | 2885 | 351 | | ownerScale.X, |
| | 2885 | 352 | | partScale.X, |
| | 2885 | 353 | | out Fixed64 axisLengthX) |
| | 2885 | 354 | | & Fixed64.TryMultiplySubtractClamped( |
| | 2885 | 355 | | _height, |
| | 2885 | 356 | | ownerScale.Y, |
| | 2885 | 357 | | partScale.Y, |
| | 2885 | 358 | | Fixed64.One, |
| | 2885 | 359 | | _radius, |
| | 2885 | 360 | | Fixed64.Two, |
| | 2885 | 361 | | ownerScale.Y, |
| | 2885 | 362 | | partScale.Y, |
| | 2885 | 363 | | out Fixed64 axisLengthY); |
| | 2885 | 364 | | SwiftThrowHelper.ThrowIfTrue( |
| | 2885 | 365 | | !representable, |
| | 2885 | 366 | | nameof(CalculateAreaForMassProperties), |
| | 2885 | 367 | | "Scaled 2D capsule center-axis length must be representable."); |
| | 2885 | 368 | | axisLength = FixedMath.Min(axisLengthX, axisLengthY); |
| | 2885 | 369 | | } |
| | | 370 | | |
| | | 371 | | private static Fixed64 CalculateCenteredMoment(Fixed64 mass, Fixed64 radius, Fixed64 cylinderLength) |
| | | 372 | | { |
| | 1375 | 373 | | if (cylinderLength <= Fixed64.Epsilon) |
| | 50 | 374 | | return mass * radius * radius * Fixed64.Half; |
| | | 375 | | |
| | 1325 | 376 | | ExactMassWeight rectangleWeight = |
| | 1325 | 377 | | GetRectangleWeight(radius, cylinderLength); |
| | 1325 | 378 | | ExactMassWeight circleWeight = GetCircleWeight(radius); |
| | 1325 | 379 | | ExactMassWeight totalWeight = |
| | 1325 | 380 | | rectangleWeight.Add(circleWeight); |
| | 1325 | 381 | | if (totalWeight.IsZero) |
| | 7 | 382 | | return mass * cylinderLength * cylinderLength / (Fixed64)12; |
| | | 383 | | |
| | 1318 | 384 | | _ = rectangleWeight.TryGetProportionalShare( |
| | 1318 | 385 | | mass, |
| | 1318 | 386 | | totalWeight, |
| | 1318 | 387 | | out Fixed64 rectangleMass); |
| | 1318 | 388 | | Fixed64 capMass = (mass - rectangleMass) * Fixed64.Half; |
| | 1318 | 389 | | Fixed64 rectangleMoment = |
| | 1318 | 390 | | rectangleMass * ((radius * (Fixed64)2 * radius * (Fixed64)2) + (cylinderLength * cylinderLength)) / (Fixed64 |
| | | 391 | | |
| | | 392 | | // Semicircle centroid distance from its flat edge is 4r / (3pi). |
| | 1318 | 393 | | Fixed64 capCentroidOffset = (Fixed64)4 * radius / ((Fixed64)3 * Fixed64.Pi); |
| | 1318 | 394 | | Fixed64 capCenterDistance = cylinderLength * Fixed64.Half + capCentroidOffset; |
| | 1318 | 395 | | Fixed64 capCenteredFactor = |
| | 1318 | 396 | | Fixed64.One / (Fixed64)4 |
| | 1318 | 397 | | - (Fixed64)16 / ((Fixed64)9 * Fixed64.Pi * Fixed64.Pi); |
| | 1318 | 398 | | Fixed64 capMomentAboutOwnCentroid = capMass * radius * radius * capCenteredFactor; |
| | 1318 | 399 | | Fixed64 capMomentAboutCapsuleCenter = |
| | 1318 | 400 | | capMomentAboutOwnCentroid + capMass * capCenterDistance * capCenterDistance; |
| | | 401 | | |
| | 1318 | 402 | | return rectangleMoment + capMomentAboutCapsuleCenter * (Fixed64)2; |
| | | 403 | | } |
| | | 404 | | |
| | | 405 | | private static ExactMassWeight GetRectangleWeight( |
| | | 406 | | Fixed64 radius, |
| | | 407 | | Fixed64 cylinderLength) => |
| | 1439 | 408 | | ExactMassWeight.FromProduct( |
| | 1439 | 409 | | Fixed64.Two, |
| | 1439 | 410 | | radius, |
| | 1439 | 411 | | cylinderLength); |
| | | 412 | | |
| | | 413 | | private static ExactMassWeight GetCircleWeight(Fixed64 radius) => |
| | 1439 | 414 | | ExactMassWeight.FromProduct( |
| | 1439 | 415 | | Fixed64.Pi, |
| | 1439 | 416 | | radius, |
| | 1439 | 417 | | radius); |
| | | 418 | | |
| | | 419 | | [MethodImpl(MethodImplOptions.AggressiveInlining)] |
| | | 420 | | private static void ValidateDimensions(Fixed64 radius, Fixed64 height) |
| | | 421 | | { |
| | 746 | 422 | | SwiftThrowHelper.ThrowIfArgument(radius <= Fixed64.Zero, nameof(radius), "2D capsule radius must be greater than |
| | 745 | 423 | | SwiftThrowHelper.ThrowIfArgument( |
| | 745 | 424 | | Fixed64.CompareProducts( |
| | 745 | 425 | | height, |
| | 745 | 426 | | Fixed64.One, |
| | 745 | 427 | | radius, |
| | 745 | 428 | | Fixed64.Two) < 0, |
| | 745 | 429 | | nameof(height), |
| | 745 | 430 | | "2D capsule height must be at least the capsule diameter."); |
| | 742 | 431 | | } |
| | | 432 | | |
| | | 433 | | [MethodImpl(MethodImplOptions.AggressiveInlining)] |
| | | 434 | | private static bool HasValidScaledDimensions( |
| | | 435 | | Fixed64 radius, |
| | | 436 | | Fixed64 height, |
| | | 437 | | Vector2d ownerScale, |
| | | 438 | | Vector2d partScale) => |
| | 3639 | 439 | | Fixed64.CompareProducts( |
| | 3639 | 440 | | height, |
| | 3639 | 441 | | ownerScale.Y, |
| | 3639 | 442 | | partScale.Y, |
| | 3639 | 443 | | Fixed64.One, |
| | 3639 | 444 | | radius, |
| | 3639 | 445 | | Fixed64.Two, |
| | 3639 | 446 | | ownerScale.X, |
| | 3639 | 447 | | partScale.X) >= 0 |
| | 3639 | 448 | | & Fixed64.CompareProducts( |
| | 3639 | 449 | | height, |
| | 3639 | 450 | | ownerScale.Y, |
| | 3639 | 451 | | partScale.Y, |
| | 3639 | 452 | | Fixed64.One, |
| | 3639 | 453 | | radius, |
| | 3639 | 454 | | Fixed64.Two, |
| | 3639 | 455 | | ownerScale.Y, |
| | 3639 | 456 | | partScale.Y) >= 0; |
| | | 457 | | } |