46#ifndef CGenericObjectH
47#define CGenericObjectH
71class cGenericCollision;
72class cGenericForceAlgorithm;
75class cInteractionRecorder;
140 const bool a_affectChildren =
false,
141 const bool a_affectComponents =
true);
158 const bool a_duplicateTextureData =
false,
159 const bool a_duplicateMeshData =
false,
160 const bool a_buildCollisionDetector =
true) {
return (NULL); }
177 void setLocalPos(
const Eigen::Vector3d& a_localPos)
185 const double a_y = 0.0,
186 const double a_z = 0.0)
205 inline void setLocalRot(
const Eigen::Matrix3d a_localRot)
238 const double a_z = 0.0);
245 const double a_angleDeg)
252 const double a_axisY,
253 const double a_axisZ,
254 const double a_angleRad)
261 const double a_axisY,
262 const double a_axisZ,
263 const double a_angleDeg)
279 const double a_axisY,
280 const double a_axisZ,
281 const double a_angleRad)
288 const double a_axisY,
289 const double a_axisZ,
290 const double a_angleDeg)
297 const double& a_angleRad2,
298 const double& a_angleRad3,
303 const double& a_angleDeg2,
304 const double& a_angleDeg3,
312 const double& a_angleRad2,
313 const double& a_angleRad3,
318 const double& a_angleDeg2,
319 const double& a_angleDeg3,
357 void createEffectMagnetic(
const bool a_affectChildren =
false,
const bool a_affectComponents =
true);
360 void deleteEffectMagnetic(
const bool a_affectChildren =
false,
const bool a_affectComponents =
true);
363 void createEffectStickSlip(
const bool a_affectChildren =
false,
const bool a_affectComponents =
true);
366 void deleteEffectStickSlip(
const bool a_affectChildren =
false,
const bool a_affectComponents =
true);
369 void createEffectSurface(
const bool a_affectChildren =
false,
const bool a_affectComponents =
true);
372 void deleteEffectSurface(
const bool a_affectChildren =
false,
const bool a_affectComponents =
true);
375 void createEffectVibration(
const bool a_affectChildren =
false,
const bool a_affectComponents =
true);
378 void deleteEffectVibration(
const bool a_affectChildren =
false,
const bool a_affectComponents =
true);
381 void createEffectViscosity(
const bool a_affectChildren =
false,
const bool a_affectComponents =
true);
384 void deleteEffectViscosity(
const bool a_affectChildren =
false,
const bool a_affectComponents =
true);
395 const bool a_affectChildren =
true,
396 const bool a_affectComponents =
true);
403 const bool a_affectChildren =
true,
404 const bool a_affectComponents =
true);
408 double a_dynamicFriction,
409 const bool a_affectChildren =
true,
410 const bool a_affectComponents =
true);
421 const bool a_affectChildren =
true,
422 const bool a_affectComponents =
true);
428 virtual void setWireMode(
const bool a_showWireMode,
429 const bool a_affectChildren =
false,
430 const bool a_affectComponents =
true);
437 const bool a_affectChildren =
false,
438 const bool a_affectComponents =
true);
450 const bool a_affectChildren =
false,
451 const bool a_affectComponents =
true);
458 const bool a_applyToVertices =
false,
459 const bool a_applyToTextures =
false,
460 const bool a_affectChildren =
false,
461 const bool a_affectComponents =
true);
472 const bool a_affectChildren =
false,
473 const bool a_affectComponents =
true);
479 virtual void markForUpdate(
const bool a_affectChildren =
false,
const bool a_affectComponents =
true);
490 const bool a_affectChildren =
false,
491 const bool a_affectComponents =
true);
505 const bool a_affectChildren =
false,
506 const bool a_affectComponents =
true);
513 const bool a_affectChildren =
false,
514 const bool a_affectComponents =
true);
518 const bool a_affectChildren =
false,
519 const bool a_affectComponents =
true);
522 virtual void backupMaterialColors(
const bool a_affectChildren =
false,
const bool a_affectComponents =
true);
525 virtual void restoreMaterialColors(
const bool a_affectChildren =
false,
const bool a_affectComponents =
true);
536 const bool a_affectChildren =
false,
537 const bool a_affectComponents =
true);
544 const bool a_affectChildren =
false,
545 const bool a_affectComponents =
true);
556 const bool a_affectChildren =
false,
557 const bool a_affectComponents =
true);
581 const bool a_affectChildren =
false,
582 const bool a_affectComponents =
true);
611 const bool a_affectChildren =
false,
612 const bool a_affectComponents =
true);
619 const bool a_affectChildren =
false,
620 const bool a_affectComponents =
true);
639 virtual void deleteCollisionDetector(
const bool a_affectChildren =
false,
const bool a_affectComponents =
true);
649 const bool a_affectChildren =
false,
650 const bool a_affectComponents =
true);
658 const bool a_affectChildren =
false,
659 const bool a_affectComponents =
true);
754 virtual void scale(
const double& a_scaleFactor,
755 const bool a_affectChildren =
true,
756 const bool a_affectComponents =
true);
987 const unsigned int a_IDN);
992 const unsigned int a_IDN,
1010 const bool a_duplicateMaterialData,
1011 const bool a_duplicateTextureData,
1012 const bool a_duplicateMeshData,
1013 const bool a_buildCollisionDetector);
1047 const unsigned int a_IDN,
Implements basic data structures for storing collision events.
Implements color properties.
Implementation of class that supports OpenGL display lists.
Implements OpenGL drawing macros.
Implements a base class for haptic effects.
Implements a general abstract type.
Implements basic structures for handling interaction events.
Implements material properties.
Implements general math utility functions.
Implements a structure to store rendering options.
This class implements a collision detection recorder that stores all collision events that are report...
Definition CCollisionBasics.h:186
This class provides support for OpenGL display lists.
Definition CDisplayList.h:77
This class implements a base class for collision detection.
Definition CGenericCollision.h:102
This class implements a base class for haptic effects.
Definition CGenericEffect.h:118
This class implements a base class for all 2D or 3D objects in CHAI3D.
Definition CGenericObject.h:113
void setGhostEnabled(bool a_ghostEnabled)
This method enables or disables this object to be a ghost node.
Definition CGenericObject.h:741
virtual std::string getClassName()
This method returns the name of the object class.
Definition CGenericObject.h:136
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.
Definition CGenericObject.cpp:369
bool getHapticEnabled() const
This method returns the haptic status of object (true means it can be felt when visible).
Definition CGenericObject.h:399
int m_userTag
An arbitrary tag, not used by CHAI3D.
Definition CGenericObject.h:782
bool deleteChild(cGenericObject *a_object)
This method removes an object from its list of children and deletes it.
Definition CGenericObject.cpp:2555
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.
Definition CGenericObject.cpp:1764
cVector3d m_boundaryBoxMin
Minimum position of boundary box.
Definition CGenericObject.h:849
bool removeChild(cGenericObject *a_object)
This method removes an object from the list of children, without deleting it.
Definition CGenericObject.cpp:2471
void computeGlobalPositionsFromRoot(const bool a_frameOnly=true)
This method computes the global position and rotation of current object only.
Definition CGenericObject.cpp:468
cVector3d m_localPos
The position of this object in my parent's reference frame.
Definition CGenericObject.h:824
void deleteEffectMagnetic(const bool a_affectChildren=false, const bool a_affectComponents=true)
This method deletes any current magnetic haptic effect.
Definition CGenericObject.cpp:622
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.
Definition CGenericObject.cpp:2194
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 child...
Definition CGenericObject.cpp:1304
cMatrix3d m_localRot
The rotation matrix that rotates my reference frame into my parent's reference frame.
Definition CGenericObject.h:830
void setParent(cGenericObject *a_parent)
This method sets the parent of this object.
Definition CGenericObject.h:669
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...
Definition CGenericObject.h:675
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,...
Definition CGenericObject.cpp:1845
cVector3d m_interactionPoint
Projection of the most recent haptic point (tool) onto the surface of the virtual object.
Definition CGenericObject.h:1023
bool getShowEnabled() const
This method returns the display status of object (true means it's visible).
Definition CGenericObject.h:425
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...
Definition CGenericObject.cpp:1147
cVector3d m_globalPos
The position of this object in the world's reference frame.
Definition CGenericObject.h:827
void createEffectMagnetic(const bool a_affectChildren=false, const bool a_affectComponents=true)
This method creates a magnetic haptic effect.
Definition CGenericObject.cpp:574
cMatrix3d getLocalRot() const
This method returns the local rotation matrix of this object.
Definition CGenericObject.h:214
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 o...
Definition CGenericObject.cpp:1511
bool m_showEnabled
If true, this object is rendered.
Definition CGenericObject.h:881
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.
Definition CGenericObject.h:990
void deleteEffectStickSlip(const bool a_affectChildren=false, const bool a_affectComponents=true)
This method delete any current stick-and-slip haptic effect.
Definition CGenericObject.cpp:712
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 operat...
Definition CGenericObject.cpp:1427
virtual cShaderProgramPtr getShaderProgram()
This method returns a pointer to the current shader program.
Definition CGenericObject.h:560
bool m_useDisplayList
Should we use a display list to render this mesh?
Definition CGenericObject.h:908
virtual void deleteCollisionDetector(const bool a_affectChildren=false, const bool a_affectComponents=true)
This method deletes any existing collision detector.
Definition CGenericObject.cpp:2143
std::string m_userName
Name of current object, not used by CHAI3D.
Definition CGenericObject.h:788
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,...
Definition CGenericObject.cpp:1467
cMatrix3d getGlobalRot() const
This method returns the global rotation matrix of this object.
Definition CGenericObject.h:217
virtual void render(cRenderOptions &a_options)
This method renders this object graphically using OpenGL.
Definition CGenericObject.cpp:2860
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.
Definition CGenericObject.h:244
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.
Definition CGenericObject.cpp:394
bool getGhostEnabled()
This method returns truee if this object is a ghost node.
Definition CGenericObject.h:744
int m_triangleMode
The polygon rendering mode (GL_FILL or GL_LINE).
Definition CGenericObject.h:914
static cMaterialPtr s_defaultMaterial
Default material property.
Definition CGenericObject.h:937
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.
Definition CGenericObject.h:260
void deleteEffectVibration(const bool a_affectChildren=false, const bool a_affectComponents=true)
This method deletes any current vibration haptic effect.
Definition CGenericObject.cpp:894
void deleteEffectSurface(const bool a_affectChildren=false, const bool a_affectComponents=true)
This method deletes any current surface haptic effect.
Definition CGenericObject.cpp:803
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 cha...
Definition CGenericObject.cpp:2335
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...
Definition CGenericObject.cpp:1390
virtual void setUseTransparency(const bool a_useTransparency, const bool a_affectChildren=false, const bool a_affectComponents=true)
This method enables or disables transparency.
Definition CGenericObject.cpp:1187
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.
Definition CGenericObject.h:317
void createEffectViscosity(const bool a_affectChildren=false, const bool a_affectComponents=true)
This method creates a viscous haptic effect.
Definition CGenericObject.cpp:936
bool getUseCulling() const
This method returns true if face-culling is enabled, false otherwise.
Definition CGenericObject.h:441
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.
Definition CGenericObject.h:157
bool addChild(cGenericObject *a_object)
This method adds an object to the list of children.
Definition CGenericObject.cpp:2428
bool getUseTransparency() const
This method returns true if transparency is enabled, false otherwise.
Definition CGenericObject.h:454
bool removeComponent(cGenericObject *a_object)
This method removes an object from the list of components, without deleting it.
Definition CGenericObject.cpp:2681
virtual void scaleObject(const double &a_scaleFactor)
This method scales the size of this object with given scale factor.
Definition CGenericObject.h:982
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.
Definition CGenericObject.cpp:1231
virtual void renderSceneGraph(cRenderOptions &a_options)
This method renders the entire scene graph, starting from this object.
Definition CGenericObject.cpp:2965
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.
Definition CGenericObject.cpp:3256
bool removeFromGraph()
This method removes this object from its parent's list of children or list of components.
Definition CGenericObject.cpp:2504
cVector3d getGlobalPos() const
This method returns the global position of this object.
Definition CGenericObject.h:195
cVector3d getBoundaryCenter() const
This method computes and returns the center of this object's boundary box.
Definition CGenericObject.h:594
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 rende...
Definition CGenericObject.cpp:223
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.
Definition CGenericObject.cpp:2909
bool m_ghostEnabled
If true, object is enabled as ghost.
Definition CGenericObject.h:887
unsigned int getNumDescendants(bool a_includeCurrentObject=false)
This method returns the total number of descendants, optionally including this object.
Definition CGenericObject.cpp:2625
cMaterialPtr m_material
Material property.
Definition CGenericObject.h:766
void deleteAllComponents()
This method clears and delete all objects from its list of components.
Definition CGenericObject.cpp:2763
bool m_enabled
If true, the object may be rendered graphically and haptically.
Definition CGenericObject.h:878
cVector3d m_interactionNormal
Surface normal at the current interaction point.
Definition CGenericObject.h:1026
cVector3d m_boundaryBoxMax
Maximum position of boundary box.
Definition CGenericObject.h:852
cGenericObject * m_userExternalObject
A link to an external cGenericObject object, not used by CHAI3D.
Definition CGenericObject.h:791
bool addComponent(cGenericObject *a_component)
This method adds an object to the list of components.
Definition CGenericObject.cpp:2647
virtual void adjustCollisionSegment(cVector3d &a_segmentPointA, cVector3d &a_segmentPointAadjusted)
This method adjusts the collision segment to handle objects in motion.
Definition CGenericObject.cpp:3230
cGenericObject()
Constructor of cGenericObject.
Definition CGenericObject.cpp:77
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.
Definition CGenericObject.h:272
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.
Definition CGenericObject.cpp:1068
bool getUseMaterial() const
This method returns true is material properties are enabled, false otherwise.
Definition CGenericObject.h:509
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 t...
Definition CGenericObject.cpp:1030
bool getUseDisplayList() const
This method returns true if a display list is activated, false otherwise.
Definition CGenericObject.h:476
bool getShowCollisionDetector()
This method returns true if the collision detector is being displayed graphically,...
Definition CGenericObject.h:653
bool m_showFrame
If true, this object's reference frame is rendered as a set of arrows.
Definition CGenericObject.h:890
cGenericObject * getObject(std::string &a_name)
This method returns a pointer to an object of a given name.
Definition CGenericObject.cpp:260
cGenericObject * getChild(const unsigned int a_index) const
This method returns a selected child from the list of children.
Definition CGenericObject.h:684
void clearAllChildren()
This method clears all objects from its list of children, without deleting them.
Definition CGenericObject.cpp:2580
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 c...
Definition CGenericObject.cpp:2100
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.
Definition CGenericObject.h:302
cMatrix3d m_globalRot
The rotation matrix that rotates my reference frame into the world's reference frame.
Definition CGenericObject.h:833
bool getUseVertexColors() const
This method returns true is per-vertex color properties are enabled, false otherwise.
Definition CGenericObject.h:494
cGenericCollision * getCollisionDetector() const
This method returns a pointer to this object's current collision detector.
Definition CGenericObject.h:636
unsigned int getNumComponents()
This method returns the number of objects from its list of components.
Definition CGenericObject.h:731
cVector3d getLocalPos() const
This method returns the local position of this object.
Definition CGenericObject.h:192
cTransform getLocalTransform()
This method returns the local position and rotation matrix in a transformation matrix.
Definition CGenericObject.h:227
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,...
Definition CGenericObject.cpp:2058
void deleteAllEffects()
This method removes all haptic effects.
Definition CGenericObject.cpp:555
bool getWireMode() const
This method returns whether wireframe rendering is enabled.
Definition CGenericObject.h:433
void setLocalTransform(const cTransform &a_transform)
This method returns the local position and rotation matrix by passing a transformation matrix.
Definition CGenericObject.h:220
cGenericCollision * m_collisionDetector
The collision detector used to test for contact with this object.
Definition CGenericObject.h:953
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 chil...
Definition CGenericObject.cpp:1804
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),...
Definition CGenericObject.cpp:1107
bool m_cullingEnabled
Definition CGenericObject.h:934
bool getBoundaryBoxEmpty()
This method returns true, if the boundary box is empty, otherwise false.
Definition CGenericObject.h:597
void * m_userData
An arbitrary data pointer, not used by CHAI3D.
Definition CGenericObject.h:785
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 i...
Definition CGenericObject.cpp:1722
cTransform m_frameGL
OpenGL matrix describing my position and orientation transformation.
Definition CGenericObject.h:943
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.
Definition CGenericObject.cpp:333
void createEffectVibration(const bool a_affectChildren=false, const bool a_affectComponents=true)
This method creates a vibration haptic effect.
Definition CGenericObject.cpp:846
bool removeEffect(cGenericEffect *a_effect)
This method removes a haptic effect from this object.
Definition CGenericObject.cpp:531
bool m_useTransparency
Definition CGenericObject.h:922
bool m_showBoundaryBox
If true, this object's boundary box is displayed as a set of lines.
Definition CGenericObject.h:893
double m_frameSize
Size of graphical representation of frame (X-Y-Z).
Definition CGenericObject.h:865
void deleteAllChildren()
This method clears and delete all objects from its list of children.
Definition CGenericObject.cpp:2599
bool m_interactionInside
Was the last tool (haptic point) located inside the object?
Definition CGenericObject.h:1029
void clearAllComponents()
This method clears all objects from its list of components, without deleting them.
Definition CGenericObject.cpp:2744
bool m_hapticEnabled
If true, this object can be felt.
Definition CGenericObject.h:884
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.
Definition CGenericObject.cpp:350
void deleteEffectViscosity(const bool a_affectChildren=false, const bool a_affectComponents=true)
This method deletes any current viscous haptic effect.
Definition CGenericObject.cpp:984
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 child...
Definition CGenericObject.cpp:1550
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 ...
Definition CGenericObject.cpp:1587
void setCollisionDetector(cGenericCollision *a_collisionDetector)
This method sets a collision detector to this current object.
Definition CGenericObject.h:633
virtual void computeBoundaryBox(const bool a_includeChildren=true)
This method computes this object's boundary box, optionally forcing it to bound child objects.
Definition CGenericObject.cpp:1887
std::vector< cGenericObject * > m_components
List of components. Components are sub objects of the current object.
Definition CGenericObject.h:811
cTexture1dPtr m_texture
Texture property.
Definition CGenericObject.h:769
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.
Definition CGenericObject.cpp:422
bool addEffect(cGenericEffect *a_effect)
This method adds a haptic effect to this object.
Definition CGenericObject.cpp:506
double m_frameThicknessScale
Pen thickness of graphical representation of frame (X-Y-Z).
Definition CGenericObject.h:868
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.
Definition CGenericObject.cpp:2788
cGenericObject * getParent() const
This method returns the parent of this object.
Definition CGenericObject.h:672
bool getEnabled() const
This method returns true if the object is enabled, false otherwise.
Definition CGenericObject.h:144
bool getShowBoundaryBox() const
This method returns true if the boundary box is being displayed, false otherwise.
Definition CGenericObject.h:585
void translate(const cVector3d &a_translation)
This method translates this object by a specified offset.
Definition CGenericObject.cpp:300
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.
Definition CGenericObject.h:251
bool getUseTexture() const
This method returns true if texture-mapping is enabled, false otherwise.
Definition CGenericObject.h:540
void createEffectSurface(const bool a_affectChildren=false, const bool a_affectComponents=true)
This method creates a surface haptic effect.
Definition CGenericObject.cpp:755
cGenericObject * getRootObject()
This method returns the root object of the scenegraph.
Definition CGenericObject.cpp:2528
std::vector< cGenericObject * > m_children
List of children.
Definition CGenericObject.h:814
void createEffectStickSlip(const bool a_affectChildren=false, const bool a_affectComponents=true)
This method creates a stick-and-slip haptic effect.
Definition CGenericObject.cpp:665
virtual void updateGlobalPositions(const bool a_frameOnly)
This method update the global position information about this object.
Definition CGenericObject.h:976
bool deleteComponent(cGenericObject *a_object)
This method removes an object from its list of components and deletes it.
Definition CGenericObject.cpp:2719
cVector3d m_prevGlobalPos
Previous position since last haptic computation.
Definition CGenericObject.h:836
unsigned int getNumChildren()
This method returns the number of objects from its list of children.
Definition CGenericObject.h:705
bool m_boundaryBoxEmpty
If true, then the boundary box does not include any object.
Definition CGenericObject.h:855
virtual void updateBoundaryBox()
This method updates the boundary box of this object.
Definition CGenericObject.h:979
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 ...
Definition CGenericObject.cpp:1631
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.
Definition CGenericObject.cpp:1351
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 the current object.
Definition CGenericObject.cpp:2876
cShaderProgramPtr m_shaderProgram
Shader program.
Definition CGenericObject.h:940
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.
Definition CGenericObject.cpp:2378
cGenericObject * m_parent
Parent object.
Definition CGenericObject.h:801
cNormalMapPtr m_normalMap
Normal map property.
Definition CGenericObject.h:772
double getFrameSize() const
This method returns the size of the graphical reference frame.
Definition CGenericObject.h:623
virtual void setLocalPos(const cVector3d &a_localPos)
This method sets the local position of this object.
Definition CGenericObject.h:170
static cColorf s_boundaryBoxColor
Color of the boundary box.
Definition CGenericObject.h:570
bool m_useTextureMapping
Should texture mapping be used?
Definition CGenericObject.h:899
cMatrix3d m_prevGlobalRot
Previous rotation since last haptic computation.
Definition CGenericObject.h:839
cTransform getGlobalTransform()
This method returns the global position and rotation matrix in a transformation matrix.
Definition CGenericObject.h:230
cDisplayList m_displayList
Basic display list for current object.
Definition CGenericObject.h:911
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.
Definition CGenericObject.h:184
bool m_showCollisionDetector
If true, the collision detector is displayed (if available) at this node.
Definition CGenericObject.h:896
cGenericObject * m_owner
Definition CGenericObject.h:808
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.
Definition CGenericObject.h:287
bool getShowFrame(void) const
This method returns true if the display of the reference frame is enabled, false otherwise.
Definition CGenericObject.h:615
bool m_useVertexColors
Should per-vertex colors be used?
Definition CGenericObject.h:905
virtual ~cGenericObject()
Destructor of cGenericObject.
Definition CGenericObject.cpp:194
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 ...
Definition CGenericObject.h:996
std::vector< cGenericEffect * > m_effects
List of haptic effects programmed for this object.
Definition CGenericObject.h:963
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.
Definition CGenericObject.h:278
bool m_useMaterialProperty
Should material properties be used?
Definition CGenericObject.h:902
cGenericObject * getOwner()
This method returns the owner of this object.
Definition CGenericObject.h:678
cVector3d getBoundaryMax() const
This method returns the maximum point of this object's boundary box.
Definition CGenericObject.h:591
cVector3d getBoundaryMin() const
This method returns the minimum point of this object's boundary box.
Definition CGenericObject.h:588
virtual void setLocalRot(const cMatrix3d &a_localRot)
This method sets the local rotation matrix for this object.
Definition CGenericObject.h:198
This class implements an abstract type.
Definition CGenericType.h:76
This class stores a list of interaction events.
Definition CInteractionBasics.h:134
This class implements a 3D multi-mesh object.
Definition CMultiMesh.h:81
Definition CAudioBuffer.cpp:57
double cDegToRad(const double &a_angleDeg)
This function converts an angle from degrees to radians.
Definition CMaths.h:696
std::shared_ptr< cNormalMap > cNormalMapPtr
Definition CNormalMap.h:66
std::shared_ptr< cMaterial > cMaterialPtr
Definition CMaterial.h:69
cMatrix3d cIdentity3d(void)
This function return a 3x3 identity matrix.
Definition CMaths.h:1110
std::shared_ptr< cShaderProgram > cShaderProgramPtr
Definition CShaderProgram.h:71
cEulerOrder
Definition CMatrix3d.h:58
std::shared_ptr< cTexture1d > cTexture1dPtr
Definition CTexture1d.h:68
This structure stores the collision settings that are passed to a collision detector when querying fo...
Definition CCollisionBasics.h:243
This class defines a color using a GLfloat representation for each component.
Definition CColor.h:139
This class models material properties.
Definition CMaterial.h:102
This class implements a 3D matrix.
Definition CMatrix3d.h:98
void copyfrom(const cMatrix3d &a_source)
This method copies all elements from another matrix to this one.
Definition CMatrix3d.h:675
This structures provide a containers for storing rendering options that are passed through the sceneg...
Definition CRenderOptions.h:83
This class implements a 3D vector.
Definition CVector3d.h:89
void mul(const double &a_scalar)
This method computes the multiplication of this vector with a scalar.
Definition CVector3d.h:660