Added setambientlight command.
This commit is contained in:
parent
8fd644a4df
commit
da1249cdbd
|
@ -321,6 +321,12 @@ Command* CommandParser::parseCommand()
|
|||
paramList->getNumber("magnitude", mag);
|
||||
cmd = new CommandSetVisibilityLimit(mag);
|
||||
}
|
||||
else if (commandName == "setambientlight")
|
||||
{
|
||||
double brightness = 0.0;
|
||||
paramList->getNumber("brightness", brightness);
|
||||
cmd = new CommandSetAmbientLight((float) brightness);
|
||||
}
|
||||
else
|
||||
{
|
||||
error("Unknown command name '" + commandName + "'");
|
||||
|
|
|
@ -148,6 +148,31 @@ void CommandSynchronous::process(ExecutionEnvironment& env)
|
|||
}
|
||||
|
||||
|
||||
////////////////
|
||||
// Chase command:
|
||||
|
||||
CommandChase::CommandChase()
|
||||
{
|
||||
}
|
||||
|
||||
void CommandChase::process(ExecutionEnvironment& env)
|
||||
{
|
||||
env.getSimulation()->chase();
|
||||
}
|
||||
|
||||
////////////////
|
||||
// Lock command:
|
||||
|
||||
CommandLock::CommandLock()
|
||||
{
|
||||
}
|
||||
|
||||
void CommandLock::process(ExecutionEnvironment& env)
|
||||
{
|
||||
env.getSimulation()->follow();
|
||||
}
|
||||
|
||||
|
||||
////////////////
|
||||
// Cancel command: cancel a follow or goto command
|
||||
|
||||
|
@ -364,3 +389,19 @@ void CommandSetVisibilityLimit::process(ExecutionEnvironment& env)
|
|||
}
|
||||
env.getSimulation()->setFaintestVisible(magnitude);
|
||||
}
|
||||
|
||||
|
||||
////////////////
|
||||
// Set ambient light command
|
||||
|
||||
CommandSetAmbientLight::CommandSetAmbientLight(float level) :
|
||||
lightLevel(level)
|
||||
{
|
||||
}
|
||||
|
||||
void CommandSetAmbientLight::process(ExecutionEnvironment& env)
|
||||
{
|
||||
Renderer* r = env.getRenderer();
|
||||
if (r != NULL)
|
||||
r->setAmbientLightLevel(lightLevel);
|
||||
}
|
||||
|
|
|
@ -143,6 +143,28 @@ class CommandSynchronous : public InstantaneousCommand
|
|||
};
|
||||
|
||||
|
||||
class CommandLock : public InstantaneousCommand
|
||||
{
|
||||
public:
|
||||
CommandLock();
|
||||
void process(ExecutionEnvironment&);
|
||||
|
||||
private:
|
||||
int dummy;
|
||||
};
|
||||
|
||||
|
||||
class CommandChase : public InstantaneousCommand
|
||||
{
|
||||
public:
|
||||
CommandChase();
|
||||
void process(ExecutionEnvironment&);
|
||||
|
||||
private:
|
||||
int dummy;
|
||||
};
|
||||
|
||||
|
||||
class CommandCancel : public InstantaneousCommand
|
||||
{
|
||||
public:
|
||||
|
@ -300,5 +322,16 @@ class CommandSetVisibilityLimit : public InstantaneousCommand
|
|||
};
|
||||
|
||||
|
||||
class CommandSetAmbientLight : public InstantaneousCommand
|
||||
{
|
||||
public:
|
||||
CommandSetAmbientLight(float);
|
||||
void process(ExecutionEnvironment&);
|
||||
|
||||
private:
|
||||
float lightLevel;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif // _COMMAND_H_
|
||||
|
|
Loading…
Reference in a new issue