My Project
Loading...
Searching...
No Matches
chai3d::cWorld Class Reference

This class implements a virtual world. More...

#include <CWorld.h>

Inheritance diagram for chai3d::cWorld:

Public Member Functions

 cWorld ()
 Constructor of cWorld.
 
virtual ~cWorld ()
 Destructor of cWorld.
 
virtual std::string getClassName ()
 This method returns the name of the object class.
 
void setBackgroundColor (const GLfloat a_red, const GLfloat a_green, const GLfloat a_blue)
 This method sets the background color of this world.
 
void setBackgroundColor (const cColorf &a_color)
 This method sets the background color of this world.
 
cColorf getBackgroundColor () const
 This method returns the background color of this world.
 
void enableLightSourceRendering (bool enable)
 This method enables or disables the rendering of this world's light sources.
 
virtual cGenericLight * getLightSource (int index)
 This method returns a pointer to a particular light source (between 0 and MAXIMUM_OPENGL_LIGHT_COUNT-1).
 
virtual void computeLocalInteraction (const cVector3d &a_toolPos, const cVector3d &a_toolVel, const unsigned int a_IDN)
 This method updates the geometric relationship between the tool and this world.
 
void setUseShadowCasting (bool a_enabled)
 This method enables or disables shadow casting.
 
bool getUseShadowCastring ()
 This method returns true if shadow casting is enabled, false otherwise.
 
void setShadowIntensity (double a_intensity)
 This method sets the shadow Intensity. (0.0 = no shadow - full light. 1.0 = full shadow - no light)
 
double getShadowIntensity ()
 
virtual bool updateShadowMaps (const bool a_mirrorX=false, const bool a_mirrorY=false)
 This method updates all shadow maps.
 
- Public Member Functions inherited from chai3d::cGenericObject
 cGenericObject ()
 Constructor of cGenericObject.
 
virtual ~cGenericObject ()
 Destructor of cGenericObject.
 
virtual void setEnabled (bool a_enabled, const bool a_affectChildren=false, const bool a_affectComponents=true)
 This method enables or disable this object. When an object is disabled, both haptic and graphic rendering no longer occur.
 
bool getEnabled () const
 This method returns true if the object is enabled, false otherwise.
 
cGenericObject * getObject (std::string &a_name)
 This method returns a pointer to an object of a given name.
 
virtual cGenericObject * copy (const bool a_duplicateMaterialData=false, const bool a_duplicateTextureData=false, const bool a_duplicateMeshData=false, const bool a_buildCollisionDetector=true)
 This method creates a copy of itself.
 
virtual void setLocalPos (const cVector3d &a_localPos)
 This method sets the local position of this object.
 
void setLocalPos (const double a_x=0.0, const double a_y=0.0, const double a_z=0.0)
 This method sets the local position of this object.
 
cVector3d getLocalPos () const
 This method returns the local position of this object.
 
cVector3d getGlobalPos () const
 This method returns the global position of this object.
 
virtual void setLocalRot (const cMatrix3d &a_localRot)
 This method sets the local rotation matrix for this object.
 
cMatrix3d getLocalRot () const
 This method returns the local rotation matrix of this object.
 
cMatrix3d getGlobalRot () const
 This method returns the global rotation matrix of this object.
 
void setLocalTransform (const cTransform &a_transform)
 This method returns the local position and rotation matrix by passing a transformation matrix.
 
cTransform getLocalTransform ()
 This method returns the local position and rotation matrix in a transformation matrix.
 
cTransform getGlobalTransform ()
 This method returns the global position and rotation matrix in a transformation matrix.
 
void translate (const cVector3d &a_translation)
 This method translates this object by a specified offset.
 
void translate (const double a_x, const double a_y, const double a_z=0.0)
 This method translates this object by a specified offset.
 
void rotateAboutLocalAxisRad (const cVector3d &a_axis, const double a_angleRad)
 This method rotates this object around a local axis. Angle magnitude is defined in radians.
 
void rotateAboutLocalAxisDeg (const cVector3d &a_axis, const double a_angleDeg)
 This method rotates this object around a local axis. Angle magnitude is defined in degrees.
 
void rotateAboutLocalAxisRad (const double a_axisX, const double a_axisY, const double a_axisZ, const double a_angleRad)
 This method rotates this object around a local axis. Angle magnitude is defined in radians.
 
