Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 9 additions & 0 deletions radiant/ui/animationpreview/AnimationPreview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,15 @@ void AnimationPreview::setupSceneGraph()

// This entity is acting as our root node in the scene
getScene()->setRoot(_root);

auto lightClass = GlobalEntityClassManager().findClass("light");
if (lightClass)
{
_light = GlobalEntityModule().createEntity(lightClass);
_light->tryGetEntity()->setKeyValue("light_radius", "750 750 750");
_light->tryGetEntity()->setKeyValue("origin", "150 150 150");
_root->addChildNode(_light);
}
}

void AnimationPreview::onModelRotationChanged()
Expand Down
3 changes: 3 additions & 0 deletions radiant/ui/animationpreview/AnimationPreview.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ class AnimationPreview :
// Each model node needs a parent entity to be properly renderable
EntityNodePtr _entity;

// Light to illuminate the model in lighting mode
scene::INodePtr _light;

// The animation to play on this model
md5::IMD5AnimPtr _anim;

Expand Down