iMSTK
Interactive Medical Simulation Toolkit
|
A directional light has no position or range. The focal point is the direction. More...
#include <imstkDirectionalLight.h>
Public Member Functions | |
void | setDirection (const Vec3d &dir) |
Set the direction of the light. | |
void | setDirection (const double x, const double y, const double z) |
![]() | |
bool | isOn () const |
Get the status (On/off) of the light. | |
void | switchOn () |
Switch the light On. | |
void | switchOff () |
Switch the light Off. | |
const Color & | getColor () const |
Get the light color. | |
void | setColor (const Color &c) |
Set the light color. | |
double | getIntensity () const |
Get the light intensity. | |
void | setIntensity (const double intensity) |
Set the light intensity. This value is unbounded. | |
void | setAttenuationValues (const double a, const double b, const double c) |
Sets the attenuation values. Quadratic, linear, and constant c (ax^2+bx+c) (a,b,c) = {0,0,1} would be constant lighting, multiplied with intensity. | |
const Vec3d & | getAttenuationValues () const |
void | setFocalPoint (const Vec3d &p) |
Get/Set the light focal point. | |
void | setFocalPoint (const double x, const double y, const double z) |
const Vec3d & | getFocalPoint () const |
![]() | |
Entity (const std::string &name="Entity") | |
SIGNAL (Entity, modified) | |
EntityID | getID () const |
Get ID (ALWAYS query the ID in your code, DO NOT hardcode it) More... | |
virtual const std::string | getTypeName () const |
template<typename T > | |
std::shared_ptr< T > | addComponent () |
Create and return a component on this entity. | |
template<typename T > | |
std::shared_ptr< T > | addComponent (std::string name) |
void | addComponent (std::shared_ptr< Component > component) |
Add existing component to entity. | |
std::shared_ptr< Component > | getComponent (const unsigned int index) const |
Get a component by index. | |
template<typename T > | |
std::shared_ptr< T > | getComponent () const |
Get the first component of type T. | |
template<typename T > | |
std::shared_ptr< T > | getComponentN (const int index) const |
Get's the Nth component of type T. | |
template<class T > | |
bool | containsComponent () const |
Check if contains component of type T. | |
bool | containsComponent (std::shared_ptr< Component > component) const |
Check if contains given component. | |
template<typename T > | |
std::vector< std::shared_ptr< T > > | getComponents () const |
Get all components of type T. | |
const std::vector< std::shared_ptr< Component > > & | getComponents () |
void | removeComponent (std::shared_ptr< Component > component) |
Remove component if it exists. | |
const std::string & | getName () const |
Get/Set the name of the entity. | |
void | setName (const std::string &name) |
![]() | |
template<typename T > | |
void | postEvent (const T &e) |
Emits the event Direct observers will be immediately called, in sync Queued observers will receive the Command in their queue for later execution, reciever must implement doEvent. | |
template<typename T > | |
void | queueEvent (const T &e) |
Queues event directly to this. | |
void | doEvent () |
Do an event, if none exists return. | |
void | doAllEvents () |
Do all the events in the event queue. | |
void | foreachEvent (std::function< void(Command cmd)> func) |
Thread safe loop over all event commands, one can implement a custom handler. | |
void | rforeachEvent (std::function< void(Command cmd)> func) |
thread safe reverse loop over all event commands, one can implement a custom handler | |
void | clearEvents () |
Removes all events from queue cleans up copies of the event. | |
Additional Inherited Members | |
![]() | |
using | Observer = std::tuple< bool, std::weak_ptr< EventObject >, std::function< void(Event *)> > |
![]() | |
double | m_intensity = 1.0 |
Color | m_color = Color::White |
bool | m_switchState = true |
Vec3d | m_focalPoint = Vec3d::Zero() |
Vec3d | m_attenuation = Vec3d(1.0, 0.0, 0.0) |
c, b, a (ax^2+bx+c) | |
![]() | |
std::vector< std::shared_ptr< Component > > | m_components |
EntityID | m_ID |
unique ID of entity | |
std::string | m_name |
Not unique name. | |
![]() | |
ParallelUtils::SpinLock | eventQueueLock |
std::deque< Command > | eventQueue |
std::vector< std::pair< std::string, std::vector< Observer > > > | queuedObservers |
std::vector< std::pair< std::string, std::vector< Observer > > > | directObservers |
![]() | |
static std::atomic< EntityID > | m_count { 0 } |
current count of entities | |
A directional light has no position or range. The focal point is the direction.
Definition at line 20 of file imstkDirectionalLight.h.