Table of Contents

Class PhysicsTestMotionParameters3D

Provides parameters for PhysicsServer3D.body_test_motion.

Inheritance
PhysicsTestMotionParameters3D

Remarks

By changing various properties of this object, such as the motion, you can configure the parameters for PhysicsServer3D.body_test_motion.

Properties

collide_separation_ray

If set to true, shapes of type PhysicsServer3D.SHAPE_SEPARATION_RAY are used to detect collisions and can stop the motion. Can be useful when snapping to the ground.

If set to false, shapes of type PhysicsServer3D.SHAPE_SEPARATION_RAY are only used for separation when overlapping with other bodies. That's the main use for separation ray shapes.

var collide_separation_ray : bool = false

Property Value

bool

Remarks

  • void set_collide_separation_ray_enabled(bool value)
  • bool is_collide_separation_ray_enabled

exclude_bodies

Optional array of body RID to exclude from collision. Use get_rid to get the RID associated with a CollisionObject3D-derived node.

var exclude_bodies : RID[] = []

Property Value

RID[]

Remarks

  • void set_exclude_bodies(RID[] value)
  • RID[] get_exclude_bodies

exclude_objects

Optional array of object unique instance ID to exclude from collision. See get_instance_id.

var exclude_objects : int[] = []

Property Value

int[]

Remarks

  • void set_exclude_objects(int[] value)
  • int[] get_exclude_objects

from

Transform in global space where the motion should start. Usually set to global_transform for the current body's transform.

var from : Transform3D = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)

Property Value

Transform3D

Remarks

margin

Increases the size of the shapes involved in the collision detection.

var margin : float = 0.001

Property Value

float

Remarks

max_collisions

Maximum number of returned collisions, between 1 and 32. Always returns the deepest detected collisions.

var max_collisions : int = 1

Property Value

int

Remarks

  • void set_max_collisions(int value)
  • int get_max_collisions

motion

Motion vector to define the length and direction of the motion to test.

var motion : Vector3 = Vector3(0, 0, 0)

Property Value

Vector3

Remarks

recovery_as_collision

If set to true, any depenetration from the recovery phase is reported as a collision; this is used e.g. by CharacterBody3D for improving floor detection during floor snapping.

If set to false, only collisions resulting from the motion are reported, which is generally the desired behavior.

var recovery_as_collision : bool = false

Property Value

bool

Remarks

  • void set_recovery_as_collision_enabled(bool value)
  • bool is_recovery_as_collision_enabled