Shape2D¶
继承¶
Resource
简要描述¶
所有2D形状的基类。
描述¶
所有2D形状的基类。所有2D形状类型都从此继承。
成员¶
| 类型 | 属性名 | 默认值 |
|---|---|---|
| float | custom_solver_bias | 0.0 |
方法¶
| 返回值类型 | 方法名称 |
|---|---|
| bool | collide(local_xform: Transform2D, with_shape: Shape2D, shape_xform: Transform2D) |
| Array | collide_and_get_contacts(local_xform: Transform2D, with_shape: Shape2D, shape_xform: Transform2D) |
| bool | collide_with_motion(local_xform: Transform2D, local_motion: Vector2, with_shape: Shape2D, shape_xform: Transform2D, shape_motion: Vector2) |
| Array | collide_with_motion_and_get_contacts(local_xform: Transform2D, local_motion: Vector2, with_shape: Shape2D, shape_xform: Transform2D, shape_motion: Vector2) |
常量¶
成员说明¶
- float custom_solver_bias
| Default | 0.0 |
|---|---|
| setter | set_custom_solver_bias(value) |
| getter | get_custom_solver_bias |
方法说明¶
- collide collide(local_xform: Transform2D, with_shape: Shape2D, shape_xform: Transform2D)
如果此形状与其他形状发生碰撞,则返回true。
此方法需要此形状的转换矩阵(local_xform),检查与(with_shape)的碰撞的形状以及该形状的转换矩阵(shape_xform)
- collide_and_get_contacts collide_and_get_contacts(local_xform: Transform2D, with_shape: Shape2D, shape_xform: Transform2D)
返回此形状接触其他点的列表。如果没有冲突,则列表为空。
此方法需要此形状的转换矩阵(local_xform),检查与(with_shape)的碰撞的形状以及该形状的转换矩阵(shape_xform)。
- collide_with_motion collide_with_motion(local_xform: Transform2D, local_motion: Vector2, with_shape: Shape2D, shape_xform: Transform2D, shape_motion: Vector2)
返回如果应用了给定的运动,则该形状是否会与另一个碰撞。
此方法需要此形状的转换矩阵(local_xform),要对此形状进行测试的运动(local_motion),要检查与(with_shape [/code],该形状的转换矩阵( shape_xform)和要测试到另一个对象的运动(shape_motion`)。
- collide_with_motion_and_get_contacts collide_with_motion_and_get_contacts(local_xform: Transform2D, local_motion: Vector2, with_shape: Shape2D, shape_xform: Transform2D, shape_motion: Vector2)
如果应用了给定的运动,则返回该形状将与另一个形状接触的点的列表。
此方法需要此形状的转换矩阵(local_xform),要对此形状进行测试的运动(local_motion),要检查与(with_shape [/code],该形状的转换矩阵( shape_xform)和要测试到另一个对象的运动(shape_motion`)。