PhysicsTestMotionResult2D
Describes the motion and collision result from bodyTestMotion(body:parameters:result:)
.
class PhysicsTestMotionResult2D
Describes the motion and collision result from bodyTestMotion(body:parameters:result:)
.
Superclasses
class RefCounted
Base class for reference-counted objects.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Type members
Instance members
func getCollider(
) -> Object? Returns the colliding body’s attached
Object
, if a collision occurred.func getColliderId(
) -> UInt Returns the unique instance ID of the colliding body’s attached
Object
, if a collision occurred. SeegetInstanceId
.func getColliderRid(
) -> RID Returns the colliding body’s
RID
used by thePhysicsServer2D
, if a collision occurred.func getColliderShape(
) -> Int32 Returns the colliding body’s shape index, if a collision occurred. See
CollisionObject2D
.func getColliderVelocity(
) -> Vector2 Returns the colliding body’s velocity, if a collision occurred.
func getCollisionDepth(
) -> Double Returns the length of overlap along the collision normal, if a collision occurred.
func getCollisionLocalShape(
) -> Int32 Returns the moving object’s colliding shape, if a collision occurred.
func getCollisionNormal(
) -> Vector2 Returns the colliding body’s shape’s normal at the point of collision, if a collision occurred.
func getCollisionPoint(
) -> Vector2 Returns the point of collision in global coordinates, if a collision occurred.
func getCollisionSafeFraction(
) -> Double Returns the maximum fraction of the motion that can occur without a collision, between
0
and1
.func getCollisionUnsafeFraction(
) -> Double Returns the minimum fraction of the motion needed to collide, if a collision occurred, between
0
and1
.func getRemainder(
) -> Vector2 Returns the moving object’s remaining movement vector.
func getTravel(
) -> Vector2 Returns the moving object’s travel before collision.