ClippedCamera¶
继承¶
Camera
简要描述¶
包含碰撞的[相机]。
描述¶
该节点扩展了Camera以添加与Area和/或PhysicsBody节点的碰撞。
成员¶
| 类型 | 属性名 | 默认值 |
|---|---|---|
| bool | clip_to_areas | false |
| bool | clip_to_bodies | true |
| int | collision_mask | 1 |
| float | margin | 0.0 |
| int | process_mode | 0 |
方法¶
| 返回值类型 | 方法名称 |
|---|---|
| void | add_exception(node: Object) |
| void | add_exception_rid(rid: RID) |
| void | clear_exceptions() |
| float | get_clip_offset() const |
| bool | get_collision_mask_bit(bit: int) const |
| void | remove_exception(node: Object) |
| void | remove_exception_rid(rid: RID) |
| void | set_collision_mask_bit(bit: int, value: bool) |
| ##枚举 | |
| enum ProcessMode: | |
| - CLIP_PROCESS_PHYSICS = 0 |
相机使用_physics_process回调进行更新。
- CLIP_PROCESS_IDLE = 1
摄像机使用_process回调进行更新。
常量¶
成员说明¶
- bool clip_to_areas
| Default | false |
|---|---|
| setter | set_clip_to_areas(value) |
| getter | is_clip_to_areas_enabled |
- bool clip_to_bodies
| Default | true |
|---|---|
| setter | set_clip_to_bodies(value) |
| getter | is_clip_to_bodies_enabled |
- int collision_mask
| Default | 1 |
|---|---|
| setter | set_collision_mask(value) |
| getter | get_collision_mask |
- float margin
| Default | 0.0 |
|---|---|
| setter | set_margin(value) |
| getter | get_margin |
- int process_mode
| Default | 0 |
|---|---|
| setter | set_process_mode(value) |
| getter | get_process_mode |
方法说明¶
- add_exception add_exception(node: Object)
添加碰撞异常,以使相机不会与指定节点碰撞。
- add_exception_rid add_exception_rid(rid: RID)
添加碰撞例外,以使相机不会与指定的RID碰撞。
- clear_exceptions clear_exceptions()
删除所有碰撞异常。
- get_clip_offset get_clip_offset() const
返回相机由于碰撞而偏移的距离。
- get_collision_mask_bit get_collision_mask_bit(bit: int) const
如果指定的位索引打开,则返回true。
**注意:**位索引的范围是0-19。
- remove_exception remove_exception(node: Object)
删除与指定节点的冲突异常。
- remove_exception_rid remove_exception_rid(rid: RID)
使用指定的RID删除冲突异常。
- set_collision_mask_bit set_collision_mask_bit(bit: int, value: bool)
将指定的位索引设置为value。
**注意:**位索引的范围是0-19。