Remove ObjectManager dependency from Light.
PiperOrigin-RevId: 890454094 Change-Id: Idb609ad6d8ed7df714cad7b0aca997fee73ab96d
This commit is contained in:
committed by
Copybara-Service
parent
75bbf03cfb
commit
e17e3bfd82
@@ -23,12 +23,11 @@
|
|||||||
#include <utils/Entity.h>
|
#include <utils/Entity.h>
|
||||||
#include <utils/EntityManager.h>
|
#include <utils/EntityManager.h>
|
||||||
#include <mujoco/mujoco.h>
|
#include <mujoco/mujoco.h>
|
||||||
#include "experimental/filament/filament/object_manager.h"
|
|
||||||
|
|
||||||
namespace mujoco {
|
namespace mujoco {
|
||||||
|
|
||||||
Light::Light(ObjectManager* object_mgr, const Params& params)
|
Light::Light(filament::Engine* engine, const Params& params)
|
||||||
: engine_(object_mgr->GetEngine()), params_(params) {
|
: engine_(engine), params_(params) {
|
||||||
filament::LightManager::Type type;
|
filament::LightManager::Type type;
|
||||||
switch (params.type) {
|
switch (params.type) {
|
||||||
case mjLIGHT_SPOT:
|
case mjLIGHT_SPOT:
|
||||||
|
|||||||
@@ -20,7 +20,6 @@
|
|||||||
#include <math/vec3.h>
|
#include <math/vec3.h>
|
||||||
#include <utils/Entity.h>
|
#include <utils/Entity.h>
|
||||||
#include <mujoco/mujoco.h>
|
#include <mujoco/mujoco.h>
|
||||||
#include "experimental/filament/filament/object_manager.h"
|
|
||||||
|
|
||||||
namespace mujoco {
|
namespace mujoco {
|
||||||
|
|
||||||
@@ -51,7 +50,7 @@ class Light {
|
|||||||
bool headlight = false;
|
bool headlight = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
Light(ObjectManager* object_mgr, const Params& params);
|
Light(filament::Engine* engine, const Params& params);
|
||||||
~Light() noexcept;
|
~Light() noexcept;
|
||||||
|
|
||||||
Light(const Light&) = delete;
|
Light(const Light&) = delete;
|
||||||
|
|||||||
@@ -390,7 +390,7 @@ void SceneView::PrepareLights() {
|
|||||||
params.spot_cone_angle = model->light_cutoff[i];
|
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__
|
#ifndef __EMSCRIPTEN__
|
||||||
// TODO(b/458045799): Re-enable when lights work on glinux and chromebook.
|
// TODO(b/458045799): Re-enable when lights work on glinux and chromebook.
|
||||||
light_obj->AddToScene(scene_);
|
light_obj->AddToScene(scene_);
|
||||||
@@ -408,7 +408,7 @@ void SceneView::PrepareLights() {
|
|||||||
params.type = mjLIGHT_DIRECTIONAL;
|
params.type = mjLIGHT_DIRECTIONAL;
|
||||||
params.castshadow = 0;
|
params.castshadow = 0;
|
||||||
params.intensity = 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__
|
#ifndef __EMSCRIPTEN__
|
||||||
// TODO(b/458045799): Re-enable when lights work on glinux and chromebook.
|
// TODO(b/458045799): Re-enable when lights work on glinux and chromebook.
|
||||||
light_obj->AddToScene(scene_);
|
light_obj->AddToScene(scene_);
|
||||||
|
|||||||
Reference in New Issue
Block a user