Skip to content

Commit

Permalink
Samples: use modern controller creation API
Browse files Browse the repository at this point in the history
  • Loading branch information
paroj committed Sep 19, 2024
1 parent 1e2386a commit d208de4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
10 changes: 5 additions & 5 deletions Samples/Simple/include/Grass.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class _OgreSampleClassExport Sample_Grass : public SdkSample
{
public:

LightPulse(Light* light, Billboard* billboard, const ColourValue& maxColour, Real maxSize)
LightPulse(Light* light, Billboard* billboard, const ColourValue& maxColour, float maxSize)
{
mLight = light;
mBillboard = billboard;
Expand Down Expand Up @@ -92,8 +92,8 @@ class _OgreSampleClassExport Sample_Grass : public SdkSample
Light* mLight;
Billboard* mBillboard;
ColourValue mMaxColour;
Real mMaxSize;
Real mIntensity;
float mMaxSize;
float mIntensity;
};

void setupContent() override
Expand Down Expand Up @@ -220,8 +220,8 @@ class _OgreSampleClassExport Sample_Grass : public SdkSample
Billboard* bb = bbs->createBillboard(0, 0, 0, lightColour);

// create a controller for the light intensity, using our LightPulsator class
ControllerFunctionRealPtr func(OGRE_NEW WaveformControllerFunction(Ogre::WFT_SINE, 0.5, 0.5, 0, 0.5));
ControllerValueRealPtr dest(OGRE_NEW LightPulse(light, bb, lightColour, 15));
auto func = WaveformControllerFunction::create(WFT_SINE, 0.5, 0.5, 0, 0.5);
auto dest = std::make_shared<LightPulse>(light, bb, lightColour, 15.0f);
ControllerManager& cm = ControllerManager::getSingleton();
mLightController = cm.createController(cm.getFrameTimeSource(), dest, func);

Expand Down
12 changes: 5 additions & 7 deletions Samples/Simple/include/Shadows.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,12 @@ class _OgreSampleClassExport Sample_Shadows : public SdkSample
mLightNode->attachObject(bbs);

// create controller, after this is will get updated on its own
ControllerFunctionRealPtr func = WaveformControllerFunction::create(Ogre::WFT_SINE, 0.75, 0.5);
auto func = WaveformControllerFunction::create(WFT_SINE, 0.75, 0.5);
auto dst =
std::make_shared<LightWibbler>(mLight, bb, mMinLightColour, mMaxLightColour, mMinFlareSize, mMaxFlareSize);
ControllerManager& contMgr = ControllerManager::getSingleton();
ControllerValueRealPtr val = ControllerValueRealPtr(
new LightWibbler(mLight, bb, mMinLightColour, mMaxLightColour,
mMinFlareSize, mMaxFlareSize));
mController = contMgr.createController(
contMgr.getFrameTimeSource(), val, func);

mController = contMgr.createController(contMgr.getFrameTimeSource(), dst, func);

//mLight->setPosition(Vector3(300,250,-300));
mLightNode->setPosition(Vector3(300,1750,-700));

Expand Down

0 comments on commit d208de4

Please sign in to comment.