ZeroZero Game Engine  v0.0
A 3D game engine using Vulkan & Jolt
Public Member Functions | List of all members
SpotLight Class Reference

Detailed Description

A spotlight, such as a spotlight or a lantern.

Inheritance diagram for SpotLight:
OmniLight Light Node Object

Public Member Functions

 SpotLight (const string &name=TypeNames[SPOT_LIGHT])
 
 SpotLight (float cutOffDegrees, float outerCutOffDegrees, float range, vec4 color={1.0f, 1.0f, 1.0f, 1.0f}, const string &nodeName=TypeNames[SPOT_LIGHT])
 
auto setCutOff (const float cutOffDegrees)
 
auto getCutOff () const
 
void setOuterCutOff (float outerCutOffDegrees)
 
auto getOuterCutOff () const
 
auto getFov () const
 
void setProperty (const string &property, const string &value) override
 
- Public Member Functions inherited from OmniLight
 OmniLight (const string &name=TypeNames[OMNI_LIGHT], Type type=OMNI_LIGHT)
 
 OmniLight (float range, vec4 color={1.0f, 1.0f, 1.0f, 1.0f}, const string &nodeName=TypeNames[OMNI_LIGHT], Type type=OMNI_LIGHT)
 
auto getRange () const
 
void setRange (float range)
 
auto getNearClipDistance () const
 
- Public Member Functions inherited from Light
const auto & getColorAndIntensity () const
 
void setColorAndIntensity (const vec4 colorAndIntensity)
 
auto getCastShadows () const
 
void setCastShadows (bool castShadows)
 
auto getLightType () const
 
- Public Member Functions inherited from Node
 Node (const Node &orig)
 
 Node (const string &nodeName="Node", Type type=NODE)
 
virtual void onReady ()
 
virtual void onEnterScene ()
 
virtual void onExitScene ()
 
virtual void onProcess (const float alpha)
 
virtual void onPhysicsProcess (const float delta)
 
virtual bool onInput (InputEvent &inputEvent)
 
const mat4 & getTransformLocal () const
 
const mat4 & getTransformGlobal () const
 
vec3 toGlobal (vec3 local) const
 
vec3 toLocal (vec3 global) const
 
virtual void setPosition (vec3 position)
 
vec3 getPosition () const
 
void translate (const vec3 &localOffset)
 
virtual void setPositionGlobal (const vec3 &position)
 
vec3 getPositionGlobal () const
 
void rotate (quat quaternion)
 
void rotateTowards (const quat &targetRotation, float maxAngle)
 
void rotateX (float angle)
 
void rotateY (float angle)
 
void rotateZ (float angle)
 
void setRotation (const quat &quater)
 
void setRotationGlobal (const quat &quater)
 
void setRotation (const vec3 &rot)
 
void setRotationX (float angle)
 
void setRotationY (float angle)
 
void setRotationZ (float angle)
 
vec3 getRotation () const
 
vec3 getRotationGlobal () const
 
quat getRotationQuaternion () const
 
quat getRotationQuaternionGlobal () const
 
float getRotationX () const
 
float getRotationY () const
 
float getRotationZ () const
 
virtual void setScale (const vec3 &scale)
 
void setScale (float scale)
 
vec3 getScale () const
 
vec3 getScaleGlobal () const
 
ProcessMode getProcessMode () const
 
void setProcessMode (const ProcessMode mode)
 
bool isProcessed () const
 
Node * getParent () const
 
bool addChild (shared_ptr< Node > child, bool async=false)
 
bool removeChild (const shared_ptr< Node > &child, bool async=false)
 
void removeAllChildren (bool async=false)
 
bool haveChild (const shared_ptr< Node > &child, bool recursive) const
 
template<typename T = Node>
shared_ptr< T > getChild (const string &name) const
 
template<typename T = Node>
shared_ptr< T > getChildByPath (const string &path) const
 
template<typename T = Node>
shared_ptr< T > findFirstChild (const string &name) const
 
void printTree (int tab=0) const
 
string toString () const override
 
id_t getId () const
 
shared_ptr< Node > duplicate (bool recursiveFilter=false) const
 
template<typename T = Node>
shared_ptr< T > makeFrom ()
 
template<typename T >
shared_ptr< T > findFirstChild (const bool recursive=true) const
 
template<typename T >
list< shared_ptr< T > > findAllChildren (const bool recursive=true) const
 
template<typename T = Node>
list< shared_ptr< T > > findAllChildrenByGroup (const string &groupName, const bool recursive=true) const
 
vec3 getRightVector () const
 
vec3 getLeftVector () const
 
vec3 getFrontVector () const
 
vec3 getBackVector () const
 
vec3 getUpVector () const
 
vec3 getDownVector () const
 
template<typename T >
shared_ptr< TweencreatePropertyTween (PropertyTween< T >::Setter set, T initial, T final, float duration, const TransitionType ttype=TransitionType::LINEAR, const Tween::Callback &callback=nullptr)
 
void killTween (const shared_ptr< Tween > &tween)
 
void setName (const string &nodeName)
 
const list< shared_ptr< Node > > & getChildren () const
 
Type getType () const
 
const string & getName () const
 
string getPath () const
 
const list< string > & getGroups () const
 
void addToGroup (const string &group)
 
void removeFromGroup (const string &group)
 
bool isInGroup (const string &group) const
 
bool isVisible () const
 
virtual void setVisible (bool visible=true)
 
bool isInsideTree () const
 
void setCastShadows (bool castShadows)
 
- Public Member Functions inherited from Object
void connect (const Signal::signal &name, const Signal::Handler &handler)
 
void connect (const Signal::signal &name, const function< void ()> &handler)
 
void emit (const Signal::signal &name, void *params=nullptr)
 

Additional Inherited Members

- Public Types inherited from Light
enum  LightType
 
- Public Types inherited from Node
enum  Type
 Node type.
 

Constructor & Destructor Documentation

SpotLight ( const string &  name = TypeNames[SPOT_LIGHT])
explicit

Creates a SpotLight with default parameters

SpotLight ( float  cutOffDegrees,
float  outerCutOffDegrees,
float  range,
vec4  color = {1.0f, 1.0f, 1.0f, 1.0f},
const string &  nodeName = TypeNames[SPOT_LIGHT] 
)
explicit

Create a SpotLight.

Parameters
cutOffDegreesthe inner cutoff angle that specifies the spotlight's radius, in degrees
outerCutOffDegreesthe outer cutoff angle that specifies the spotlight's radius, in degrees. Everything outside this angle is not lit by the spotlight.
rangeRadius of the light and shadows
colorthe RGB color and intensity
nodeNameNode name

Member Function Documentation

auto getCutOff ( ) const
nodiscardinline

Returns the inner cutoff value that specifies the spotlight's radius (not the angle!)

auto getFov ( ) const
nodiscardinline

Returns the field of view of the spotlight, in radians

auto getOuterCutOff ( ) const
nodiscardinline

Returns the outer cutoff value that specifies the spotlight's radius (not the angle!).

auto setCutOff ( const float  cutOffDegrees)
inline

Sets the inner cutoff angle that specifies the spotlight's radius, in degrees

void setOuterCutOff ( float  outerCutOffDegrees)

Sets the outer cutoff angle that specifies the spotlight's radius. Everything outside this angle is not lit by the spotlight.

void setProperty ( const string &  property,
const string &  value 
)
overridevirtual

Sets a property by is name and value. Currently, not all properties in all nodes classes are supported.

Reimplemented from z0::OmniLight::setProperty()