Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
PhysicsPointQueryParameters2D
繼承: RefCounted < Object
為 PhysicsDirectSpaceState2D.intersect_point() 提供參數。
說明
By changing various properties of this object, such as the point position, you can configure the parameters for PhysicsDirectSpaceState2D.intersect_point().
Note: For optimal performance results, it is recommended to create this object in advance, store it, and reuse it for every subsequent query.
屬性
|
||
|
||
|
||
|
||
|
||
|
屬性說明
如果與 0 不同,則將查詢限制為由其實例 ID 指定的特定畫布層。請參閱 Object.get_instance_id()。
如果為 0,則將查詢限制為視埠的預設畫布層。
bool collide_with_areas = false 🔗
如果為 true,查詢將考慮 Area2D。
bool collide_with_bodies = true 🔗
如果為 true,查詢將考慮 PhysicsBody2D。
int collision_mask = 4294967295 🔗
查詢將偵測的實體層(作為位元遮罩)。預設情況下,會偵測所有碰撞層。有關詳細資訊,請參閱文件中的 《碰撞層和遮罩》。
將被排除在碰撞之外的物件的 RID 清單。請使用 CollisionObject2D.get_rid() 來取得與派生自 CollisionObject2D 的節點關聯的 RID。
注意:回傳的陣列為副本,對其進行的修改不會更新原有屬性。更新時,請先修改回傳的陣列,然後將其重新賦值回該屬性。
Vector2 position = Vector2(0, 0) 🔗
要查詢的位置,使用全域座標。