PhysicsTestMotionParameters3D

继承: RefCounted < Object

Provides parameters for PhysicsServer3D.body_test_motion.

描述

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

属性


属性说明

bool collide_separation_ray = false

  • void set_collide_separation_ray_enabled ( value: bool )
  • bool is_collide_separation_ray_enabled ( )

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.


Array RID exclude_bodies = []

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


Array int exclude_objects = []

  • void set_exclude_objects ( value: Array int )
  • Array int get_exclude_objects ( )

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


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

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


float margin = 0.001

  • void set_margin ( value: float )
  • float get_margin ( )

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


int max_collisions = 1

  • void set_max_collisions ( value: int )
  • int get_max_collisions ( )

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


Vector3 motion = Vector3(0, 0, 0)

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


bool recovery_as_collision = false

  • void set_recovery_as_collision_enabled ( value: bool )
  • bool is_recovery_as_collision_enabled ( )

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.

1

本方法通常需要用户覆盖才能生效。

2

本方法无副作用,不会修改该实例的任何成员变量。

3

本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。

4

本方法用于构造某个类型。

5

调用本方法无需实例,可直接使用类名进行调用。

6

本方法描述的是使用本类型作为左操作数的有效运算符。

7

这个值是由下列位标志构成位掩码的整数。

8

无返回值。