Split out the compatibility classes from the filament renderer.
The filament library provides APIs for creating the low-level objects such as meshes and textures. The compat library provides the high-level compatibility layer between mjvScene and the core library. PiperOrigin-RevId: 904504900 Change-Id: Ida1aecab4b9a8aefbbf6b0a0c4ba7ff164864b8e
This commit is contained in:
committed by
Copybara-Service
parent
15f61679bf
commit
c52d3d0789
@@ -32,10 +32,6 @@ target_sources(${MUJOCO_FILAMENT_TARGET_NAME}
|
||||
filament/filament_context.h
|
||||
filament/filament_platform_factory.cc
|
||||
filament/filament_platform_factory.h
|
||||
filament/imgui_bridge.cc
|
||||
filament/imgui_bridge.h
|
||||
filament/imgui_editor.cc
|
||||
filament/imgui_editor.h
|
||||
filament/light.cc
|
||||
filament/light.h
|
||||
filament/material.cc
|
||||
@@ -44,10 +40,6 @@ target_sources(${MUJOCO_FILAMENT_TARGET_NAME}
|
||||
filament/math_util.h
|
||||
filament/mesh.cc
|
||||
filament/mesh.h
|
||||
filament/mjr_filament_renderer.cc
|
||||
filament/mjr_filament_renderer.h
|
||||
filament/model_objects.cc
|
||||
filament/model_objects.h
|
||||
filament/model_util.h
|
||||
filament/object_manager.cc
|
||||
filament/object_manager.h
|
||||
@@ -55,14 +47,22 @@ target_sources(${MUJOCO_FILAMENT_TARGET_NAME}
|
||||
filament/render_target.h
|
||||
filament/renderable.cc
|
||||
filament/renderable.h
|
||||
filament/scene_bridge.cc
|
||||
filament/scene_bridge.h
|
||||
filament/scene_geom_util.cc
|
||||
filament/scene_geom_util.h
|
||||
filament/scene_view.cc
|
||||
filament/scene_view.h
|
||||
filament/texture.cc
|
||||
filament/texture.h
|
||||
compat/imgui_bridge.cc
|
||||
compat/imgui_bridge.h
|
||||
compat/imgui_editor.cc
|
||||
compat/imgui_editor.h
|
||||
compat/mjr_filament_renderer.cc
|
||||
compat/mjr_filament_renderer.h
|
||||
compat/model_objects.cc
|
||||
compat/model_objects.h
|
||||
compat/scene_bridge.cc
|
||||
compat/scene_bridge.h
|
||||
compat/scene_geom_util.cc
|
||||
compat/scene_geom_util.h
|
||||
)
|
||||
if(MUJOCO_USE_FILAMENT_MJR_COMPAT)
|
||||
target_sources(${MUJOCO_FILAMENT_TARGET_NAME}
|
||||
|
||||
+1
-2
@@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include "experimental/filament/filament/imgui_bridge.h"
|
||||
#include "experimental/filament/compat/imgui_bridge.h"
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
@@ -23,7 +23,6 @@
|
||||
#include <imgui.h>
|
||||
#include <math/mat3.h>
|
||||
#include <math/vec3.h>
|
||||
#include <math/vec4.h>
|
||||
#include <mujoco/mujoco.h>
|
||||
#include "experimental/filament/filament/material.h"
|
||||
#include "experimental/filament/filament/mesh.h"
|
||||
+3
-3
@@ -12,8 +12,8 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#ifndef MUJOCO_SRC_EXPERIMENTAL_FILAMENT_FILAMENT_IMGUI_BRIDGE_H_
|
||||
#define MUJOCO_SRC_EXPERIMENTAL_FILAMENT_FILAMENT_IMGUI_BRIDGE_H_
|
||||
#ifndef MUJOCO_SRC_EXPERIMENTAL_FILAMENT_COMPAT_IMGUI_BRIDGE_H_
|
||||
#define MUJOCO_SRC_EXPERIMENTAL_FILAMENT_COMPAT_IMGUI_BRIDGE_H_
|
||||
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
@@ -72,4 +72,4 @@ void DrawTextAt(const char* text, float x, float y, float z);
|
||||
|
||||
} // namespace mujoco
|
||||
|
||||
#endif // MUJOCO_SRC_EXPERIMENTAL_FILAMENT_FILAMENT_IMGUI_BRIDGE_H_
|
||||
#endif // MUJOCO_SRC_EXPERIMENTAL_FILAMENT_COMPAT_IMGUI_BRIDGE_H_
|
||||
+2
-2
@@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include "experimental/filament/filament/imgui_editor.h"
|
||||
#include "experimental/filament/compat/imgui_editor.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <any>
|
||||
@@ -34,8 +34,8 @@
|
||||
#include <math/mathfwd.h>
|
||||
#include <math/scalar.h>
|
||||
#include <math/vec3.h>
|
||||
#include "experimental/filament/compat/scene_bridge.h"
|
||||
#include "experimental/filament/filament/color_grading_options.h"
|
||||
#include "experimental/filament/filament/scene_bridge.h"
|
||||
#include "experimental/filament/filament/scene_view.h"
|
||||
|
||||
namespace mujoco {
|
||||
+4
-4
@@ -12,10 +12,10 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#ifndef MUJOCO_SRC_EXPERIMENTAL_FILAMENT_FILAMENT_IMGUI_EDITOR_H_
|
||||
#define MUJOCO_SRC_EXPERIMENTAL_FILAMENT_FILAMENT_IMGUI_EDITOR_H_
|
||||
#ifndef MUJOCO_SRC_EXPERIMENTAL_FILAMENT_COMPAT_IMGUI_EDITOR_H_
|
||||
#define MUJOCO_SRC_EXPERIMENTAL_FILAMENT_COMPAT_IMGUI_EDITOR_H_
|
||||
|
||||
#include "experimental/filament/filament/scene_bridge.h"
|
||||
#include "experimental/filament/compat/scene_bridge.h"
|
||||
|
||||
namespace mujoco {
|
||||
|
||||
@@ -24,4 +24,4 @@ void DrawGui(SceneBridge* scene_bridge);
|
||||
|
||||
} // namespace mujoco
|
||||
|
||||
#endif // MUJOCO_SRC_EXPERIMENTAL_FILAMENT_FILAMENT_IMGUI_EDITOR_H_
|
||||
#endif // MUJOCO_SRC_EXPERIMENTAL_FILAMENT_COMPAT_IMGUI_EDITOR_H_
|
||||
+4
-4
@@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include "experimental/filament/filament/mjr_filament_renderer.h"
|
||||
#include "experimental/filament/compat/mjr_filament_renderer.h"
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
@@ -22,13 +22,13 @@
|
||||
#include <mujoco/mjmodel.h>
|
||||
#include <mujoco/mjvisualize.h>
|
||||
#include <mujoco/mujoco.h>
|
||||
#include "experimental/filament/compat/imgui_bridge.h"
|
||||
#include "experimental/filament/compat/imgui_editor.h"
|
||||
#include "experimental/filament/compat/scene_bridge.h"
|
||||
#include "experimental/filament/filament/draw_mode.h"
|
||||
#include "experimental/filament/filament/filament_context.h"
|
||||
#include "experimental/filament/filament/imgui_bridge.h"
|
||||
#include "experimental/filament/filament/imgui_editor.h"
|
||||
#include "experimental/filament/filament/model_util.h"
|
||||
#include "experimental/filament/filament/render_target.h"
|
||||
#include "experimental/filament/filament/scene_bridge.h"
|
||||
#include "experimental/filament/filament/texture.h"
|
||||
#include "experimental/filament/render_context_filament.h"
|
||||
|
||||
+5
-6
@@ -12,8 +12,8 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#ifndef MUJOCO_SRC_EXPERIMENTAL_FILAMENT_FILAMENT_MJR_FILAMENT_RENDERER_H_
|
||||
#define MUJOCO_SRC_EXPERIMENTAL_FILAMENT_FILAMENT_MJR_FILAMENT_RENDERER_H_
|
||||
#ifndef MUJOCO_SRC_EXPERIMENTAL_FILAMENT_COMPAT_MJR_FILAMENT_RENDERER_H_
|
||||
#define MUJOCO_SRC_EXPERIMENTAL_FILAMENT_COMPAT_MJR_FILAMENT_RENDERER_H_
|
||||
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
@@ -21,10 +21,9 @@
|
||||
#include <mujoco/mjmodel.h>
|
||||
#include <mujoco/mjrender.h>
|
||||
#include <mujoco/mjvisualize.h>
|
||||
#include "experimental/filament/filament/draw_mode.h"
|
||||
#include "experimental/filament/compat/imgui_bridge.h"
|
||||
#include "experimental/filament/compat/scene_bridge.h"
|
||||
#include "experimental/filament/filament/filament_context.h"
|
||||
#include "experimental/filament/filament/imgui_bridge.h"
|
||||
#include "experimental/filament/filament/scene_bridge.h"
|
||||
#include "experimental/filament/render_context_filament.h"
|
||||
|
||||
namespace mujoco {
|
||||
@@ -84,4 +83,4 @@ class MjrFilamentRenderer : public FilamentContext {
|
||||
|
||||
} // namespace mujoco
|
||||
|
||||
#endif // MUJOCO_SRC_EXPERIMENTAL_FILAMENT_FILAMENT_MJR_FILAMENT_RENDERER_H_
|
||||
#endif // MUJOCO_SRC_EXPERIMENTAL_FILAMENT_COMPAT_MJR_FILAMENT_RENDERER_H_
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include "experimental/filament/filament/model_objects.h"
|
||||
#include "experimental/filament/compat/model_objects.h"
|
||||
|
||||
#include <array>
|
||||
#include <algorithm>
|
||||
+3
-3
@@ -12,8 +12,8 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#ifndef MUJOCO_SRC_EXPERIMENTAL_FILAMENT_FILAMENT_MODEL_OBJECTS_H_
|
||||
#define MUJOCO_SRC_EXPERIMENTAL_FILAMENT_FILAMENT_MODEL_OBJECTS_H_
|
||||
#ifndef MUJOCO_SRC_EXPERIMENTAL_FILAMENT_COMPAT_MODEL_OBJECTS_H_
|
||||
#define MUJOCO_SRC_EXPERIMENTAL_FILAMENT_COMPAT_MODEL_OBJECTS_H_
|
||||
|
||||
#include <array>
|
||||
#include <memory>
|
||||
@@ -100,4 +100,4 @@ class ModelObjects {
|
||||
|
||||
} // namespace mujoco
|
||||
|
||||
#endif // MUJOCO_SRC_EXPERIMENTAL_FILAMENT_FILAMENT_MODEL_OBJECTS_H_
|
||||
#endif // MUJOCO_SRC_EXPERIMENTAL_FILAMENT_COMPAT_MODEL_OBJECTS_H_
|
||||
+4
-5
@@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include "experimental/filament/filament/scene_bridge.h"
|
||||
#include "experimental/filament/compat/scene_bridge.h"
|
||||
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
@@ -36,16 +36,15 @@
|
||||
#include <math/vec4.h>
|
||||
#include <math/TVecHelpers.h>
|
||||
#include <mujoco/mujoco.h>
|
||||
#include "experimental/filament/compat/imgui_bridge.h"
|
||||
#include "experimental/filament/compat/model_objects.h"
|
||||
#include "experimental/filament/compat/scene_geom_util.h"
|
||||
#include "experimental/filament/filament/color_grading_options.h"
|
||||
#include "experimental/filament/filament/imgui_bridge.h"
|
||||
#include "experimental/filament/filament/light.h"
|
||||
#include "experimental/filament/filament/material.h"
|
||||
#include "experimental/filament/filament/math_util.h"
|
||||
#include "experimental/filament/filament/model_objects.h"
|
||||
#include "experimental/filament/filament/model_util.h"
|
||||
#include "experimental/filament/filament/object_manager.h"
|
||||
#include "experimental/filament/filament/renderable.h"
|
||||
#include "experimental/filament/filament/scene_geom_util.h"
|
||||
#include "experimental/filament/filament/scene_view.h"
|
||||
#include "experimental/filament/filament/texture.h"
|
||||
|
||||
+4
-4
@@ -12,8 +12,8 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#ifndef MUJOCO_SRC_EXPERIMENTAL_FILAMENT_FILAMENT_SCENE_BRIDGE_H_
|
||||
#define MUJOCO_SRC_EXPERIMENTAL_FILAMENT_FILAMENT_SCENE_BRIDGE_H_
|
||||
#ifndef MUJOCO_SRC_EXPERIMENTAL_FILAMENT_COMPAT_SCENE_BRIDGE_H_
|
||||
#define MUJOCO_SRC_EXPERIMENTAL_FILAMENT_COMPAT_SCENE_BRIDGE_H_
|
||||
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
@@ -24,8 +24,8 @@
|
||||
#include <math/vec3.h>
|
||||
#include <mujoco/mjvisualize.h>
|
||||
#include <mujoco/mujoco.h>
|
||||
#include "experimental/filament/compat/model_objects.h"
|
||||
#include "experimental/filament/filament/light.h"
|
||||
#include "experimental/filament/filament/model_objects.h"
|
||||
#include "experimental/filament/filament/object_manager.h"
|
||||
#include "experimental/filament/filament/renderable.h"
|
||||
#include "experimental/filament/filament/scene_view.h"
|
||||
@@ -85,4 +85,4 @@ class SceneBridge {
|
||||
|
||||
} // namespace mujoco
|
||||
|
||||
#endif // MUJOCO_SRC_EXPERIMENTAL_FILAMENT_FILAMENT_SCENE_BRIDGE_H_
|
||||
#endif // MUJOCO_SRC_EXPERIMENTAL_FILAMENT_COMPAT_SCENE_BRIDGE_H_
|
||||
+2
-5
@@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include "experimental/filament/filament/scene_geom_util.h"
|
||||
#include "experimental/filament/compat/scene_geom_util.h"
|
||||
|
||||
#include <cmath>
|
||||
#include <cstdint>
|
||||
@@ -22,20 +22,17 @@
|
||||
|
||||
#include <filament/Material.h>
|
||||
#include <filament/RenderableManager.h>
|
||||
#include <filament/Scene.h>
|
||||
#include <filament/Texture.h>
|
||||
#include <filament/TransformManager.h>
|
||||
#include <math/mat4.h>
|
||||
#include <math/vec2.h>
|
||||
#include <math/vec3.h>
|
||||
#include <math/vec4.h>
|
||||
#include <utils/Entity.h>
|
||||
#include <mujoco/mjvisualize.h>
|
||||
#include <mujoco/mujoco.h>
|
||||
#include "experimental/filament/compat/model_objects.h"
|
||||
#include "experimental/filament/filament/material.h"
|
||||
#include "experimental/filament/filament/math_util.h"
|
||||
#include "experimental/filament/filament/mesh.h"
|
||||
#include "experimental/filament/filament/model_objects.h"
|
||||
#include "experimental/filament/filament/object_manager.h"
|
||||
#include "experimental/filament/filament/renderable.h"
|
||||
#include "experimental/filament/filament/texture.h"
|
||||
+4
-5
@@ -12,14 +12,13 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#ifndef MUJOCO_SRC_EXPERIMENTAL_FILAMENT_FILAMENT_SCENE_GEOM_UTIL_H_
|
||||
#define MUJOCO_SRC_EXPERIMENTAL_FILAMENT_FILAMENT_SCENE_GEOM_UTIL_H_
|
||||
#ifndef MUJOCO_SRC_EXPERIMENTAL_FILAMENT_COMPAT_SCENE_GEOM_UTIL_H_
|
||||
#define MUJOCO_SRC_EXPERIMENTAL_FILAMENT_COMPAT_SCENE_GEOM_UTIL_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <mujoco/mjvisualize.h>
|
||||
#include "experimental/filament/filament/material.h"
|
||||
#include "experimental/filament/filament/model_objects.h"
|
||||
#include "experimental/filament/compat/model_objects.h"
|
||||
#include "experimental/filament/filament/object_manager.h"
|
||||
#include "experimental/filament/filament/renderable.h"
|
||||
|
||||
@@ -32,4 +31,4 @@ std::unique_ptr<Renderable> CreateGeomRenderable(
|
||||
|
||||
} // namespace mujoco
|
||||
|
||||
#endif // MUJOCO_SRC_EXPERIMENTAL_FILAMENT_FILAMENT_SCENE_GEOM_UTIL_H_
|
||||
#endif // MUJOCO_SRC_EXPERIMENTAL_FILAMENT_COMPAT_SCENE_GEOM_UTIL_H_
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <mujoco/mjrender.h>
|
||||
#include <mujoco/mjvisualize.h>
|
||||
#include <mujoco/mujoco.h>
|
||||
#include "experimental/filament/filament/mjr_filament_renderer.h"
|
||||
#include "experimental/filament/compat/mjr_filament_renderer.h"
|
||||
|
||||
|
||||
#if defined(TLS_FILAMENT_CONTEXT)
|
||||
|
||||
Reference in New Issue
Block a user