Remove ObjectManager dependency from Light.

PiperOrigin-RevId: 890454094
Change-Id: Idb609ad6d8ed7df714cad7b0aca997fee73ab96d
This commit is contained in:
Haroon Qureshi
2026-03-27 07:57:12 -07:00
committed by Copybara-Service
parent 75bbf03cfb
commit e17e3bfd82
3 changed files with 5 additions and 7 deletions
+2 -3
View File
@@ -23,12 +23,11 @@
#include <utils/Entity.h>
#include <utils/EntityManager.h>
#include <mujoco/mujoco.h>
#include "experimental/filament/filament/object_manager.h"
namespace mujoco {
Light::Light(ObjectManager* object_mgr, const Params& params)
: engine_(object_mgr->GetEngine()), params_(params) {
Light::Light(filament::Engine* engine, const Params& params)
: engine_(engine), params_(params) {
filament::LightManager::Type type;
switch (params.type) {
case mjLIGHT_SPOT:
+1 -2
View File
@@ -20,7 +20,6 @@
#include <math/vec3.h>
#include <utils/Entity.h>
#include <mujoco/mujoco.h>
#include "experimental/filament/filament/object_manager.h"
namespace mujoco {
@@ -51,7 +50,7 @@ class Light {
bool headlight = false;
};
Light(ObjectManager* object_mgr, const Params& params);
Light(filament::Engine* engine, const Params& params);
~Light() noexcept;
Light(const Light&) = delete;
@@ -390,7 +390,7 @@ void SceneView::PrepareLights() {
params.spot_cone_angle = model->light_cutoff[i];
}
auto light_obj = std::make_unique<Light>(object_mgr_, params);
auto light_obj = std::make_unique<Light>(engine_, params);
#ifndef __EMSCRIPTEN__
// TODO(b/458045799): Re-enable when lights work on glinux and chromebook.
light_obj->AddToScene(scene_);
@@ -408,7 +408,7 @@ void SceneView::PrepareLights() {
params.type = mjLIGHT_DIRECTIONAL;
params.castshadow = 0;
params.intensity = 0;
auto light_obj = std::make_unique<Light>(object_mgr_, params);
auto light_obj = std::make_unique<Light>(engine_, params);
#ifndef __EMSCRIPTEN__
// TODO(b/458045799): Re-enable when lights work on glinux and chromebook.
light_obj->AddToScene(scene_);