Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to spawn/destroy lights and control light parameters #3991

Merged
merged 10 commits into from
Nov 11, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix Unity build
adding stub for new setLightIntensity API
  • Loading branch information
zimmy87 committed Nov 11, 2021
commit 9259b827a54b3eb1ab5af795a16f9cb7911d17c4
8 changes: 8 additions & 0 deletions Unity/AirLibWrapper/AirsimWrapper/Source/WorldSimApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ void WorldSimApi::printLogMessage(const std::string& message, const std::string&
PrintLogMessage(message.c_str(), message_param.c_str(), "", severity);
}

bool WorldSimApi::setLightIntensity(const std::string& light_name, float intensity)
{
throw std::invalid_argument(common_utils::Utils::stringf(
"setLightIntensity is not supported on unity")
.c_str());
return false;
}

std::unique_ptr<std::vector<std::string>> WorldSimApi::swapTextures(const std::string& tag, int tex_id, int component_id, int material_id)
{
std::unique_ptr<std::vector<std::string>> result;
Expand Down
3 changes: 2 additions & 1 deletion Unity/AirLibWrapper/AirsimWrapper/Source/WorldSimApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class WorldSimApi : public msr::airlib::WorldSimApiBase

// ------ Level setting apis ----- //
virtual bool loadLevel(const std::string& level_name) override { return false; };
virtual std::string spawnObject(std::string& object_name, const std::string& load_component, const Pose& pose, const Vector3r& scale, bool physics_enabled) override { return ""; };
virtual std::string spawnObject(const std::string& object_name, const std::string& load_component, const Pose& pose, const Vector3r& scale, bool physics_enabled, bool is_blueprint) override { return ""; };
virtual bool destroyObject(const std::string& object_name) override { return false; };

virtual bool isPaused() const override;
Expand All @@ -37,6 +37,7 @@ class WorldSimApi : public msr::airlib::WorldSimApiBase
virtual void printLogMessage(const std::string& message,
const std::string& message_param = "", unsigned char severity = 0) override;

virtual bool setLightIntensity(const std::string& light_name, float intensity) override;
virtual std::unique_ptr<std::vector<std::string>> swapTextures(const std::string& tag, int tex_id = 0, int component_id = 0, int material_id = 0) override;
virtual bool setObjectMaterial(const std::string& object_name, const std::string& material_name) override;
virtual bool setObjectMaterialFromTexture(const std::string& object_name, const std::string& texture_path) override;
Expand Down