|
V-ART
|
Represents a light source. More...
#include <light.h>
Public Member Functions | |
| Light () | |
| Light (const Light &light) | |
| Light (float i, float ai, Color c, bool o) | |
| Light (const std::string &newDescription, float newIntensity, float newAmbientIntensity, const Color &newColor, const Point4D &newLocation) | |
| virtual | ~Light () |
| virtual SceneNode * | Copy () |
| Returns a copy of an Light. Every derived class must reimplements this method, to avoid errors with VART::SceneNode::RecursiveCopy. More... | |
| Light & | operator= (const Light &light) |
| void | SetIntensity (float i) |
| float | GetIntensity () const |
| void | SetAmbientIntensity (float ai) |
| float | GetAmbientIntensity () const |
| void | SetColor (const Color &c) |
| Color | GetColor () const |
| void | Turn (bool on_off) |
| Turns a light on or off. More... | |
| bool | IsOn () const |
| virtual bool | RecursiveBoundingBox (BoundingBox *bBox) |
| Always returns false, therefore recursive bbox does not exist. More... | |
| void | SetLocation (const Point4D &newLocation) |
| Sets the location of the light. More... | |
| Point4D | GetLocation () const |
| Transform * | GetTransform () const |
| Gets a pointer to the light transform. More... | |
| virtual bool | DrawOGL (unsigned int oglLightID) const |
| Draws (sets up) a light using OpenGL commands. More... | |
| virtual void | DrawForPicking () const |
| Draws and object, setting pick info. More... | |
Public Member Functions inherited from VART::SceneNode | |
| SceneNode () | |
| Creates an uninitialized scene node. More... | |
| SceneNode (SceneNode &node) | |
| virtual | ~SceneNode () |
| SceneNode & | operator= (const SceneNode &node) |
| virtual SceneNode * | RecursiveCopy () |
| const std::string & | GetDescription () const |
| Returns a copy of the object's description. More... | |
| void | SetDescription (const std::string &desc) |
| Changes the object's description. More... | |
| void | AddChild (SceneNode &child) |
| Add a child at the end of child list. More... | |
| bool | DetachChild (SceneNode *childPtr) |
| Removes a child from the child list. More... | |
| virtual bool | DrawOGL () const |
| Recursive drawing using OpenGL commands. More... | |
| virtual TypeID | GetID () const |
| Returns type identification of the node. More... | |
| void | AutoDeleteChildren () const |
| Deletes (dealocate memory) recursively all children marked as 'autoDelete'. More... | |
| SceneNode * | FindChildByName (const std::string &name) const |
| Recusively searches its children for a given name. More... | |
| std::list< SceneNode * > | GetChilds () |
| bool | FindPathTo (SceneNode *targetPtr, SGPath *resultPtr) const |
| Search target among children. More... | |
| bool | FindPathTo (const std::string &targetName, SGPath *resultPtr) const |
| Search target among children. More... | |
| int | GetNodeTypeList (TypeID type, std::list< SceneNode * > &nodeList) |
| Find all the nodes of with typeID 'type'. More... | |
| virtual void | TraverseDepthFirst (SNOperator *operatorPtr) const |
| Process all children in depth-first order. More... | |
| virtual void | TraverseBreadthFirst (SNOperator *operatorPtr) const |
| Process all children in breadth-first order. More... | |
| virtual void | LocateDepthFirst (SNLocator *locatorPtr) const |
| Seaches for a particular scene node (depth first) More... | |
| virtual void | LocateBreadthFirst (SNLocator *locatorPtr) const |
| Seaches for a particular scene node (breadth first) More... | |
| virtual void | XmlPrintOn (std::ostream &os, unsigned int indent) const |
| Recursively outputs XML representation of the scene node. More... | |
Public Member Functions inherited from VART::MemoryObj | |
| MemoryObj () | |
| Default constructor. More... | |
| MemoryObj (const VART::MemoryObj &obj) | |
| Copy constructor. More... | |
Static Public Member Functions | |
| static const Light & | SUN () |
| White directional light towards negative Y. Small ambient intensity. More... | |
| static const Light & | BRIGHT_AMBIENT () |
| Strong, white ambient light. More... | |
Protected Member Functions | |
| unsigned int | getOpenGLID (unsigned int lightID) const |
Protected Member Functions inherited from VART::SceneNode | |
| virtual bool | DrawInstanceOGL () const |
| Non-recursive drawing - should be overriden by every derived class. More... | |
| bool | RecursiveFindPathTo (SceneNode *targetPtr, SGPath *resultPtr) const |
| Recursive auxiliar method for FindPathTo. More... | |
| bool | RecursiveFindPathTo (const std::string &targetName, SGPath *resultPtr) const |
| Recursive auxiliar method for FindPathTo. More... | |
Protected Attributes | |
| Transform * | transform |
| Point4D | location |
Protected Attributes inherited from VART::SceneNode | |
| std::list< SceneNode * > | childList |
| Child list. More... | |
| std::string | description |
| Textual identification. More... | |
Additional Inherited Members | |
Public Types inherited from VART::SceneNode | |
| enum | TypeID { NONE, GRAPHIC_OBJ, BOX, CONE, CURVE, BEZIER, CYLINDER, IMAGE, IMAGE_2D, VOLUME, MESH_OBJECT, SPHERE, JOINT, BIAXIAL_JOINT, CONDYLAR_JOINT, ELLIPSOID_JOINT, SADDLE_JOINT, PLANE_JOINT, POLYAXIAL_JOINT, UNIAXIAL_JOINT, HINGE_JOINT, PIVOT_JOINT, TRANSFORM } |
Public Attributes inherited from VART::MemoryObj | |
| bool | autoDelete |
Static Public Attributes inherited from VART::SceneNode | |
| static bool | recursivePrinting = true |
Represents a light source.
This class represents simple light sources, i.e.: directional lights or point lights with no attenuation. See the derived classes for more complex light sources. Lights can have children, but they should not.
| VART::Light::Light | ( | const Light & | light | ) |
Definition at line 52 of file light.cpp.
References VART::SceneNode::description, location, and transform.
| VART::Light::Light | ( | float | i, |
| float | ai, | ||
| VART::Color | c, | ||
| bool | o | ||
| ) |
| VART::Light::Light | ( | const std::string & | newDescription, |
| float | newIntensity, | ||
| float | newAmbientIntensity, | ||
| const Color & | newColor, | ||
| const Point4D & | newLocation | ||
| ) |
|
static |
Strong, white ambient light.
Definition at line 86 of file light.cpp.
References VART::Point4D::ORIGIN(), and VART::Color::WHITE().
|
virtual |
Returns a copy of an Light. Every derived class must reimplements this method, to avoid errors with VART::SceneNode::RecursiveCopy.
Implements VART::SceneNode.
|
inlinevirtual |
Draws and object, setting pick info.
This method should be called in selection mode in order to identify objects that are selected by the mouse (see Scene::Pick).
Implements VART::SceneNode.
|
virtual |
Draws (sets up) a light using OpenGL commands.
| oglLightID | [in] OpenGL ID for light in the range 0..7. |
Reimplemented in VART::PointLight.
| VART::Color VART::Light::GetColor | ( | ) | const |
|
inline |
|
protected |
|
inline |
| VART::Light & VART::Light::operator= | ( | const Light & | light | ) |
Definition at line 72 of file light.cpp.
References VART::SceneNode::description, and location.
|
virtual |
| void VART::Light::SetAmbientIntensity | ( | float | ai | ) |
Definition at line 99 of file light.cpp.
Referenced by VART::XmlScene::LoadSceneNode().
| void VART::Light::SetColor | ( | const Color & | c | ) |
Definition at line 107 of file light.cpp.
Referenced by VART::XmlScene::LoadSceneNode().
| void VART::Light::SetIntensity | ( | float | i | ) |
Definition at line 91 of file light.cpp.
Referenced by VART::XmlScene::LoadSceneNode().
| void VART::Light::SetLocation | ( | const Point4D & | newLocation | ) |
Sets the location of the light.
newLocation should be a point for positional lights or a direction for directional lights.
Definition at line 123 of file light.cpp.
Referenced by VART::XmlScene::LoadSceneNode().
|
static |
White directional light towards negative Y. Small ambient intensity.
Definition at line 82 of file light.cpp.
References VART::Color::WHITE().
| void VART::Light::Turn | ( | bool | on_off | ) |
Turns a light on or off.
Definition at line 115 of file light.cpp.
Referenced by VART::XmlScene::LoadSceneNode().
|
protected |
Definition at line 87 of file light.h.
Referenced by VART::PointLight::GetLocation(), GetLocation(), Light(), operator=(), VART::PointLight::SetLocation(), and VART::SpotLight::SpotLight().
|
protected |
Definition at line 86 of file light.h.
Referenced by GetTransform(), and Light().
1.8.6