Skip to content

Commit

Permalink
make sun movable
Browse files Browse the repository at this point in the history
  • Loading branch information
sytelus committed Mar 2, 2018
1 parent 695d8ac commit 15702df
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions Unreal/Plugins/AirSim/Source/SimMode/SimModeBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,22 +79,14 @@ void ASimModeBase::setupTimeOfDay()

if (sky_spheres.Num() >= 1) {
sky_sphere_ = sky_spheres[0];
//for (TFieldIterator<UProperty> PropIt(sky_sphere_->GetClass()); PropIt; ++PropIt)
//{
// // We are iterating over all properties of Actor
// UProperty* Property{ *PropIt };
// FString PropertyName{ GetNameSafe(Property) };
// std::string MyStdString(TCHAR_TO_UTF8(*PropertyName));
// Utils::log(MyStdString);
//}
static const FName sun_prop_name(TEXT("Directional light actor"));
auto* p = sky_sphere_class_->FindPropertyByName(sun_prop_name);
UObjectProperty* sun_prop = Cast<UObjectProperty>( p);
UObject* sun_obj = sun_prop->GetObjectPropertyValue_InContainer(sky_sphere_);
sun_ = Cast<ADirectionalLight>(sun_obj);
//if (sun_) {
// sun_->GetRootComponent()->Mobility = EComponentMobility::Movable;
//}
if (sun_) {
sun_->GetRootComponent()->Mobility = EComponentMobility::Movable;
}

tod_sim_clock_start_ = ClockFactory::get()->nowNanos();
tod_last_update_ = 0;
Expand Down

0 comments on commit 15702df

Please sign in to comment.