void rotateAboutLocalAxisDeg (const double a_axisX, const double a_axisY, const double a_axisZ, const double a_angleDeg)
 This method rotates this object around a local axis. Angle magnitude is defined in degrees.
 
void rotateAboutGlobalAxisRad (const cVector3d &a_axis, const double a_angleRad)
 This method rotates this object around a global axis. Angle magnitude is defined in radians.
 
void rotateAboutGlobalAxisDeg (const cVector3d &a_axis, const double a_angleDeg)
 This method rotates this object around a global axis. Angle magnitude is defined in degrees.
 
void rotateAboutGlobalAxisRad (const double a_axisX, const double a_axisY, const double a_axisZ, const double a_angleRad)
 This method rotate this object around a local axis. Angle magnitude is defined in radians.
 
void rotateAboutGlobalAxisDeg (const double a_axisX, const double a_axisY, const double a_axisZ, const double a_angleDeg)
 This method rotates this object around a local axis. Angle magnitude is defined in degrees.
 
void rotateExtrinsicEulerAnglesRad (const double &a_angleRad1, const double &a_angleRad2, const double &a_angleRad3, const cEulerOrder a_eulerOrder)
 This method rotates this object using fixed Euler representation. Angles are defined in radians.
 
void rotateExtrinsicEulerAnglesDeg (const double &a_angleDeg1, const double &a_angleDeg2, const double &a_angleDeg3, const cEulerOrder a_eulerOrder)
 This method rotates this object using fixed Euler representation. Angles are defined in radians.
 
void rotateIntrinsicEulerAnglesRad (const double &a_angleRad1, const double &a_angleRad2, const double &a_angleRad3, const cEulerOrder a_eulerOrder)
 This method rotates this object using co-moving Euler representation. Angles are defined in radians.
 
void rotateIntrinsicEulerAnglesDeg (const double &a_angleDeg1, const double &a_angleDeg2, const double &a_angleDeg3, const cEulerOrder a_eulerOrder)
 This method rotates this object using co-moving Euler representation. Angles are defined in radians.
 
virtual void computeGlobalPositions (const bool a_frameOnly=true, const cVector3d &a_globalPos=cVector3d(0.0, 0.0, 0.0), const cMatrix3d &a_globalRot=cIdentity3d())
 This method computes the global position and rotation of this object and its children.
 
void computeGlobalPositionsFromRoot (const bool a_frameOnly=true)
 This method computes the global position and rotation of current object only.
 
bool addEffect (cGenericEffect *a_effect)
 This method adds a haptic effect to this object.
 
bool removeEffect (cGenericEffect *a_effect)
 This method removes a haptic effect from this object.
 
void deleteAllEffects ()
 This method removes all haptic effects.
 
void createEffectMagnetic (const bool a_affectChildren=false, const bool a_affectComponents=true)
 This method creates a magnetic haptic effect.
 
void deleteEffectMagnetic (const bool a_affectChildren=false, const bool a_affectComponents=true)
 This method deletes any current magnetic haptic effect.
 
void createEffectStickSlip (const bool a_affectChildren=false, const bool a_affectComponents=true)
 This method creates a stick-and-slip haptic effect.
 
void deleteEffectStickSlip (const bool a_affectChildren=false, const bool a_affectComponents=true)
 This method delete any current stick-and-slip haptic effect.
 
void createEffectSurface (const bool a_affectChildren=false, const bool a_affectComponents=true)
 This method creates a surface haptic effect.
 
void deleteEffectSurface (const bool a_affectChildren=false, const bool a_affectComponents=true)
 This method deletes any current surface haptic effect.
 
void createEffectVibration (const bool a_affectChildren=false, const bool a_affectComponents=true)
 This method creates a vibration haptic effect.
 
void deleteEffectVibration (const bool a_affectChildren=false, const bool a_affectComponents=true)
 This method deletes any current vibration haptic effect.
 
void createEffectViscosity (const bool a_affectChildren=false, const bool a_affectComponents=true)
 This method creates a viscous haptic effect.
 
void deleteEffectViscosity (const bool a_affectChildren=false, const bool a_affectComponents=true)
 This method deletes any current viscous haptic effect.
 
virtual void setHapticEnabled (const bool a_hapticEnabled, const bool a_affectChildren=true, const bool a_affectComponents=true)
 This method enables or disables haptic perception of this object, optionally propagating the change to children.
 
