PhysicsShapeQueryParameters3D
继承: RefCounted < Object
为 PhysicsDirectSpaceState3D.intersect_shape 提供参数。
描述
你可以通过修改这个对象的形状等属性来为 PhysicsDirectSpaceState3D.intersect_shape 配置参数。
属性
| ||
| ||
| ||
| ||
| ||
| ||
| ||
|
属性说明
bool collide_with_areas = false
🔗
如果为 true
,则查询将考虑 Area3D。
bool collide_with_bodies = true
🔗
如果为 true
,则查询将考虑 PhysicsBody3D。
int collision_mask = 4294967295
🔗
查询将检测的物理层(作为位掩码)。默认情况下,会检测所有碰撞层。有关详细信息,请参阅文档中的 《碰撞层和掩码》。
The list of object RIDs that will be excluded from collisions. Use CollisionObject3D.get_rid to get the RID associated with a CollisionObject3D-derived node.
Note: The returned array is copied and any changes to it will not update the original property value. To update the value you need to modify the returned array, and then assign it to the property again.
形状的碰撞边距。
Vector3 motion = Vector3(0, 0, 0)
🔗
正在查询的形状的运动。
将用于碰撞/相交查询的 Shape3D。存储的是实际的引用,可以避免该形状在进行查询时被释放,因此请优先使用这个属性,而不是 shape_rid。
The queried shape’s RID that will be used for collision/intersection queries. Use this over shape if you want to optimize for performance using the Servers API:
GDScriptC#
var shape_rid = PhysicsServer3D.shape_create(PhysicsServer3D.SHAPE_SPHERE)
var radius = 2.0
PhysicsServer3D.shape_set_data(shape_rid, radius)
var params = PhysicsShapeQueryParameters3D.new()
params.shape_rid = shape_rid
# Execute physics queries here...
# Release the shape when done with physics queries.
PhysicsServer3D.free_rid(shape_rid)
RID shapeRid = PhysicsServer3D.ShapeCreate(PhysicsServer3D.ShapeType.Sphere);
float radius = 2.0f;
PhysicsServer3D.ShapeSetData(shapeRid, radius);
var params = new PhysicsShapeQueryParameters3D();
params.ShapeRid = shapeRid;
// Execute physics queries here...
// Release the shape when done with physics queries.
PhysicsServer3D.FreeRid(shapeRid);
Transform3D transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)
🔗
void set_transform(value: Transform3D)
Transform3D get_transform()
被查询形状的变换矩阵。