| | | 1 | | //======================================================================= |
| | | 2 | | // ConvexShape.InitialMeshContact.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 System; |
| | | 9 | | using System.Diagnostics; |
| | | 10 | | using FixedMathSharp; |
| | | 11 | | using FixedMathSharp.Geometry; |
| | | 12 | | using Gravitas.Colliders; |
| | | 13 | | |
| | | 14 | | namespace Gravitas.Queries; |
| | | 15 | | |
| | | 16 | | /// <content>Resolves initial mesh contact witnesses from the selected convex source leaf.</content> |
| | | 17 | | internal readonly partial struct ConvexShape |
| | | 18 | | { |
| | | 19 | | // Both views describe their initial committed poses. Compound reduction |
| | | 20 | | // must call this while the actual source and target leaves are retained. |
| | | 21 | | internal bool TryGetInitialMeshContactNormal( |
| | | 22 | | in ConvexShape source, |
| | | 23 | | bool allowHullFaceExit, |
| | | 24 | | out FixedPointAnchor targetAnchor, |
| | | 25 | | out Vector3d normal) |
| | | 26 | | { |
| | | 27 | | Debug.Assert(_offset == Vector3d.Zero && source._offset == Vector3d.Zero); |
| | | 28 | | FixedContactAnchors contact; |
| | 1828 | 29 | | if (_kind == ConvexShapeKind.Triangle) |
| | | 30 | | { |
| | 828 | 31 | | if (TryGetInitialMeshFaceContactNormal(source, out targetAnchor, out normal)) |
| | 786 | 32 | | return true; |
| | 42 | 33 | | bool found = TryGetInitialTriangleContact(source, |
| | 42 | 34 | | new FixedTriangle(_triangleA, _triangleB, _triangleC), out contact); |
| | 42 | 35 | | targetAnchor = contact.FirstAnchor; |
| | 42 | 36 | | normal = contact.Normal; |
| | 42 | 37 | | return found; |
| | | 38 | | } |
| | | 39 | | |
| | 1000 | 40 | | var mesh = (LSMeshCollider)_collider!; |
| | 1000 | 41 | | PhysicsMesh hull = mesh.Mesh; |
| | | 42 | | bool hasContact; |
| | 1000 | 43 | | switch (source._collider) |
| | | 44 | | { |
| | | 45 | | case LSCuboidCollider box: |
| | 938 | 46 | | hasContact = WideOrientedBox.TryGetConvexHullContact( |
| | 938 | 47 | | box.Center, box.Rotation, box.OrientedBox.HalfExtents, |
| | 938 | 48 | | hull.GeometryFrame, hull.Origin, hull.GeometryVertices, |
| | 938 | 49 | | hull.Triangles, hull.ConvexSatEdgeVertexPairs, out contact); |
| | 938 | 50 | | targetAnchor = contact.SecondAnchor; |
| | 938 | 51 | | normal = -contact.Normal; |
| | 938 | 52 | | return hasContact; |
| | | 53 | | case LSCapsuleCollider capsule: |
| | 10 | 54 | | hasContact = TryGetHullCapsuleContact(hull, capsule.Center, |
| | 10 | 55 | | capsule.Rotation, capsule.AxisLength, capsule.ScaledRadius, out contact); |
| | 10 | 56 | | break; |
| | | 57 | | case LSSphereCollider sphere: |
| | 8 | 58 | | hasContact = TryGetHullCapsuleContact(hull, sphere.Center, |
| | 8 | 59 | | sphere.Rotation, Fixed64.Zero, sphere.ScaledRadius, out contact); |
| | 8 | 60 | | break; |
| | | 61 | | case LSMeshCollider sourceMesh: |
| | 10 | 62 | | PhysicsMesh sourceHull = sourceMesh.Mesh; |
| | 10 | 63 | | hasContact = hull.GeometryFrame.IsRigid && sourceHull.GeometryFrame.IsRigid |
| | 10 | 64 | | ? FixedConvexHullRelations.TryGetContact(hull.Origin, hull.Rotation, hull.GeometryVertices, |
| | 10 | 65 | | hull.Triangles, hull.ConvexSatEdgeVertexPairs, sourceHull.Origin, sourceHull.Rotation, |
| | 10 | 66 | | sourceHull.GeometryVertices, sourceHull.Triangles, sourceHull.ConvexSatEdgeVertexPairs, out cont |
| | 10 | 67 | | : WideOrientedBox.TryGetConvexHullContact(hull.GeometryFrame, hull.Origin, hull.GeometryVertices, |
| | 10 | 68 | | hull.Triangles, hull.ConvexSatEdgeVertexPairs, sourceHull.GeometryFrame, sourceHull.Origin, |
| | 10 | 69 | | sourceHull.GeometryVertices, sourceHull.Triangles, sourceHull.ConvexSatEdgeVertexPairs, out cont |
| | 10 | 70 | | break; |
| | | 71 | | default: |
| | 34 | 72 | | if (source._kind == ConvexShapeKind.Sphere) |
| | | 73 | | { |
| | 7 | 74 | | hasContact = TryGetHullCapsuleContact(hull, source._center, |
| | 7 | 75 | | FixedQuaternion.Identity, Fixed64.Zero, source._radius, out contact); |
| | 7 | 76 | | break; |
| | | 77 | | } |
| | | 78 | | // A hull face exit alone cannot certify a tolerant, disjoint contact. |
| | 27 | 79 | | if (!allowHullFaceExit) |
| | | 80 | | { |
| | 2 | 81 | | targetAnchor = default; |
| | 2 | 82 | | normal = default; |
| | 2 | 83 | | return false; |
| | | 84 | | } |
| | 25 | 85 | | GetInitialHullFaceExit(source, hull, out targetAnchor, out normal); |
| | 25 | 86 | | return true; |
| | | 87 | | } |
| | 35 | 88 | | targetAnchor = contact.FirstAnchor; |
| | 35 | 89 | | normal = contact.Normal; |
| | 35 | 90 | | return hasContact; |
| | | 91 | | } |
| | | 92 | | |
| | | 93 | | /// <summary>Certifies a positive finite face contact before reducing covered triangle witnesses.</summary> |
| | | 94 | | internal bool TryGetInitialMeshFaceContactNormal(in ConvexShape source, |
| | | 95 | | out FixedPointAnchor targetAnchor, out Vector3d normal) |
| | | 96 | | { |
| | 829 | 97 | | targetAnchor = default; |
| | 829 | 98 | | normal = default; |
| | | 99 | | Debug.Assert(_kind == ConvexShapeKind.Triangle); |
| | 829 | 100 | | PhysicsMesh mesh = _triangleOwner!.Mesh; |
| | 829 | 101 | | Vector3d planeNormal = GetInitialExitNormal(source, mesh.GetFaceNormalWorld(_triangleIndex)); |
| | 829 | 102 | | FixedPointAnchor support = source.GetSupportAnchor(-planeNormal); |
| | 829 | 103 | | var triangle = new FixedTriangle(_triangleA, _triangleB, _triangleC); |
| | 829 | 104 | | if (!TryGetInitialSurfaceProjectionTriangle(mesh, support, ref triangle) |
| | 829 | 105 | | || !TryGetInitialTriangleContact(source, triangle, out FixedContactAnchors contact)) |
| | 37 | 106 | | return false; |
| | | 107 | | |
| | | 108 | | // A finite neighboring face must actually contact the source; projection |
| | | 109 | | // alone is insufficient for tilted shapes, and a perimeter touch stays radial. |
| | 792 | 110 | | var matched = new ConvexShape(_triangleOwner!, _triangleIndex, triangle.A, triangle.B, triangle.C); |
| | 792 | 111 | | FixedPointAnchor targetSupport = matched.GetSupportAnchor(contact.Normal); |
| | 792 | 112 | | FixedPointAnchor sourceSupport = source.GetSupportAnchor(-contact.Normal); |
| | 792 | 113 | | if (WidePointAnchor3d.CompareProjectedOffsets(targetSupport, sourceSupport, |
| | 792 | 114 | | targetSupport, targetSupport, contact.Normal) <= 0) |
| | 6 | 115 | | return false; |
| | 786 | 116 | | if (mesh.GeometryFrame.IsRigid) |
| | 778 | 117 | | targetAnchor = triangle.GetClosestPointAnchor(mesh.Origin, mesh.Rotation, support); |
| | | 118 | | else |
| | | 119 | | { |
| | | 120 | | // TryGetInitialSurfaceProjectionTriangle already certified this |
| | | 121 | | // finite projection, whose mesh-center offset is reach-bounded. |
| | 8 | 122 | | bool represented = WideTriangleRelations.TryGetProjectedPointAnchor(triangle, mesh.GeometryFrame, |
| | 8 | 123 | | RationalPoint3d.FromAnchor(support), mesh.Origin, out targetAnchor); |
| | | 124 | | Debug.Assert(represented); |
| | | 125 | | } |
| | 786 | 126 | | normal = planeNormal; |
| | 786 | 127 | | return true; |
| | | 128 | | } |
| | | 129 | | |
| | | 130 | | private bool TryGetInitialSurfaceProjectionTriangle( |
| | | 131 | | PhysicsMesh mesh, in FixedPointAnchor support, ref FixedTriangle triangle) |
| | | 132 | | { |
| | 829 | 133 | | if (ContainsInitialProjection(mesh, triangle, support)) |
| | 716 | 134 | | return true; |
| | 113 | 135 | | if (mesh.GetCoplanarTriangleNeighbors(_triangleIndex).IsEmpty) |
| | 8 | 136 | | return false; |
| | | 137 | | |
| | 105 | 138 | | ReadOnlySpan<int> corners = mesh.GetConvexCoplanarPatchCornerVertexIndices(_triangleIndex); |
| | 105 | 139 | | if (!corners.IsEmpty) |
| | | 140 | | { |
| | | 141 | | // The prepared convex fill removes subdivision cost without filling holes or notches. |
| | 95 | 142 | | ReadOnlySpan<Vector3d> vertices = mesh.GeometryVertices; |
| | 292 | 143 | | for (int corner = 1; corner < corners.Length - 1; corner++) |
| | | 144 | | { |
| | 125 | 145 | | triangle = new FixedTriangle(vertices[corners[0]], vertices[corners[corner]], |
| | 125 | 146 | | vertices[corners[corner + 1]]); |
| | 125 | 147 | | if (ContainsInitialProjection(mesh, triangle, support)) |
| | 74 | 148 | | return true; |
| | | 149 | | } |
| | 21 | 150 | | return false; |
| | | 151 | | } |
| | | 152 | | |
| | 10 | 153 | | int owner = mesh.GetManifoldSurfaceOwner(_triangleIndex); |
| | 170 | 154 | | for (int index = 0; index < mesh.TriangleCount; index++) |
| | | 155 | | { |
| | 78 | 156 | | if (index == _triangleIndex || mesh.GetManifoldSurfaceOwner(index) != owner) |
| | | 157 | | continue; |
| | 67 | 158 | | mesh.GetGeometryTriangleVertices(index, out Vector3d a, out Vector3d b, out Vector3d c); |
| | 67 | 159 | | triangle = new FixedTriangle(a, b, c); |
| | 67 | 160 | | if (ContainsInitialProjection(mesh, triangle, support)) |
| | 3 | 161 | | return true; |
| | | 162 | | } |
| | 7 | 163 | | return false; |
| | | 164 | | } |
| | | 165 | | |
| | | 166 | | private static bool ContainsInitialProjection(PhysicsMesh mesh, in FixedTriangle triangle, |
| | 1021 | 167 | | in FixedPointAnchor support) => mesh.GeometryFrame.IsRigid |
| | 1021 | 168 | | ? WideTriangleRelations.ContainsProjection(triangle, mesh.Origin, mesh.Rotation, support) |
| | 1021 | 169 | | : WideTriangleRelations.ContainsProjection(triangle, mesh.GeometryFrame, RationalPoint3d.FromAnchor(support)); |
| | | 170 | | |
| | | 171 | | private bool TryGetInitialTriangleContact(in ConvexShape source, FixedTriangle triangle, |
| | | 172 | | out FixedContactAnchors contact) |
| | | 173 | | { |
| | 835 | 174 | | PhysicsMesh targetMesh = _triangleOwner!.Mesh; |
| | 835 | 175 | | if (!targetMesh.GeometryFrame.IsRigid |
| | 835 | 176 | | || source._collider is LSMeshCollider sourceMesh && !sourceMesh.Mesh.GeometryFrame.IsRigid) |
| | 8 | 177 | | return TryGetInitialScaledTriangleContact(source, triangle, targetMesh, out contact); |
| | 827 | 178 | | if (source._kind == ConvexShapeKind.Sphere) |
| | 3 | 179 | | return triangle.TryGetSphereContact(targetMesh.Origin, targetMesh.Rotation, |
| | 3 | 180 | | source._center, FixedQuaternion.Identity, source._radius, out contact); |
| | 824 | 181 | | if (source._kind == ConvexShapeKind.CircleSlab) |
| | 6 | 182 | | return triangle.TryGetCircleSlabContact(targetMesh.Origin, targetMesh.Rotation, |
| | 6 | 183 | | source._center, Fixed64.Zero, source._halfHeight, source._radius, out contact); |
| | | 184 | | |
| | 818 | 185 | | switch (source._collider) |
| | | 186 | | { |
| | | 187 | | case LSSphereCollider sphere: |
| | 6 | 188 | | return triangle.TryGetSphereContact(targetMesh.Origin, targetMesh.Rotation, |
| | 6 | 189 | | sphere.Center, sphere.Rotation, sphere.ScaledRadius, out contact); |
| | | 190 | | case LSCapsuleCollider capsule: |
| | 253 | 191 | | Vector3d fallback = GetInitialExitNormal(source, |
| | 253 | 192 | | targetMesh.GetFaceNormalWorld(_triangleIndex)); |
| | 253 | 193 | | return triangle.TryGetCenteredCapsuleContact(targetMesh.Origin, targetMesh.Rotation, |
| | 253 | 194 | | capsule.Center, capsule.Rotation, capsule.AxisLength, capsule.ScaledRadius, |
| | 253 | 195 | | fallback, out contact); |
| | | 196 | | case LSCuboidCollider box: |
| | 514 | 197 | | bool found = box.OrientedBox.TryGetTriangleContact(targetMesh.Origin, |
| | 514 | 198 | | targetMesh.Rotation, triangle, out FixedContactAnchors reversed); |
| | 514 | 199 | | contact = new FixedContactAnchors(reversed.SecondAnchor, reversed.FirstAnchor, |
| | 514 | 200 | | -reversed.Normal, reversed.Depth, reversed.DepthIsClamped); |
| | 514 | 201 | | return found; |
| | | 202 | | case LSCylinderCollider cylinder: |
| | 19 | 203 | | return triangle.TryGetCenteredFiniteCylinderContact(targetMesh.Origin, targetMesh.Rotation, |
| | 19 | 204 | | cylinder.Center, cylinder.Rotation, cylinder.Height, cylinder.ScaledRadius, out contact); |
| | | 205 | | case LSConeCollider cone: |
| | 20 | 206 | | return triangle.TryGetCenteredFiniteConeContact(targetMesh.Origin, targetMesh.Rotation, |
| | 20 | 207 | | cone.Center, cone.Rotation, cone.Height, cone.ScaledRadius, out contact); |
| | | 208 | | default: |
| | 6 | 209 | | var mesh = (LSMeshCollider)source._collider!; |
| | 6 | 210 | | PhysicsMesh sourceHull = mesh.Mesh; |
| | 6 | 211 | | ReadOnlySpan<Vector3d> vertices = stackalloc Vector3d[3] |
| | 6 | 212 | | { triangle.A, triangle.B, triangle.C }; |
| | 6 | 213 | | ReadOnlySpan<int> triangles = stackalloc int[3] { 0, 1, 2 }; |
| | 6 | 214 | | ReadOnlySpan<int> edges = stackalloc int[6] { 0, 1, 1, 2, 2, 0 }; |
| | 6 | 215 | | return FixedConvexHullRelations.TryGetContact( |
| | 6 | 216 | | targetMesh.Origin, targetMesh.Rotation, vertices, triangles, edges, |
| | 6 | 217 | | sourceHull.Origin, sourceHull.Rotation, sourceHull.GeometryVertices, |
| | 6 | 218 | | sourceHull.Triangles, sourceHull.ConvexSatEdgeVertexPairs, out contact); |
| | | 219 | | } |
| | | 220 | | } |
| | | 221 | | |
| | | 222 | | private bool TryGetInitialScaledTriangleContact(in ConvexShape source, in FixedTriangle triangle, |
| | | 223 | | PhysicsMesh mesh, out FixedContactAnchors contact) |
| | | 224 | | { |
| | 8 | 225 | | Vector3d fallback = GetInitialExitNormal(source, mesh.GetFaceNormalWorld(_triangleIndex)); |
| | 8 | 226 | | if (source._kind == ConvexShapeKind.Sphere) |
| | 1 | 227 | | return triangle.TryGetCenteredCapsuleContact(mesh.GeometryFrame, source._center, |
| | 1 | 228 | | FixedQuaternion.Identity, Fixed64.Zero, source._radius, fallback, out contact, out _, out _); |
| | 7 | 229 | | if (source._kind == ConvexShapeKind.CircleSlab) |
| | 1 | 230 | | return TriangleCylinderContact.TryGetContact(triangle, mesh.GeometryFrame, source._center, |
| | 1 | 231 | | FixedQuaternion.Identity, WideArithmetic.AddSigned192(Signed192.Raw(source._halfHeight), |
| | 1 | 232 | | Signed192.Raw(source._halfHeight)), source._radius, out contact, out _); |
| | 6 | 233 | | switch (source._collider) |
| | | 234 | | { |
| | | 235 | | case LSSphereCollider sphere: |
| | 1 | 236 | | return triangle.TryGetCenteredCapsuleContact(mesh.GeometryFrame, sphere.Center, sphere.Rotation, |
| | 1 | 237 | | Fixed64.Zero, sphere.ScaledRadius, fallback, out contact, out _, out _); |
| | | 238 | | case LSCapsuleCollider capsule: |
| | 1 | 239 | | return triangle.TryGetCenteredCapsuleContact(mesh.GeometryFrame, capsule.Center, capsule.Rotation, |
| | 1 | 240 | | capsule.AxisLength, capsule.ScaledRadius, fallback, out contact, out _, out _); |
| | | 241 | | case LSCuboidCollider box: |
| | 1 | 242 | | ReadOnlySpan<Vector3d> points = stackalloc Vector3d[3] { triangle.A, triangle.B, triangle.C }; |
| | 1 | 243 | | ReadOnlySpan<int> triangles = stackalloc int[3] { 0, 1, 2 }; |
| | 1 | 244 | | ReadOnlySpan<int> edges = stackalloc int[6] { 0, 1, 1, 2, 2, 0 }; |
| | 1 | 245 | | bool found = WideOrientedBox.TryGetConvexHullContact(box.Center, box.Rotation, box.OrientedBox.HalfExten |
| | 1 | 246 | | mesh.GeometryFrame, mesh.Origin, points, triangles, edges, out FixedContactAnchors reversed); |
| | 1 | 247 | | contact = new FixedContactAnchors(reversed.SecondAnchor, reversed.FirstAnchor, -reversed.Normal, |
| | 1 | 248 | | reversed.Depth, reversed.DepthIsClamped); |
| | 1 | 249 | | return found; |
| | | 250 | | case LSCylinderCollider cylinder: |
| | 1 | 251 | | return TriangleCylinderContact.TryGetContact(triangle, mesh.GeometryFrame, cylinder.Center, |
| | 1 | 252 | | cylinder.Rotation, Signed192.Raw(cylinder.Height), cylinder.ScaledRadius, out contact, out _); |
| | | 253 | | case LSConeCollider cone: |
| | 1 | 254 | | return TriangleConeContact.TryGetContact(triangle, mesh.GeometryFrame, cone.Center, |
| | 1 | 255 | | cone.Rotation, cone.Height, cone.ScaledRadius, out contact); |
| | | 256 | | default: |
| | 1 | 257 | | PhysicsMesh sourceHull = ((LSMeshCollider)source._collider!).Mesh; |
| | 1 | 258 | | ReadOnlySpan<Vector3d> targetPoints = stackalloc Vector3d[3] { triangle.A, triangle.B, triangle.C }; |
| | 1 | 259 | | ReadOnlySpan<int> targetTriangles = stackalloc int[3] { 0, 1, 2 }; |
| | 1 | 260 | | ReadOnlySpan<int> targetEdges = stackalloc int[6] { 0, 1, 1, 2, 2, 0 }; |
| | 1 | 261 | | return WideOrientedBox.TryGetConvexHullContact(mesh.GeometryFrame, mesh.Origin, targetPoints, |
| | 1 | 262 | | targetTriangles, targetEdges, sourceHull.GeometryFrame, sourceHull.Origin, |
| | 1 | 263 | | sourceHull.GeometryVertices, sourceHull.Triangles, sourceHull.ConvexSatEdgeVertexPairs, out contact) |
| | | 264 | | } |
| | | 265 | | } |
| | | 266 | | |
| | | 267 | | internal Vector3d GetInitialExitNormal(in ConvexShape source, Vector3d axis) |
| | | 268 | | { |
| | 3432 | 269 | | FixedPointAnchor targetMax = GetSupportAnchor(axis); |
| | 3432 | 270 | | FixedPointAnchor sourceMin = source.GetSupportAnchor(-axis); |
| | 3432 | 271 | | FixedPointAnchor sourceMax = source.GetSupportAnchor(axis); |
| | 3432 | 272 | | FixedPointAnchor targetMin = GetSupportAnchor(-axis); |
| | 3432 | 273 | | return WidePointAnchor3d.CompareProjectedOffsets( |
| | 3432 | 274 | | targetMax, sourceMin, sourceMax, targetMin, axis) <= 0 ? axis : -axis; |
| | | 275 | | } |
| | | 276 | | |
| | | 277 | | private void GetInitialHullFaceExit(in ConvexShape source, PhysicsMesh hull, |
| | | 278 | | out FixedPointAnchor targetAnchor, out Vector3d normal) |
| | | 279 | | { |
| | | 280 | | // A two-sided triangle MTV does not describe exit from a solid hull. |
| | | 281 | | // Rank full-shape exit projections on the cached unit face axes. This |
| | | 282 | | // preserves hull containment and authored ties without claiming a |
| | | 283 | | // complete curved-shape/hull MTV (edge axes can provide shorter exits). |
| | | 284 | | // Committed mesh topology has at least one nondegenerate triangle; |
| | | 285 | | // scale validation preserves nonzero cached face normals. |
| | 25 | 286 | | normal = GetInitialExitNormal(source, hull.GetFaceNormalWorld(0)); |
| | 25 | 287 | | targetAnchor = GetSupportAnchor(normal); |
| | 25 | 288 | | FixedPointAnchor selectedSource = source.GetSupportAnchor(-normal); |
| | 600 | 289 | | for (int index = 1; index < hull.TriangleCount; index++) |
| | | 290 | | { |
| | 275 | 291 | | Vector3d axis = hull.GetFaceNormalWorld(index); |
| | | 292 | | Debug.Assert(axis != Vector3d.Zero); |
| | 275 | 293 | | axis = GetInitialExitNormal(source, axis); |
| | 275 | 294 | | FixedPointAnchor targetSupport = GetSupportAnchor(axis); |
| | 275 | 295 | | FixedPointAnchor sourceSupport = source.GetSupportAnchor(-axis); |
| | 275 | 296 | | if (WidePointAnchor3d.CompareProjectedOffsets( |
| | 275 | 297 | | targetSupport, sourceSupport, targetAnchor, selectedSource, |
| | 275 | 298 | | axis, normal) >= 0) |
| | | 299 | | continue; |
| | 21 | 300 | | normal = axis; |
| | 21 | 301 | | targetAnchor = targetSupport; |
| | 21 | 302 | | selectedSource = sourceSupport; |
| | | 303 | | } |
| | 25 | 304 | | } |
| | | 305 | | |
| | | 306 | | private static bool TryGetHullCapsuleContact(PhysicsMesh hull, Vector3d center, |
| | | 307 | | FixedQuaternion rotation, Fixed64 axisLength, Fixed64 radius, out FixedContactAnchors contact) => |
| | 25 | 308 | | WideOrientedBox.TryGetConvexHullCenteredCapsuleContact( |
| | 25 | 309 | | hull.GeometryFrame, hull.Origin, hull.GeometryVertices, |
| | 25 | 310 | | hull.Triangles, hull.ConvexSatEdgeVertexPairs, |
| | 25 | 311 | | center, rotation, Vector3d.Up, axisLength, radius, out contact); |
| | | 312 | | } |