bool getHapticEnabled () const
 This method returns the haptic status of object (true means it can be felt when visible).
 
virtual void setStiffness (const double a_stiffness, const bool a_affectChildren=true, const bool a_affectComponents=true)
 This method sets the haptic stiffness of the object, optionally recursively affecting children.
 
virtual void setFriction (double a_staticFriction, double a_dynamicFriction, const bool a_affectChildren=true, const bool a_affectComponents=true)
 This method sets the static and dynamic friction properties (polygonal models only), optionally recursively affecting children.
 
virtual void setShowEnabled (const bool a_show, const bool a_affectChildren=true, const bool a_affectComponents=true)
 This method enables or disables the graphic display of this object, optionally propagating the change to children.
 
bool getShowEnabled () const
 This method returns the display status of object (true means it's visible).
 
virtual void setWireMode (const bool a_showWireMode, const bool a_affectChildren=false, const bool a_affectComponents=true)
 This method enables or disables wireframe rendering, optionally propagating the operation to my children.
 
bool getWireMode () const
 This method returns whether wireframe rendering is enabled.
 
virtual void setUseCulling (const bool a_useCulling, const bool a_affectChildren=false, const bool a_affectComponents=true)
 This method enables or disables face-culling, optionally propagating the operation to my children.
 
bool getUseCulling () const
 This method returns true if face-culling is enabled, false otherwise.
 
virtual void setUseTransparency (const bool a_useTransparency, const bool a_affectChildren=false, const bool a_affectComponents=true)
 This method enables or disables transparency.
 
bool getUseTransparency () const
 This method returns true if transparency is enabled, false otherwise.
 
virtual void setTransparencyLevel (const float a_level, const bool a_applyToVertices=false, const bool a_applyToTextures=false, const bool a_affectChildren=false, const bool a_affectComponents=true)
 This method sets the transparency level of the object.
 
virtual void setUseDisplayList (const bool a_useDisplayList, const bool a_affectChildren=false, const bool a_affectComponents=true)
 This method enabled or disables the use of a display list for rendering, optionally propagating the operation to its children.
 
bool getUseDisplayList () const
 This method returns true if a display list is activated, false otherwise.
 
virtual void markForUpdate (const bool a_affectChildren=false, const bool a_affectComponents=true)
 This method invalidates any existing display lists, optionally propagating the operation to its children.
 
virtual void setUseVertexColors (const bool a_useColors, const bool a_affectChildren=false, const bool a_affectComponents=true)
 This method enables or disables the use of per-vertex colors, optionally propagating the operation to its children.
 
bool getUseVertexColors () const
 This method returns true is per-vertex color properties are enabled, false otherwise.
 
virtual void setUseMaterial (const bool a_useMaterial, const bool a_affectChildren=false, const bool a_affectComponents=true)
 This method enables or disables the use of material properties, optionally propagating the operation to its children.
 
bool getUseMaterial () const
 This method returns true is material properties are enabled, false otherwise.
 
virtual void setMaterial (cMaterialPtr a_material, const bool a_affectChildren=false, const bool a_affectComponents=true)
 This method sets the material properties of this object, optionally propagating the operation to its children.
 
virtual void setMaterial (cMaterial &a_material, const bool a_affectChildren=false, const bool a_affectComponents=true)
 This method setd the material properties of this object, optionally propagating the operation to its children.
 
virtual void backupMaterialColors (const bool a_affectChildren=false, const bool a_affectComponents=true)
 This method creates a backup of the material colors of this object, optionally propagating the operation to its children.
 
virtual void restoreMaterialColors (const bool a_affectChildren=false, const bool a_affectComponents=true)
 This method restores the material color properties of this object from a previous backup, optionally propagating the operation to its children.
 
virtual void setUseTexture (const bool a_useTexture, const bool a_affectChildren=false, const bool a_affectComponents=true)
 This method enables or disables the use of texture-mapping, optionally propagating the operation to its children.
 
bool getUseTexture () const
 This method returns true if texture-mapping is enabled, false otherwise.
 
virtual void setTexture (cTexture1dPtr a_texture, const bool a_affectChildren=false, const bool a_affectComponents=true)
 This method sets a texture to this object, optionally propagating the operation to its children.
 
virtual void setShaderProgram (cShaderProgramPtr a_shaderProgram, const bool a_affectChildren=false, const bool a_affectComponents=true)
 This method assigns a shader program to this object, optionally propagating the operation to its children..
 
virtual cShaderProgramPtr getShaderProgram ()
 This method returns a pointer to the current shader program.
 
virtual void setShowBoundaryBox (const bool a_showBoundaryBox, const bool a_affectChildren=false, const bool a_affectComponents=true)
 This method enables or disabled the graphic display of the boundary box for this object, optionally propagating the change to its children.
 
bool getShowBoundaryBox () const
 This method returns true if the boundary box is being displayed, false otherwise.
 
cVector3d getBoundaryMin () const
 This method returns the minimum point of this object's boundary box.
 
cVector3d getBoundaryMax () const
 This method returns the maximum point of this object's boundary box.
 
cVector3d getBoundaryCenter () const
 This method computes and returns the center of this object's boundary box.
 
bool getBoundaryBoxEmpty ()
 This method returns true, if the boundary box is empty, otherwise false.
 
virtual void computeBoundaryBox (const bool a_includeChildren=true)
 This method computes this object's boundary box, optionally forcing it to bound child objects.
 
virtual void setShowFrame (const bool a_showFrame, const bool a_affectChildren=false, const bool a_affectComponents=true)
 This method enables or disables the graphic display of the reference frame arrows for this object, optionally propagating the change to its children.
 
bool getShowFrame (void) const
 This method returns true if the display of the reference frame is enabled, false otherwise.
 
virtual void setFrameSize (const double a_size=1.0, const bool a_affectChildren=false, const bool a_affectComponents=true)
 This method sets the size of the rendered reference frame, optionally propagating the change to its children.
 
double getFrameSize () const
 This method returns the size of the graphical reference frame.
 
void setCollisionDetector (cGenericCollision *a_collisionDetector)
 This method sets a collision detector to this current object.
 
cGenericCollision * getCollisionDetector () const
 This method returns a pointer to this object's current collision detector.
 
virtual void deleteCollisionDetector (const bool a_affectChildren=false, const bool a_affectComponents=true)
 This method deletes any existing collision detector.
 
virtual bool computeCollisionDetection (const cVector3d &a_segmentPointA, const cVector3d &a_segmentPointB, cCollisionRecorder &a_recorder, cCollisionSettings &a_settings)
 This method computes any collision between a segment and this object.
 
virtual void setShowCollisionDetector (const bool a_showCollisionDetector, const bool a_affectChildren=false, const bool a_affectComponents=true)
 This method enables or disables the display of the collision detector, optionally propagating the change to its children.
 
bool getShowCollisionDetector ()
 This method returns true if the collision detector is being displayed graphically, false otherwise.
 
virtual void setCollisionDetectorProperties (unsigned int a_displayDepth, cColorf &a_color, const bool a_affectChildren=false, const bool a_affectComponents=true)
 This method sets the collision detector graphic display properties.
 
void setParent (cGenericObject *a_parent)
 This method sets the parent of this object.
 
cGenericObject * getParent () const
 This method returns the parent of this object.
 
void setOwner (cGenericObject *a_owner)
 This method sets a link to an object that owns this object. This could be a super parent for instance.
 
cGenericObject * getOwner ()
 This method returns the owner of this object.
 
cGenericObject * getRootObject ()
 This method returns the root object of the scenegraph.
 
cGenericObject * getChild (const unsigned int a_index) const
 This method returns a selected child from the list of children.
 
bool addChild (cGenericObject *a_object)
 This method adds an object to the list of children.
 
bool removeChild (cGenericObject *a_object)
 This method removes an object from the list of children, without deleting it.
 
bool removeFromGraph ()
 This method removes this object from its parent's list of children or list of components.
 
bool deleteChild (cGenericObject *a_object)
 This method removes an object from its list of children and deletes it.
 
void clearAllChildren ()
 This method clears all objects from its list of children, without deleting them.
 
void deleteAllChildren ()
 This method clears and delete all objects from its list of children.
 
unsigned int getNumChildren ()
 This method returns the number of objects from its list of children.
 
unsigned int getNumDescendants (bool a_includeCurrentObject=false)
 This method returns the total number of descendants, optionally including this object.
 
bool addComponent (cGenericObject *a_component)
 This method adds an object to the list of components.
 
bool removeComponent (cGenericObject *a_object)
 This method removes an object from the list of components, without deleting it.
 
bool deleteComponent (cGenericObject *a_object)
 This method removes an object from its list of components and deletes it.
 
void clearAllComponents ()
 This method clears all objects from its list of components, without deleting them.
 
void deleteAllComponents ()
 This method clears and delete all objects from its list of components.
 
unsigned int getNumComponents ()
 This method returns the number of objects from its list of components.
 
void setGhostEnabled (bool a_ghostEnabled)
 This method enables or disables this object to be a ghost node.
 
bool getGhostEnabled ()
 This method returns truee if this object is a ghost node.
 
virtual void scale (const double &a_scaleFactor, const bool a_affectChildren=true, const bool a_affectComponents=true)
 This method scales the size of this object.
 
virtual void renderSceneGraph (cRenderOptions &a_options)
 This method renders the entire scene graph, starting from this object.
 
virtual void adjustCollisionSegment (cVector3d &a_segmentPointA, cVector3d &a_segmentPointAadjusted)
 This method adjusts the collision segment to handle objects in motion.
 
virtual cVector3d computeInteractions (const cVector3d &a_toolPos, const cVector3d &a_toolVel, const unsigned int a_IDN, cInteractionRecorder &a_interactions)
 This method computes all haptic interaction between a tool and this object using the haptic effects.
 
- Public Member Functions inherited from chai3d::cGenericType
 cGenericType ()
 Constructor of cGenericType.
 
virtual ~cGenericType ()
 Destructor of cGenericType.
 
virtual int getObjectCounter ()
 This method return the value of the object counter.
 

Public Attributes

cColorf m_backgroundColor
 Background color of the world.
 
cFog * m_fog
 Fog property.
 
std::vector< cGenericLight * > m_lights
 List of light sources.
 
std::list< cShadowMap * > m_shadowMaps
 List of active shadow maps.
 
double m_worldModelView [16]
 It's useful to store the world's modelview matrix, for rendering stuff in "global" coordinates.
 
- Public Attributes inherited from chai3d::cGenericObject
cMaterialPtr m_material
 Material property.
 
cTexture1dPtr m_texture
 Texture property.
 
cNormalMapPtr m_normalMap
 Normal map property.
 
int m_userTag
 An arbitrary tag, not used by CHAI3D.
 
void * m_userData
 An arbitrary data pointer, not used by CHAI3D.
 
std::string m_userName
 Name of current object, not used by CHAI3D.
 
cGenericObject * m_userExternalObject
 A link to an external cGenericObject object, not used by CHAI3D.
 
cVector3d m_interactionPoint
 Projection of the most recent haptic point (tool) onto the surface of the virtual object.
 
cVector3d m_interactionNormal
 Surface normal at the current interaction point.
 
bool m_interactionInside
 Was the last tool (haptic point) located inside the object?
 
- Public Attributes inherited from chai3d::cGenericType
std::string m_name
 Object name.
 
std::string m_filename
 Object filename.
 
void * m_userPtr
 This pointer can be used for any user purpose.
 
int m_userIndex
 This integer can be used for any user purpose.
 

Protected Member Functions

virtual void render (cRenderOptions &a_options)
 This method renders all light sources of this world.
 
bool addLightSource (cGenericLight *a_light)
 This method adds a light source to this world.
 
bool removeLightSource (cGenericLight *a_light)
 This method removed a light source from this world.
 
bool isShadowCastingSupported ()
 This method returns true if shadow casting is supported on this hardware, false otherwise.
 
- Protected Member Functions inherited from chai3d::cGenericObject
virtual void updateGlobalPositions (const bool a_frameOnly)
 This method update the global position information about this object.
 
virtual void updateBoundaryBox ()
 This method updates the boundary box of this object.
 
virtual void scaleObject (const double &a_scaleFactor)
 This method scales the size of this object with given scale factor.
 
virtual cVector3d computeOtherInteractions (const cVector3d &a_toolPos, const cVector3d &a_toolVel, const unsigned int a_IDN, cInteractionRecorder &a_interactions)
 This method computes any additional interactions between the object and the tools.
 
virtual bool computeOtherCollisionDetection (cVector3d &a_segmentPointA, cVector3d &a_segmentPointB, cCollisionRecorder &a_recorder, cCollisionSettings &a_settings)
 This method computes any additional collisions other than the ones computed by the default collision detector.
 
void copyGenericObjectProperties (cGenericObject *a_objDest, const bool a_duplicateMaterialData, const bool a_duplicateTextureData, const bool a_duplicateMeshData, const bool a_buildCollisionDetector)
 This method copies all properties of the current generic object to another.
 

Protected Attributes

bool m_renderLightSources
 If true then light sources should be used.
 
double m_shadowIntensity
 Shadow intensity. Values ranges between 0.0 and 1.0 (0.0 = no shadow - full light. 1.0 = full shadow - no light).
 
bool m_useShadowCasting
 If true then shadow maps are used.
 
- Protected Attributes inherited from chai3d::cGenericObject
cGenericObject * m_parent
 Parent object.
 
cGenericObject * m_owner
 
std::vector< cGenericObject * > m_components
 List of components. Components are sub objects of the current object.
 
std::vector< cGenericObject * > m_children
 List of children.
 
cVector3d m_localPos
 The position of this object in my parent's reference frame.
 
cVector3d m_globalPos
 The position of this object in the world's reference frame.
 
cMatrix3d m_localRot
 The rotation matrix that rotates my reference frame into my parent's reference frame.
 
cMatrix3d m_globalRot
 The rotation matrix that rotates my reference frame into the world's reference frame.
 
cVector3d m_prevGlobalPos
 Previous position since last haptic computation.
 
cMatrix3d m_prevGlobalRot
 Previous rotation since last haptic computation.
 
cVector3d m_boundaryBoxMin
 Minimum position of boundary box.
 
cVector3d m_boundaryBoxMax
 Maximum position of boundary box.
 
bool m_boundaryBoxEmpty
 If true, then the boundary box does not include any object.
 
double m_frameSize
 Size of graphical representation of frame (X-Y-Z).
 
double m_frameThicknessScale
 Pen thickness of graphical representation of frame (X-Y-Z).
 
bool m_enabled
 If true, the object may be rendered graphically and haptically.
 
bool m_showEnabled
 If true, this object is rendered.
 
bool m_hapticEnabled
 If true, this object can be felt.
 
bool m_ghostEnabled
 If true, object is enabled as ghost.
 
bool m_showFrame
 If true, this object's reference frame is rendered as a set of arrows.
 
bool m_showBoundaryBox
 If true, this object's boundary box is displayed as a set of lines.
 
bool m_showCollisionDetector
 If true, the collision detector is displayed (if available) at this node.
 
bool m_useTextureMapping
 Should texture mapping be used?
 
bool m_useMaterialProperty
 Should material properties be used?
 
bool m_useVertexColors
 Should per-vertex colors be used?
 
bool m_useDisplayList
 Should we use a display list to render this mesh?
 
cDisplayList m_displayList
 Basic display list for current object.
 
int m_triangleMode
 The polygon rendering mode (GL_FILL or GL_LINE).
 
bool m_useTransparency
 
bool m_cullingEnabled
 
cShaderProgramPtr m_shaderProgram
 Shader program.
 
cTransform m_frameGL
 OpenGL matrix describing my position and orientation transformation.
 
cGenericCollision * m_collisionDetector
 The collision detector used to test for contact with this object.
 
std::vector< cGenericEffect * > m_effects
 List of haptic effects programmed for this object.
 

Friends

class cGenericLight
 

Additional Inherited Members

- Static Public Attributes inherited from chai3d::cGenericObject
static cColorf s_boundaryBoxColor
 Color of the boundary box.
 
- Static Protected Attributes inherited from chai3d::cGenericObject
static cMaterialPtr s_defaultMaterial = nullptr
 Default material property.
 
- Static Protected Attributes inherited from chai3d::cGenericType
static int s_objectCounter = 0
 Static class counter.
 

Detailed Description

cWorld defines the root of node the CHAI3D scene graph. It stores lights, cameras, tools, and objects.

Constructor & Destructor Documentation

◆ cWorld()

chai3d::cWorld::cWorld ( )

Constructor of cWorld.

◆ ~cWorld()

chai3d::cWorld::~cWorld ( )
virtual

Destructor of cWorld.

Member Function Documentation

◆ getClassName()

virtual std::string chai3d::cWorld::getClassName ( )
inlinevirtual

Reimplemented from chai3d::cGenericObject.

◆ setBackgroundColor() [1/2]

void chai3d::cWorld::setBackgroundColor ( const GLfloat  a_red,
const GLfloat  a_green,
const GLfloat  a_blue 
)

This method sets the background color of the world.

Parameters
a_redred component.
a_greengreen component.
a_blueblue component.

◆ setBackgroundColor() [2/2]

void chai3d::cWorld::setBackgroundColor ( const cColorf &  a_color)

This method sets the background color of the world.

Parameters
a_colorBackground color.

◆ getBackgroundColor()

cColorf chai3d::cWorld::getBackgroundColor ( ) const
inline

◆ enableLightSourceRendering()

void chai3d::cWorld::enableLightSourceRendering ( bool  enable)
inline

◆ getLightSource()

cGenericLight * chai3d::cWorld::getLightSource ( int  a_index)
virtual

This method returns a pinter to a selected light source (between 0 and MAXIMUM_OPENGL_LIGHT_COUNT-1).

Parameters
a_indexLight index number.
Returns
Pointer to a valid light or null if that light doesn't exist.

◆ computeLocalInteraction()

void chai3d::cWorld::computeLocalInteraction ( const cVector3d &  a_toolPos,
const cVector3d &  a_toolVel,
const unsigned int  a_IDN 
)
virtual

This method update interaction information between a tool and this world.

Parameters
a_toolPosPosition of the tool.
a_toolVelVelocity of the tool.
a_IDNIdentification number of the force algorithm.

Reimplemented from chai3d::cGenericObject.

◆ setUseShadowCasting()

void chai3d::cWorld::setUseShadowCasting ( bool  a_enabled)
inline

◆ getUseShadowCastring()

bool chai3d::cWorld::getUseShadowCastring ( )
inline

◆ setShadowIntensity()

void chai3d::cWorld::setShadowIntensity ( double  a_intensity)
inline

◆ getShadowIntensity()

double chai3d::cWorld::getShadowIntensity ( )
inline

◆ updateShadowMaps()

bool chai3d::cWorld::updateShadowMaps ( const bool  a_mirrorX = false,
const bool  a_mirrorY = false 
)
virtual

This method updates all shadow maps.

Parameters
a_mirrorXSet to true if image is flip horizontally.
a_mirrorYSet to true if image is flip vertically.
Returns
true if any shadow maps were updated.

◆ render()

void chai3d::cWorld::render ( cRenderOptions &  a_options)
protectedvirtual

This method renders all light sources of this world.

Parameters
a_optionsRendering options.

Reimplemented from chai3d::cGenericObject.

◆ addLightSource()

bool chai3d::cWorld::addLightSource ( cGenericLight *  a_light)
protected

This method adds an OpenGL light source to the world.
A maximum of eight light sources can be registered. For each registered light source, an OpenGL lightID number is defined

Parameters
a_lightLight source to register.
Returns
true if light source was registered, otherwise false.

◆ removeLightSource()

bool chai3d::cWorld::removeLightSource ( cGenericLight *  a_light)
protected

This method removes a light source from this world.

Parameters
a_lightLight source to be removed.
Returns
true if light source was removed, otherwise false.

◆ isShadowCastingSupported()

bool chai3d::cWorld::isShadowCastingSupported ( )
protected

This method returns true if shadow casting is supported on this hardware, false otherwise.

Returns
true if shadow casting is supported, otherwise false.

Friends And Related Symbol Documentation

◆ cGenericLight

friend class cGenericLight
friend

Member Data Documentation

◆ m_backgroundColor

cColorf chai3d::cWorld::m_backgroundColor

◆ m_fog

cFog* chai3d::cWorld::m_fog

◆ m_lights

std::vector<cGenericLight*> chai3d::cWorld::m_lights

◆ m_shadowMaps

std::list<cShadowMap*> chai3d::cWorld::m_shadowMaps

◆ m_worldModelView

double chai3d::cWorld::m_worldModelView[16]

◆ m_renderLightSources

bool chai3d::cWorld::m_renderLightSources
protected

◆ m_shadowIntensity

double chai3d::cWorld::m_shadowIntensity
protected

◆ m_useShadowCasting

bool chai3d::cWorld::m_useShadowCasting
protected

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