Physics2DShapeQueryParameters

Inherits: Reference < Object

要发送到2D形状物理查询的参数。

描述

此类包含用于 2D 相交/碰撞查询的形状和其他参数。

属性

bool

collide_with_areas

false

bool

collide_with_bodies

true

int

collision_layer

2147483647

Array

exclude

[  ]

float

margin

0.0

Vector2

motion

Vector2( 0, 0 )

RID

shape_rid

Transform2D

transform

Transform2D( 1, 0, 0, 1, 0, 0 )

方法

void

set_shape ( Resource shape )

属性说明

  • bool collide_with_areas

Default

false

Setter

set_collide_with_areas(value)

Getter

is_collide_with_areas_enabled()

如果true,查询将考虑Area2D


  • bool collide_with_bodies

Default

true

Setter

set_collide_with_bodies(value)

Getter

is_collide_with_bodies_enabled()

如果true,查询将考虑PhysicsBody2D


  • int collision_layer

Default

2147483647

Setter

set_collision_layer(value)

Getter

get_collision_layer()

The physics layer(s) the query will take into account (as a bitmask). See Collision layers and masks in the documentation for more information.


Default

[  ]

Setter

set_exclude(value)

Getter

get_exclude()

将被排除在冲突之外的对象或对象列表。


Default

0.0

Setter

set_margin(value)

Getter

get_margin()

形状的碰撞边距。


Default

Vector2( 0, 0 )

Setter

set_motion(value)

Getter

get_motion()

正在查询的形状的运动。


Setter

set_shape_rid(value)

Getter

get_shape_rid()

查询形状的 RID。另见set_shape


Default

Transform2D( 1, 0, 0, 1, 0, 0 )

Setter

set_transform(value)

Getter

get_transform()

被查询形状的变换矩阵。

方法说明

设置用于碰撞/相交查询的 Shape2D