#pragma once #include #include #include #include #include #include #include #include #include #include #include // IPLStaticMesh, IPLStaticMeshSettings, IPLMaterial #include "steam_audio.hpp" #include "steam_audio_material.hpp" #include using namespace godot; class SteamAudioDynamicMesh : public Node3D { GDCLASS(SteamAudioDynamicMesh, Node3D) private: IPLScene subscene=nullptr; IPLScene global_scene=nullptr; IPLSceneSettings scene_settings; IPLInstancedMesh instanced_mesh=nullptr; IPLInstancedMeshSettings instanced_mesh_settings; int proxy_mode = PROXY_NONE; Ref custom_proxy_mesh; Transform3D last_transform; StringName bus; bool needs_update = false; protected: static void _bind_methods(); public: SteamAudioDynamicMesh(); ~SteamAudioDynamicMesh() override; void _notification(int what); // Setters & getters void set_proxy_mode(int mode); int get_proxy_mode() const; void set_custom_proxy_mesh(Ref mesh); Ref get_custom_proxy_mesh() const; bool get_needs_update() { return needs_update; } void build_mesh(IPLScene scene, IPLContext ipl_context, IPLContextSettings ipl_context_settings); static Vector _instances; static const Vector& get_all_dynamic_meshes(); // Regenerates Steam Audio proxies Ref get_proxy_mesh(); void update_dynamic_mesh(); };