24#include <OgreSceneManager.h>
57 light->setType(Ogre::Light::LT_POINT);
59 light->setType(Ogre::Light::LT_DIRECTIONAL);
61 light->setType(Ogre::Light::LT_SPOTLIGHT);
65 catch (Ogre::Exception &e)
67 ReportError(
"Error creating light:\n" + e.getDescription());
70 std::string type_name =
"point";
72 type_name =
"directional";
74 type_name =
"spotlight";
77 Report(
"Light '" + name +
"' created as type " + type_name);
91 if (type ==
"ElevatorCar")
93 else if (type ==
"Floor")
95 else if (type ==
"Shaft Level")
97 else if (type ==
"Stairwell Level")
99 else if (type ==
"SBS")
107 light->setDiffuseColour(color_r, color_g, color_b);
112 light->setSpecularColour(color_r, color_g, color_b);
117 light->setAttenuation(
sbs->
ToRemote(att_range), att_constant, att_linear, att_quadratic);
123 light->setSpotlightRange(
Degree(spot_inner_angle),
Degree(spot_outer_angle), spot_falloff);
138 light->setVisible(value);
143 return light->getVisible();
void SetDirection(const Vector3 &direction)
void SetRenderingDistance(Real distance)
Light(Object *parent, const std::string &name, int type)
void SetColor(Real color_r=1.0f, Real color_g=1.0f, Real color_b=1.0f)
void SetAttenuation(Real att_range=100000.f, Real att_constant=1.f, Real att_linear=0.f, Real att_quadratic=0.f)
void SetSpotlightRange(Real spot_inner_angle=30.f, Real spot_outer_angle=40.f, Real spot_falloff=1.f)
void SetSpecularColor(Real color_r=0.0f, Real color_g=0.0f, Real color_b=0.0f)
virtual bool ReportError(const std::string &message)
virtual void Report(const std::string &message)
SceneNode * GetSceneNode()
void SetValues(const std::string &type, const std::string &name, bool is_permanent, bool is_movable=true)
const std::string & GetType()
Ogre::SceneManager * mSceneManager
void RemoveLight(Light *light)
Real ToRemote(Real local_value)
void DetachObject(Ogre::MovableObject *object)
void AttachObject(Ogre::MovableObject *object)
void SetDirection(const Vector3 &direction)