/// Get references to the two colliding shapes. /// The collision types will match the order of the ChipmunkCollisionManager method. /// Say you defined a ChipmunkCollisionManager method "ChipmunkBegin_player_enemy". /// Then shapeA.collisionType == "player" and shapeB.collisionType == "enemy" public void GetShapes(out ChipmunkShape shapeA, out ChipmunkShape shapeB) { IntPtr _shapeA, _shapeB; _cpArbiterGetShapes(_handle, out _shapeA, out _shapeB); shapeA = ChipmunkShape._FromHandle(_shapeA); shapeB = ChipmunkShape._FromHandle(_shapeB); }
/// Return only the first shape struck by the segment query as it goes from start to end. /// Shapes are filtered using the group and layers in the same way as collisions. public static ChipmunkShape SegmentQueryFirst(Vector2 start, Vector2 end, uint layers, string group, out ChipmunkSegmentQueryInfo info) { IntPtr handle = manager._space._handle; return(ChipmunkShape._FromHandle(cpSpaceSegmentQueryFirst(handle, start, end, layers, ChipmunkBinding.InternString(group), out info))); }
/// Return only information about the nearest shape to the query point. /// Shapes are filtered using the group and layers in the same way as collisions. public static ChipmunkShape NearestPointQueryNearest(Vector2 point, float maxDistance, uint layers, string group, out ChipmunkNearestPointQueryInfo info) { IntPtr handle = manager._space._handle; return(ChipmunkShape._FromHandle(cpSpaceNearestPointQueryNearest(handle, point, maxDistance, layers, ChipmunkBinding.InternString(group), out info))); }