Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
World3D
继承: Resource < RefCounted < Object
包含 3D 世界所有组件的资源,例如可视场景和物理空间。
描述
这个类包含所有与世界相关的内容:物理空间、可视场景和音频空间。3D 节点会将它们的资源注册到当前的 3D 世界中。
教程
属性
属性说明
CameraAttributes camera_attributes 🔗
void set_camera_attributes(value: CameraAttributes)
CameraAttributes get_camera_attributes()
Camera3D 上未设置时 CameraAttributes 时默认使用的资源。
PhysicsDirectSpaceState3D direct_space_state 🔗
PhysicsDirectSpaceState3D get_direct_space_state()
直接访问该世界的物理 3D 空间状态。可用于查询当前和可能的碰撞。在多线程物理中使用时,仅可在主线程的 Node._physics_process() 中访问。
Environment environment 🔗
void set_environment(value: Environment)
Environment get_environment()
该 World3D 的 Environment。
Environment fallback_environment 🔗
void set_fallback_environment(value: Environment)
Environment get_fallback_environment()
在 environment 失败或丢失时,World3D 所使用的回退环境。
RID get_navigation_map()
这个世界的导航地图的 RID。由 NavigationServer3D 使用。
RID get_scenario()
该 World3D 的可视场景。
RID get_space()
该 World3D 的物理空间。