Ocular Engine
Ocular::Core::LightSource Class Reference
Inheritance diagram for Ocular::Core::LightSource:
Ocular::Core::SceneObject Ocular::Core::Object Ocular::Core::ObjectIO Ocular::Core::Exposable Ocular::Core::Buildable Ocular::Core::DirectionalLight Ocular::Core::PointLight Ocular::Core::SpotLight

Public Member Functions

virtual void onLoad (BuilderNode const *node) override
void setColor (Core::Color const &color)
Color getColor () const
void setIntensity (float intensity)
float getIntensity () const
void setRange (float range)
float getRange () const
void setAttenuation (Math::Vector3f const &attenuation)
Math::Vector3f getAttenuation () const
void setAngle (float angle)
float getAngle () const
float getLightType () const
- Public Member Functions inherited from Ocular::Core::SceneObject
 SceneObject (std::string const &name, SceneObject *parent=nullptr, std::string const &type="SceneObject")
 SceneObject ()
virtual ~SceneObject ()
virtual void onVariableModified (std::string const &varName) override
Math::TransformgetTransform ()
void setActive (bool active)
bool isActive () const
void setVisible (bool visible)
bool isVisible () const
void setForcedVisible (bool forced)
bool isForcedVisible () const
void setStatic (bool isStatic)
bool isStatic () const
void setPersistent (bool persists)
bool isPersistent () const
Graphics::UniformPerObject const & getUniformData (Math::Matrix4x4 const &viewMatrix, Math::Matrix4x4 const &projMatrix)
void setPosition (float x, float y, float z)
void setPosition (Math::Vector3f const &position)
Math::Vector3f getPosition (bool local=true) const
void translate (Math::Vector3f const &translation, bool local=true)
void rotate (float angle, Math::Vector3f const &axis)
void rotate (Math::Quaternion const &rotation)
void setRotation (Math::Quaternion const &rotation)
void resetRotation ()
Math::Quaternion const & getRotation () const
void setScale (Math::Vector3f const &scale)
void setScale (float xScale, float yScale, float zScale)
Math::Vector3f getScale (bool local=true) const
void setTransform (Math::Transform const &transform)
void lookAt (Math::Vector3f const &point)
Math::Transform const & getTransform () const
virtual Math::Matrix4x4 getModelMatrix (bool local=true) const
void setParent (SceneObject *parent, bool maintainWorldPos=true)
SceneObjectgetParent () const
SceneObjectcreateChild (std::string const &name)
void addChild (SceneObject *child, bool maintainWorldPos=true)
SceneObjectfindChild (std::string const &name)
SceneObjectfindChild (UUID const &uuid)
SceneObjectremoveChild (std::string const &name)
SceneObjectremoveChild (UUID const &uuid)
SceneObjectremoveChild (SceneObject const *object)
uint32_t getNumChildren () const
std::vector< SceneObject * > const & getAllChildren () const
ARoutineaddRoutine (std::string const &name)
void addRoutine (ARoutine *routine)
template<class T >
T * addRoutine ()
bool removeRoutine (std::string const &name)
bool removeRoutine (ARoutine *routine, bool transferring=false)
void removeAllRoutines ()
ARoutinegetRoutine (std::string const &name)
std::vector< ARoutine * > const & getAllRoutines () const
uint32_t getNumRoutines () const
ARenderablesetRenderable (std::string const &name)
void setRenderable (ARenderable *renderable)
template<class T >
T * setRenderable ()
void removeRenderable (bool transferring=false)
ARenderablegetRenderable () const
virtual void onSave (BuilderNode *node) const override
void forceBoundsRebuild ()
Math::BoundsSphere getBoundsSphere (bool local)
Math::BoundsAABB getBoundsAABB (bool local)
Math::BoundsOBB getBoundsOBB (bool local)
- Public Member Functions inherited from Ocular::Core::Object
 Object (std::string name, std::string className)
 Creates a new Object with the specified name and class. More...
 Object (std::string name)
 Creates a new Object with the specified name. More...
 Object ()
 Creates a new Object with the default name ('Name').
std::string const & getName () const
void setName (std::string name)
 Sets the name of the Object. More...
std::string const & getClass () const
void setUUID (std::string const &uuid)
UUID const & getUUID () const
int64_t getCreationTime () const
virtual std::string toString () const
template<class T >
bool isType ()
- Public Member Functions inherited from Ocular::Core::Exposable
void getAllExposedNames (std::vector< std::string > &names) const
bool getVariable (std::string const &name, ExposedVariable &var)
template<typename T >
bool getVariableValue (std::string const &name, T &var)
template<typename T >
bool setVariableValue (std::string const &name, T const &value)

Protected Member Functions

 LightSource (std::string const &name, SceneObject *parent, std::string const &type)
- Protected Member Functions inherited from Ocular::Core::SceneObject
void getModelMatrix (Math::Matrix4x4 &matrix)
virtual void updateBounds (uint32_t dirtyFlags)
- Protected Member Functions inherited from Ocular::Core::Exposable
void exposeVariable (std::string const &name, std::string const &type, bool isPointer, bool isExposed, void *data)

Protected Attributes

Color m_Color
Math::Vector3f m_Attenuation
float m_Intensity
float m_Range
float m_Angle
float m_LightType
- Protected Attributes inherited from Ocular::Core::SceneObject
uint32_t m_Layer
 The render layer this object is part of.
Graphics::UniformPerObject m_UniformData
Math::Transform m_Transform
Math::BoundsSphere m_BoundsSphereLocal
Math::BoundsAABB m_BoundsAABBLocal
Math::BoundsOBB m_BoundsOBBLocal
Math::BoundsSphere m_BoundsSphereWorld
Math::BoundsAABB m_BoundsAABBWorld
Math::BoundsOBB m_BoundsOBBWorld
- Protected Attributes inherited from Ocular::Core::Object
std::string m_Name
std::string m_Class
const int64_t m_CreationTime
- Protected Attributes inherited from Ocular::Core::Exposable
std::unordered_map< std::string, ExposedVariablem_ExposedVariables

Member Function Documentation

float Ocular::Core::LightSource::getAngle ( ) const
The angle (degrees) at the source of the light. Used only by spot lights.
Color Ocular::Core::LightSource::getColor ( ) const
The color of the light source.
float Ocular::Core::LightSource::getIntensity ( ) const
The intensity of the light source. This is the amount of energy that it outputs in lumens.
float Ocular::Core::LightSource::getLightType ( ) const
0 = none; 1 = point; 2 = spot; 3 = directional
float Ocular::Core::LightSource::getRange ( ) const
The range of the light source. For point lights this is the radius. Not used by directional lights.
void Ocular::Core::LightSource::onLoad ( BuilderNode const *  node)

Alternate creation method (opposed to the constructor) in which one is provided with a BuilderNode chain. This chain may be explored to retrieve any relevant variables, and their values, that may have been stored in it.

This method will typically mirror the onSave, in which relevant values are stored within the chain.

[in]nodeNode to extract variable information from

Reimplemented from Ocular::Core::SceneObject.

void Ocular::Core::LightSource::setAngle ( float  angle)

Sets the angle at the source of the light. Used only by spot lights.

[in]angleAngle in degrees.
void Ocular::Core::LightSource::setColor ( Core::Color const &  color)

Sets the light source's color.

void Ocular::Core::LightSource::setIntensity ( float  intensity)

Sets the light source's intensity. This is the amount of energy that it outputs in lumens.

void Ocular::Core::LightSource::setRange ( float  range)

Sets the light source's range. For point lights this is the radius. Not used by directional lights.


The documentation for this class was generated from the following files: