Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

PhysicsPointQueryParameters2D

继承: RefCounted < Object

PhysicsDirectSpaceState2D.intersect_point 提供参数。

描述

通过修改这个对象的点位置等属性,你可以为 PhysicsDirectSpaceState2D.intersect_point 配置参数。

属性

int

canvas_instance_id

0

bool

collide_with_areas

false

bool

collide_with_bodies

true

int

collision_mask

4294967295

RID[]

exclude

[]

Vector2

position

Vector2(0, 0)


属性说明

int canvas_instance_id = 0

  • void set_canvas_instance_id ( int value )

  • int get_canvas_instance_id ( )

如果与 0 不同,则将查询限制为由其实例 ID 指定的特定画布层。请参阅 Object.get_instance_id

如果为 0,则将查询限制为视口的默认画布层。


bool collide_with_areas = false

  • void set_collide_with_areas ( bool value )

  • bool is_collide_with_areas_enabled ( )

如果为 true,查询将考虑 Area2D


bool collide_with_bodies = true

  • void set_collide_with_bodies ( bool value )

  • bool is_collide_with_bodies_enabled ( )

如果为 true,查询将考虑 PhysicsBody2D


int collision_mask = 4294967295

  • void set_collision_mask ( int value )

  • int get_collision_mask ( )

查询将检测的物理层(作为位掩码)。默认情况下,会检测所有碰撞层。有关详细信息,请参阅文档中的 《碰撞层和掩码》


RID[] exclude = []

  • void set_exclude ( RID[] value )

  • RID[] get_exclude ( )

将被排除在碰撞之外的对象的 RID 列表。请使用 CollisionObject2D.get_rid 来获取与派生自 CollisionObject2D 的节点关联的 RID


Vector2 position = Vector2(0, 0)

要查询的位置,使用全局坐标。