FmodGeometryInstance3D#
继承: StaticBody3D < PhysicsBody3D < CollisionObject3D < Node3D < Node < Object
从 3D 网格生成 FMOD 遮挡几何体的节点
描述#
FmodGeometryInstance3D 用于将场景中的几何体注册到 FMOD Geometry 系统,让 3D 声音可以根据场景遮挡产生直达声和混响遮挡 (参见 CollisionShape3D ) (参见 MeshInstance3D ) (参见 Mesh )
该节点在运行时将全局变换同步到 FMOD 几何体。
属性#
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
方法#
void |
set_source_mode(mode: SourceMode) |
get_source_mode() const |
|
void |
set_source_node_path(path: NodePath) |
get_source_node_path() const |
|
void |
|
get_mesh() const |
|
void |
set_direct_occlusion(value: float) |
get_direct_occlusion() const |
|
void |
set_reverb_occlusion(value: float) |
get_reverb_occlusion() const |
|
void |
set_double_sided(value: bool) |
get_double_sided() const |
|
void |
set_active(value: bool) |
get_active() const |
|
void |
set_auto_rebuild(value: bool) |
get_auto_rebuild() const |
|
void |
set_sync_transform(value: bool) |
get_sync_transform() const |
|
void |
set_recursive_source_scan(value: bool) |
get_recursive_source_scan() const |
|
void |
set_primitive_segments(segments: int) |
get_primitive_segments() const |
|
void |
set_show_debug_gizmo(value: bool) |
get_show_debug_gizmo() const |
|
void |
|
void |
|
has_valid_geometry() const |
|
void |
|
get_polygon_count() const |
|
get_vertex_count() const |
|
get_geometry() const |
信号#
geometry_created()
创建新的 FMOD 几何体对象后发出。
geometry_cleared()
内部几何体释放后发出。
geometry_rebuilt()
几何体重新构建后发出。
枚举#
enum SourceMode:
SourceMode SOURCE_AUTO = 0
自动选择可用来源
SourceMode SOURCE_COLLISION_SHAPES = 1
从 CollisionShape3D 构建
SourceMode SOURCE_MESH_INSTANCE = 2
从 MeshInstance3D 构建
SourceMode SOURCE_MESH_RESOURCE = 3
从 Mesh 资源构建
属性说明#
SourceMode source_mode = 1
void set_source_mode(mode: SourceMode)
SourceMode get_source_mode() const
几何体来源模式
NodePath source_node_path = NodePath("")
指定要扫描的源节点路径
Mesh mesh
直接用于构建遮挡几何体的网格资源 (参见 source_mode ) (参见 SOURCE_MESH_RESOURCE )
float direct_occlusion = 0.5
直达声遮挡强度
float reverb_occlusion = 0.5
混响声遮挡强度
bool double_sided = true
多边形是否双面遮挡
bool active = true
几何体是否参与遮挡计算
bool auto_rebuild = true
进入场景或属性变化时自动重建几何体
bool sync_transform = true
是否同步节点变换到底层 FmodGeometry
bool recursive_source_scan = true
启用后递归收集子节点中的碰撞形状。
int primitive_segments = 16
从基础碰撞形状生成几何体时使用的分段数
bool show_debug_gizmo = true
是否显示编辑器调试 Gizmo
方法说明#
void set_source_mode(mode: SourceMode)
设置 source_mode 。
SourceMode get_source_mode() const
返回 source_mode 。
void set_source_node_path(path: NodePath)
设置 source_node_path 。
NodePath get_source_node_path() const
返回 source_node_path 。
void set_mesh(mesh: Mesh)
设置 mesh 。
Mesh get_mesh() const
返回 mesh 。
void set_direct_occlusion(value: float)
设置 direct_occlusion 。
float get_direct_occlusion() const
返回 direct_occlusion 。
void set_reverb_occlusion(value: float)
设置 reverb_occlusion 。
float get_reverb_occlusion() const
返回 reverb_occlusion 。
void set_double_sided(value: bool)
设置 double_sided 。
bool get_double_sided() const
返回 double_sided 。
void set_active(value: bool)
设置 active 。
bool get_active() const
返回 active 。
void set_auto_rebuild(value: bool)
设置 auto_rebuild 。
bool get_auto_rebuild() const
返回 auto_rebuild 。
void set_sync_transform(value: bool)
设置 sync_transform 。
bool get_sync_transform() const
返回 sync_transform 。
void set_recursive_source_scan(value: bool)
bool get_recursive_source_scan() const
void set_primitive_segments(segments: int)
设置 primitive_segments 。
int get_primitive_segments() const
返回 primitive_segments 。
void set_show_debug_gizmo(value: bool)
设置 show_debug_gizmo 。
bool get_show_debug_gizmo() const
返回 show_debug_gizmo 。
void rebuild_geometry()
重新检测源节点并重建 FMOD 几何体
void clear_geometry()
释放当前 FMOD 几何体并清空引用 (参见 FmodGeometry )
bool has_valid_geometry() const
如果内部几何体存在且有效,则返回 true
void sync_geometry_transform()
立即将节点当前变换同步到底层 FmodGeometry 。
int get_polygon_count() const
返回当前构建出的遮挡多边形数量。
int get_vertex_count() const
返回当前构建出的顶点数量。
FmodGeometry get_geometry() const
返回内部 FmodGeometry ;尚未构建几何体时返回 null 。