SharedNarrowSolver
Package: Libraries.Game.Collision.Narrowphase · Inherits from: Libraries.Language.Object
Actions
CollideBoxTriangle(Libraries.Game.Collision.LocalCollisionPoints3D collisionPoints, Libraries.Game.Collision.Shapes.Box box, Libraries.Game.Collision.PhysicsPosition3D boxTransform, Libraries.Game.Collision.Shapes.Triangle triangle, Libraries.Game.Collision.PhysicsPosition3D triangleTransform, Libraries.Game.Collision.CollisionPointsResult3D result)
This action collides a box item with a single triangle item, where the box is item A of the collision and the triangle is item B. It uses the box's triangle collider, which finds up to four contacts, such as one under each bottom corner of a box lying flat on the triangle. The collision's points are refreshed afterward.
Parameters
collisionPointsLibraries.Game.Collision.LocalCollisionPoints3D: The collision's stored contact points.boxLibraries.Game.Collision.Shapes.Box: The box, which is item A.boxTransformLibraries.Game.Collision.PhysicsPosition3D: Where the box is in the world. Its origin is the box's center.triangleLibraries.Game.Collision.Shapes.Triangle: The triangle, which is item B, with its corners in its own space.triangleTransformLibraries.Game.Collision.PhysicsPosition3D: Where the triangle is in the world.resultLibraries.Game.Collision.CollisionPointsResult3D: Where contacts are reported. It must already be initialized with the box's item as item A and the triangle's item as item B.
CollideBoxes(Libraries.Game.Collision.LocalCollisionPoints3D collisionPoints, Libraries.Game.Collision.Shapes.Box itemA, Libraries.Game.Collision.PhysicsPosition3D transformA, Libraries.Game.Collision.Shapes.Box itemB, Libraries.Game.Collision.PhysicsPosition3D transformB, Libraries.Game.Collision.CollisionPointsResult3D result)
Parameters
collisionPointsLibraries.Game.Collision.LocalCollisionPoints3DitemALibraries.Game.Collision.Shapes.BoxtransformALibraries.Game.Collision.PhysicsPosition3DitemBLibraries.Game.Collision.Shapes.BoxtransformBLibraries.Game.Collision.PhysicsPosition3DresultLibraries.Game.Collision.CollisionPointsResult3D
CollideConvexConvex(Libraries.Game.Collision.LocalCollisionPoints3D collisionPoints, Libraries.Game.Collision.Shapes.CollisionShape3D itemA, Libraries.Game.Collision.PhysicsPosition3D transformA, Libraries.Game.Collision.Shapes.CollisionShape3D itemB, Libraries.Game.Collision.PhysicsPosition3D transformB, Libraries.Game.Collision.CollisionPointsResult3D result)
Parameters
collisionPointsLibraries.Game.Collision.LocalCollisionPoints3DitemALibraries.Game.Collision.Shapes.CollisionShape3DtransformALibraries.Game.Collision.PhysicsPosition3DitemBLibraries.Game.Collision.Shapes.CollisionShape3DtransformBLibraries.Game.Collision.PhysicsPosition3DresultLibraries.Game.Collision.CollisionPointsResult3D
CollideCylinderTriangle(Libraries.Game.Collision.LocalCollisionPoints3D collisionPoints, Libraries.Game.Collision.Shapes.Cylinder cylinder, Libraries.Game.Collision.PhysicsPosition3D cylinderTransform, Libraries.Game.Collision.Shapes.Triangle triangle, Libraries.Game.Collision.PhysicsPosition3D triangleTransform, Libraries.Game.Collision.CollisionPointsResult3D result)
This action collides a cylinder item with a single triangle item, where the cylinder is item A of the collision and the triangle is item B. It uses the cylinder's triangle collider, which finds up to four contacts for a cylinder standing on a cap, up to two for one lying on its side, and hands any other case to the general collision test, which finds one. The collision's points are refreshed afterward.
Parameters
collisionPointsLibraries.Game.Collision.LocalCollisionPoints3D: The collision's stored contact points.cylinderLibraries.Game.Collision.Shapes.Cylinder: The cylinder, which is item A.cylinderTransformLibraries.Game.Collision.PhysicsPosition3D: Where the cylinder is in the world. Its origin is the cylinder's center.triangleLibraries.Game.Collision.Shapes.Triangle: The triangle, which is item B, with its corners in its own space.triangleTransformLibraries.Game.Collision.PhysicsPosition3D: Where the triangle is in the world.resultLibraries.Game.Collision.CollisionPointsResult3D: Where contacts are reported. It must already be initialized with the cylinder's item as item A and the triangle's item as item B.
CollideSphereTriangle(Libraries.Game.Collision.LocalCollisionPoints3D collisionPoints, Libraries.Game.Collision.Shapes.Sphere sphere, Libraries.Game.Collision.PhysicsPosition3D sphereTransform, Libraries.Game.Collision.Shapes.Triangle triangle, Libraries.Game.Collision.PhysicsPosition3D triangleTransform, Libraries.Game.Collision.CollisionPointsResult3D result)
This action collides a sphere item with a single triangle item, where the sphere is item A of the collision and the triangle is item B. It uses the sphere's triangle collider, which finds at most one contact, at the point on the triangle closest to the sphere's center. The collision's points are refreshed afterward.
Parameters
collisionPointsLibraries.Game.Collision.LocalCollisionPoints3D: The collision's stored contact points.sphereLibraries.Game.Collision.Shapes.Sphere: The sphere, which is item A.sphereTransformLibraries.Game.Collision.PhysicsPosition3D: Where the sphere is in the world. Its origin is the sphere's center.triangleLibraries.Game.Collision.Shapes.Triangle: The triangle, which is item B, with its corners in its own space.triangleTransformLibraries.Game.Collision.PhysicsPosition3D: Where the triangle is in the world.resultLibraries.Game.Collision.CollisionPointsResult3D: Where contacts are reported. It must already be initialized with the sphere's item as item A and the triangle's item as item B.
CollideSpheres(Libraries.Game.Collision.LocalCollisionPoints3D collisionPoints, Libraries.Game.Collision.Shapes.Sphere itemA, Libraries.Game.Collision.PhysicsPosition3D transformA, Libraries.Game.Collision.Shapes.Sphere itemB, Libraries.Game.Collision.PhysicsPosition3D transformB, Libraries.Game.Collision.CollisionPointsResult3D result)
Parameters
collisionPointsLibraries.Game.Collision.LocalCollisionPoints3DitemALibraries.Game.Collision.Shapes.SpheretransformALibraries.Game.Collision.PhysicsPosition3DitemBLibraries.Game.Collision.Shapes.SpheretransformBLibraries.Game.Collision.PhysicsPosition3DresultLibraries.Game.Collision.CollisionPointsResult3D
CollideTriangle(Libraries.Game.Collision.LocalCollisionPoints3D collisionPoints, Libraries.Game.Collision.Shapes.Triangle triangle, Libraries.Game.Collision.PhysicsPosition3D triangleTransform, Libraries.Game.Collision.Shapes.CollisionShape3D shape, Libraries.Game.Collision.PhysicsPosition3D shapeTransform, Libraries.Game.Collision.CollisionPointsResult3D result)
This action tests any shape against a single triangle, with the triangle as item A of the collision. Spheres, boxes and cylinders use their own triangle colliders, and any other shape uses the general collision test. It does not refresh the collision's points. A concave shape, such as terrain, calls it once for each of its triangles that the shape might touch, then calls RefreshCollisionPoints on the result once at the end.
Parameters
collisionPointsLibraries.Game.Collision.LocalCollisionPoints3D: The collision's stored contact points.triangleLibraries.Game.Collision.Shapes.Triangle: The triangle, with its corners in its own space.triangleTransformLibraries.Game.Collision.PhysicsPosition3D: Where the triangle is in the world.shapeLibraries.Game.Collision.Shapes.CollisionShape3D: The other shape.shapeTransformLibraries.Game.Collision.PhysicsPosition3D: Where the other shape is in the world.resultLibraries.Game.Collision.CollisionPointsResult3D: Where contacts are reported. It must already be initialized with the triangle's item as item A.
CollideTriangleBox(Libraries.Game.Collision.LocalCollisionPoints3D collisionPoints, Libraries.Game.Collision.Shapes.Triangle triangle, Libraries.Game.Collision.PhysicsPosition3D triangleTransform, Libraries.Game.Collision.Shapes.Box box, Libraries.Game.Collision.PhysicsPosition3D boxTransform, Libraries.Game.Collision.CollisionPointsResult3D result)
This action collides a single triangle item with a box item, where the triangle is item A of the collision and the box is item B. It uses the box's triangle collider, which finds up to four contacts, such as one under each bottom corner of a box lying flat on the triangle. The collision's points are refreshed afterward.
Parameters
collisionPointsLibraries.Game.Collision.LocalCollisionPoints3D: The collision's stored contact points.triangleLibraries.Game.Collision.Shapes.Triangle: The triangle, which is item A, with its corners in its own space.triangleTransformLibraries.Game.Collision.PhysicsPosition3D: Where the triangle is in the world.boxLibraries.Game.Collision.Shapes.Box: The box, which is item B.boxTransformLibraries.Game.Collision.PhysicsPosition3D: Where the box is in the world. Its origin is the box's center.resultLibraries.Game.Collision.CollisionPointsResult3D: Where contacts are reported. It must already be initialized with the triangle's item as item A and the box's item as item B.
CollideTriangleCylinder(Libraries.Game.Collision.LocalCollisionPoints3D collisionPoints, Libraries.Game.Collision.Shapes.Triangle triangle, Libraries.Game.Collision.PhysicsPosition3D triangleTransform, Libraries.Game.Collision.Shapes.Cylinder cylinder, Libraries.Game.Collision.PhysicsPosition3D cylinderTransform, Libraries.Game.Collision.CollisionPointsResult3D result)
This action collides a single triangle item with a cylinder item, where the triangle is item A of the collision and the cylinder is item B. It uses the cylinder's triangle collider, which finds up to four contacts for a cylinder standing on a cap, up to two for one lying on its side, and hands any other case to the general collision test, which finds one. The collision's points are refreshed afterward.
Parameters
collisionPointsLibraries.Game.Collision.LocalCollisionPoints3D: The collision's stored contact points.triangleLibraries.Game.Collision.Shapes.Triangle: The triangle, which is item A, with its corners in its own space.triangleTransformLibraries.Game.Collision.PhysicsPosition3D: Where the triangle is in the world.cylinderLibraries.Game.Collision.Shapes.Cylinder: The cylinder, which is item B.cylinderTransformLibraries.Game.Collision.PhysicsPosition3D: Where the cylinder is in the world. Its origin is the cylinder's center.resultLibraries.Game.Collision.CollisionPointsResult3D: Where contacts are reported. It must already be initialized with the triangle's item as item A and the cylinder's item as item B.
CollideTriangleSphere(Libraries.Game.Collision.LocalCollisionPoints3D collisionPoints, Libraries.Game.Collision.Shapes.Triangle triangle, Libraries.Game.Collision.PhysicsPosition3D triangleTransform, Libraries.Game.Collision.Shapes.Sphere sphere, Libraries.Game.Collision.PhysicsPosition3D sphereTransform, Libraries.Game.Collision.CollisionPointsResult3D result)
This action collides a single triangle item with a sphere item, where the triangle is item A of the collision and the sphere is item B. It uses the sphere's triangle collider, which finds at most one contact, at the point on the triangle closest to the sphere's center. The collision's points are refreshed afterward.
Parameters
collisionPointsLibraries.Game.Collision.LocalCollisionPoints3D: The collision's stored contact points.triangleLibraries.Game.Collision.Shapes.Triangle: The triangle, which is item A, with its corners in its own space.triangleTransformLibraries.Game.Collision.PhysicsPosition3D: Where the triangle is in the world.sphereLibraries.Game.Collision.Shapes.Sphere: The sphere, which is item B.sphereTransformLibraries.Game.Collision.PhysicsPosition3D: Where the sphere is in the world. Its origin is the sphere's center.resultLibraries.Game.Collision.CollisionPointsResult3D: Where contacts are reported. It must already be initialized with the triangle's item as item A and the sphere's item as item B.
PrepareShape(Libraries.Game.Collision.Shapes.CollisionShape3D shape)
This action prepares for a run of CollideTriangle calls with the same shape, such as the triangles of a terrain under one box, so the shape's fixed values are read once. Call ReleaseShape after the run.
Parameters
shapeLibraries.Game.Collision.Shapes.CollisionShape3D: The shape about to be tested against many triangles.
ReleaseShape()
This action ends a run of CollideTriangle calls started by PrepareShape.