PhysicsTestMotionResult2D

Inherits: RefCounted < Object

Result from a 2D body motion test.

Description

This class contains the motion and collision result from PhysicsServer2D.body_test_motion.

Method Descriptions

  • Object get_collider ( ) const

Returns the colliding body's attached Object, if a collision occured.


  • int get_collider_id ( ) const

Returns the unique instance ID of the colliding body's attached Object, if a collision occured. See Object.get_instance_id.


  • RID get_collider_rid ( ) const

Returns the colliding body's RID used by the PhysicsServer2D, if a collision occured.


  • int get_collider_shape ( ) const

Returns the colliding body's shape index, if a collision occured. See CollisionObject2D.


  • Vector2 get_collider_velocity ( ) const

Returns the colliding body's velocity, if a collision occured.


  • float get_collision_depth ( ) const

Returns the length of overlap along the collision normal, if a collision occured.


  • int get_collision_local_shape ( ) const

Returns the moving object's colliding shape, if a collision occured.


  • Vector2 get_collision_normal ( ) const

Returns the colliding body's shape's normal at the point of collision, if a collision occured.


  • Vector2 get_collision_point ( ) const

Returns the point of collision in global coordinates, if a collision occured.


  • float get_collision_safe_fraction ( ) const

Returns the maximum fraction of the motion that can occur without a collision, between 0 and 1.


  • float get_collision_unsafe_fraction ( ) const

Returns the minimum fraction of the motion needed to collide, if a collision occured, between 0 and 1.


Returns the moving object's remaining movement vector.


Returns the moving object's travel before collision.