CGenericObject.h
Go to the documentation of this file.
1 //==============================================================================
2 /*
3  Software License Agreement (BSD License)
4  Copyright (c) 2003-2016, CHAI3D.
5  (www.chai3d.org)
6 
7  All rights reserved.
8 
9  Redistribution and use in source and binary forms, with or without
10  modification, are permitted provided that the following conditions
11  are met:
12 
13  * Redistributions of source code must retain the above copyright
14  notice, this list of conditions and the following disclaimer.
15 
16  * Redistributions in binary form must reproduce the above
17  copyright notice, this list of conditions and the following
18  disclaimer in the documentation and/or other materials provided
19  with the distribution.
20 
21  * Neither the name of CHAI3D nor the names of its contributors may
22  be used to endorse or promote products derived from this software
23  without specific prior written permission.
24 
25  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
28  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
29  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
30  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
31  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
32  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
33  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
35  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36  POSSIBILITY OF SUCH DAMAGE.
37 
38  \author <http://www.chai3d.org>
39  \author Francois Conti
40  \author Dan Morris
41  \version 3.2.0 $Rev: 2014 $
42 */
43 //==============================================================================
44 
45 //------------------------------------------------------------------------------
46 #ifndef CGenericObjectH
47 #define CGenericObjectH
48 //------------------------------------------------------------------------------
50 #include "effects/CGenericEffect.h"
52 #include "graphics/CDraw3D.h"
53 #include "graphics/CColor.h"
54 #include "graphics/CDisplayList.h"
56 #include "materials/CMaterial.h"
57 #include "materials/CNormalMap.h"
58 #include "math/CMaths.h"
59 #include "math/CTransform.h"
60 #include "system/CGenericType.h"
61 //------------------------------------------------------------------------------
62 #include <vector>
63 #include <list>
64 //------------------------------------------------------------------------------
65 
66 //------------------------------------------------------------------------------
67 namespace chai3d {
68 //------------------------------------------------------------------------------
69 
70 //------------------------------------------------------------------------------
71 class cGenericCollision;
72 class cGenericForceAlgorithm;
73 class cMultiMesh;
74 class cShaderProgram;
75 class cInteractionRecorder;
76 //------------------------------------------------------------------------------
77 typedef std::shared_ptr<cShaderProgram> cShaderProgramPtr;
78 //------------------------------------------------------------------------------
79 
80 //==============================================================================
87 //==============================================================================
88 
89 //==============================================================================
111 //==============================================================================
113 {
114  friend class cMultiMesh;
115 
116  //--------------------------------------------------------------------------
117  // CONSTRUCTOR & DESTRUCTOR:
118  //--------------------------------------------------------------------------
119 
120 public:
121 
123  cGenericObject();
124 
126  virtual ~cGenericObject();
127 
128 
129  //--------------------------------------------------------------------------
130  // PUBLIC METHODS - GENERAL
131  //--------------------------------------------------------------------------
132 
133 public:
134 
136  virtual void setEnabled(bool a_enabled, const bool a_affectChildren = false);
137 
139  bool getEnabled() const { return (m_enabled); }
140 
141 
142  //-----------------------------------------------------------------------
143  // PUBLIC METHODS - COPY:
144  //-----------------------------------------------------------------------
145 
146 public:
147 
149  virtual cGenericObject* copy(const bool a_duplicateMaterialData = false,
150  const bool a_duplicateTextureData = false,
151  const bool a_duplicateMeshData = false,
152  const bool a_buildCollisionDetector = true) { return (NULL); }
153 
154 
155  //-----------------------------------------------------------------------
156  // PUBLIC METHODS - TRANSLATION AND ORIENTATION:
157  //-----------------------------------------------------------------------
158 
159 public:
160 
162  virtual void setLocalPos(const cVector3d& a_localPos)
163  {
164  m_localPos = a_localPos;
165  }
166 
167 #ifdef C_USE_EIGEN
168  void setLocalPos(const Eigen::Vector3d& a_localPos)
170  {
171  setLocalPos(cVector3d(a_localPos[0], a_localPos[1], a_localPos[2]));
172  }
173 #endif
174 
176  void setLocalPos(const double a_x = 0.0,
177  const double a_y = 0.0,
178  const double a_z = 0.0)
179  {
180  setLocalPos(cVector3d(a_x, a_y, a_z));
181  }
182 
184  inline cVector3d getLocalPos() const { return (m_localPos); }
185 
187  inline cVector3d getGlobalPos() const { return (m_globalPos); }
188 
190  virtual void setLocalRot(const cMatrix3d& a_localRot)
191  {
192  m_localRot = a_localRot;
193  }
194 
195 #ifdef C_USE_EIGEN
196  inline void setLocalRot(const Eigen::Matrix3d a_localRot)
198  {
199  cMatrix3d localRot;
200  localRot.copyfrom(a_localRot);
201  setLocalRot(localRot);
202  }
203 #endif
204 
206  inline cMatrix3d getLocalRot() const { return (m_localRot); }
207 
209  inline cMatrix3d getGlobalRot() const { return (m_globalRot); }
210 
212  inline void setLocalTransform(const cTransform& a_transform)
213  {
214  setLocalPos(a_transform.getLocalPos());
215  setLocalRot(a_transform.getLocalRot());
216  }
217 
220 
223 
225  void translate(const cVector3d& a_translation);
226 
228  void translate(const double a_x,
229  const double a_y,
230  const double a_z = 0.0);
231 
233  void rotateAboutLocalAxisRad(const cVector3d& a_axis, const double a_angleRad);
234 
236  inline void rotateAboutLocalAxisDeg(const cVector3d& a_axis,
237  const double a_angleDeg)
238  {
239  rotateAboutLocalAxisRad(a_axis, cDegToRad(a_angleDeg));
240  }
241 
243  inline void rotateAboutLocalAxisRad(const double a_axisX,
244  const double a_axisY,
245  const double a_axisZ,
246  const double a_angleRad)
247  {
248  rotateAboutLocalAxisRad(cVector3d(a_axisX, a_axisY, a_axisZ), a_angleRad);
249  }
250 
252  inline void rotateAboutLocalAxisDeg(const double a_axisX,
253  const double a_axisY,
254  const double a_axisZ,
255  const double a_angleDeg)
256  {
257  rotateAboutLocalAxisRad(cVector3d(a_axisX, a_axisY, a_axisZ), cDegToRad(a_angleDeg));
258  }
259 
261  void rotateAboutGlobalAxisRad(const cVector3d& a_axis, const double a_angleRad);
262 
264  inline void rotateAboutGlobalAxisDeg(const cVector3d& a_axis, const double a_angleDeg)
265  {
266  rotateAboutGlobalAxisRad(a_axis, cDegToRad(a_angleDeg));
267  }
268 
270  inline void rotateAboutGlobalAxisRad(const double a_axisX,
271  const double a_axisY,
272  const double a_axisZ,
273  const double a_angleRad)
274  {
275  rotateAboutGlobalAxisRad(cVector3d(a_axisX, a_axisY, a_axisZ), a_angleRad);
276  }
277 
279  inline void rotateAboutGlobalAxisDeg(const double a_axisX,
280  const double a_axisY,
281  const double a_axisZ,
282  const double a_angleDeg)
283  {
284  rotateAboutGlobalAxisRad(cVector3d(a_axisX, a_axisY, a_axisZ), cDegToRad(a_angleDeg));
285  }
286 
288  void rotateExtrinsicEulerAnglesRad(const double& a_angleRad1,
289  const double& a_angleRad2,
290  const double& a_angleRad3,
291  const cEulerOrder a_eulerOrder);
292 
294  void rotateExtrinsicEulerAnglesDeg(const double& a_angleDeg1,
295  const double& a_angleDeg2,
296  const double& a_angleDeg3,
297  const cEulerOrder a_eulerOrder)
298  {
299  rotateExtrinsicEulerAnglesRad(cDegToRad(a_angleDeg1), cDegToRad(a_angleDeg2), cDegToRad(a_angleDeg3), a_eulerOrder);
300  }
301 
303  void rotateIntrinsicEulerAnglesRad(const double& a_angleRad1,
304  const double& a_angleRad2,
305  const double& a_angleRad3,
306  const cEulerOrder a_eulerOrder);
307 
309  void rotateIntrinsicEulerAnglesDeg(const double& a_angleDeg1,
310  const double& a_angleDeg2,
311  const double& a_angleDeg3,
312  const cEulerOrder a_eulerOrder)
313  {
314  rotateIntrinsicEulerAnglesRad(cDegToRad(a_angleDeg1), cDegToRad(a_angleDeg2), cDegToRad(a_angleDeg3), a_eulerOrder);
315  }
316 
317 
318  //-----------------------------------------------------------------------
319  // PUBLIC METHODS - COMPUTING GLOBAL POSITIONS:
320  //-----------------------------------------------------------------------
321 
322 public:
323 
325  virtual void computeGlobalPositions(const bool a_frameOnly = true,
326  const cVector3d& a_globalPos = cVector3d(0.0, 0.0, 0.0),
327  const cMatrix3d& a_globalRot = cIdentity3d());
328 
330  void computeGlobalPositionsFromRoot(const bool a_frameOnly = true);
331 
332 
333  //-----------------------------------------------------------------------
334  // PUBLIC METHODS - HAPTIC EFFECTS:
335  //-----------------------------------------------------------------------
336 
337 public:
338 
340  bool addEffect(cGenericEffect* a_effect);
341 
343  bool removeEffect(cGenericEffect* a_effect);
344 
346  void deleteAllEffects();
347 
349  bool createEffectMagnetic();
350 
352  bool deleteEffectMagnetic();
353 
355  bool createEffectStickSlip();
356 
358  bool deleteEffectStickSlip();
359 
361  bool createEffectSurface();
362 
364  bool deleteEffectSurface();
365 
367  bool createEffectVibration();
368 
370  bool deleteEffectVibration();
371 
373  bool createEffectViscosity();
374 
376  bool deleteEffectViscosity();
377 
378 
379  //-----------------------------------------------------------------------
380  // PUBLIC METHODS - HAPTIC PROPERTIES:
381  //-----------------------------------------------------------------------
382 
383 public:
384 
386  virtual void setHapticEnabled(const bool a_hapticEnabled, const bool a_affectChildren = true);
387 
389  inline bool getHapticEnabled() const { return (m_hapticEnabled); }
390 
392  virtual void setStiffness(const double a_stiffness, const bool a_affectChildren = true);
393 
395  virtual void setFriction(double a_staticFriction,
396  double a_dynamicFriction,
397  const bool a_affectChildren = true);
398 
399 
400  //-----------------------------------------------------------------------
401  // PUBLIC METHODS - GRAPHIC PROPERTIES:
402  //-----------------------------------------------------------------------
403 
404 public:
405 
407  virtual void setShowEnabled(const bool a_show, const bool a_affectChildren = true);
408 
410  inline bool getShowEnabled() const { return (m_showEnabled); }
411 
413  virtual void setWireMode(const bool a_showWireMode, const bool a_affectChildren = false);
414 
416  inline bool getWireMode() const { return (m_triangleMode == GL_LINE); }
417 
419  virtual void setUseCulling(const bool a_useCulling, const bool a_affectChildren = false);
420 
422  inline bool getUseCulling() const { return (m_cullingEnabled); }
423 
424 
425  //-----------------------------------------------------------------------
426  // PUBLIC METHODS - TRANSPARENCY:
427  //-----------------------------------------------------------------------
428 
430  virtual void setUseTransparency(const bool a_useTransparency, const bool a_affectChildren = false);
431 
433  inline bool getUseTransparency() const { return m_useTransparency; }
434 
436  virtual void setTransparencyLevel(const float a_level,
437  const bool a_applyToVertices = false,
438  const bool a_applyToTextures = false,
439  const bool a_affectChildren = false);
440 
441 
442  //-----------------------------------------------------------------------
443  // PUBLIC METHODS - DISPLAY LISTS:
444  //-----------------------------------------------------------------------
445 
446 public:
447 
449  virtual void setUseDisplayList(const bool a_useDisplayList, const bool a_affectChildren = false);
450 
452  inline bool getUseDisplayList() const { return (m_useDisplayList); }
453 
455  virtual void markForUpdate(const bool a_affectChildren = false);
456 
457 
458  //-----------------------------------------------------------------------
459  // PUBLIC METHODS - VERTEX COLORS:
460  //-----------------------------------------------------------------------
461 
462 public:
463 
465  virtual void setUseVertexColors(const bool a_useColors, const bool a_affectChildren = false);
466 
468  inline bool getUseVertexColors() const { return (m_useVertexColors); }
469 
470 
471  //-----------------------------------------------------------------------
472  // PUBLIC METHODS - MATERIAL PROPERTIES:
473  //-----------------------------------------------------------------------
474 
475 public:
476 
478  virtual void setUseMaterial(const bool a_useMaterial, const bool a_affectChildren = false);
479 
481  inline bool getUseMaterial() const { return (m_useMaterialProperty); }
482 
484  virtual void setMaterial(cMaterialPtr a_material, const bool a_affectChildren = false);
485 
487  virtual void setMaterial(cMaterial& a_material, const bool a_affectChildren = false);
488 
490  virtual void backupMaterialColors(const bool a_affectChildren = false);
491 
493  virtual void restoreMaterialColors(const bool a_affectChildren = false);
494 
495 
496  //--------------------------------------------------------------------------
497  // PUBLIC METHODS - TEXTURE PROPERTIES:
498  //-----------------------------------------------------------------------
499 
500 public:
501 
503  virtual void setUseTexture(const bool a_useTexture, const bool a_affectChildren = false);
504 
506  inline bool getUseTexture() const { return (m_useTextureMapping); }
507 
509  virtual void setTexture(cTexture1dPtr a_texture, const bool a_affectChildren = false);
510 
511 
512  //-----------------------------------------------------------------------
513  // PUBLIC METHODS - SHADERS:
514  //-----------------------------------------------------------------------
515 
516 public:
517 
519  virtual void setShaderProgram(cShaderProgramPtr a_shaderProgram, const bool a_affectChildren = false);
520 
522  virtual cShaderProgramPtr getShaderProgram() { return (m_shaderProgram); }
523 
524 
525  //-----------------------------------------------------------------------
526  // PUBLIC MEMBERS - BOUNDARY BOX:
527  //-----------------------------------------------------------------------
528 
529 public:
530 
533 
534 
535  //-----------------------------------------------------------------------
536  // PUBLIC METHODS - BOUNDARY BOX:
537  //-----------------------------------------------------------------------
538 
539 public:
540 
542  virtual void setShowBoundaryBox(const bool a_showBoundaryBox, const bool a_affectChildren = false);
543 
545  inline bool getShowBoundaryBox() const { return (m_showBoundaryBox); }
546 
548  inline cVector3d getBoundaryMin() const { return (m_boundaryBoxMin); }
549 
551  inline cVector3d getBoundaryMax() const { return (m_boundaryBoxMax); }
552 
555 
557  inline bool getBoundaryBoxEmpty() { return (m_boundaryBoxEmpty); }
558 
560  virtual void computeBoundaryBox(const bool a_includeChildren = true);
561 
562 
563  //-----------------------------------------------------------------------
564  // PUBLIC METHODS - REFERENCE FRAME REPRESENTATION:
565  //-----------------------------------------------------------------------
566 
567 public:
568 
570  virtual void setShowFrame(const bool a_showFrame, const bool a_affectChildren = false);
571 
573  inline bool getShowFrame(void) const { return (m_showFrame); }
574 
576  virtual void setFrameSize(const double a_size = 1.0, const bool a_affectChildren = false);
577 
579  inline double getFrameSize() const { return (m_frameSize); }
580 
581 
582  //-----------------------------------------------------------------------
583  // PUBLIC METHODS - COLLISION DETECTION:
584  //-----------------------------------------------------------------------
585 
586 public:
587 
589  void setCollisionDetector(cGenericCollision* a_collisionDetector) { m_collisionDetector = a_collisionDetector; }
590 
593 
595  virtual void deleteCollisionDetector(const bool a_affectChildren = false);
596 
598  virtual bool computeCollisionDetection(const cVector3d& a_segmentPointA,
599  const cVector3d& a_segmentPointB,
600  cCollisionRecorder& a_recorder,
601  cCollisionSettings& a_settings);
602 
604  virtual void setShowCollisionDetector(const bool a_showCollisionDetector, const bool a_affectChildren = false);
605 
608 
610  virtual void setCollisionDetectorProperties(unsigned int a_displayDepth,
611  cColorf& a_color,
612  const bool a_affectChildren = false);
613 
614 
615  //-----------------------------------------------------------------------
616  // PUBLIC METHODS - SCENE GRAPH:
617  //-----------------------------------------------------------------------
618 
619 public:
620 
622  inline void setParent(cGenericObject* a_parent) { m_parent = a_parent; }
623 
625  inline cGenericObject* getParent() const { return (m_parent); }
626 
628  inline void setOwner(cGenericObject* a_owner) { m_owner = a_owner; }
629 
631  inline cGenericObject* getOwner() { return (m_owner); }
632 
634  inline cGenericObject* getChild(const unsigned int a_index) const { return (m_children[a_index]); }
635 
637  bool addChild(cGenericObject* a_object);
638 
640  bool removeChild(cGenericObject* a_object);
641 
643  bool removeFromGraph();
644 
646  bool deleteChild(cGenericObject *a_object);
647 
649  void clearAllChildren();
650 
652  void deleteAllChildren();
653 
655  inline unsigned int getNumChildren() { return ((unsigned int)m_children.size()); }
656 
658  inline unsigned int getNumDescendants(bool a_includeCurrentObject = false);
659 
660 
661  //-----------------------------------------------------------------------
662  // PUBLIC METHODS - GHOSTING:
663  //-----------------------------------------------------------------------
664 
665 public:
666 
668  void setGhostEnabled(bool a_ghostEnabled) { m_ghostEnabled = a_ghostEnabled; }
669 
671  bool getGhostEnabled() { return (m_ghostEnabled); }
672 
673 
674  //-----------------------------------------------------------------------
675  // PUBLIC METHODS - GEOMETRY:
676  //-----------------------------------------------------------------------
677 
678 public:
679 
681  virtual void scale(const double& a_scaleFactor, const bool a_affectChildren = true);
682 
683 
684  //-----------------------------------------------------------------------
685  // PUBLIC MEMBERS - PROPERTIES:
686  //-----------------------------------------------------------------------
687 
688 public:
689 
691  std::string m_name;
692 
695 
698 
701 
702 
703  //-----------------------------------------------------------------------
704  // PUBLIC MEMBERS - CUSTOM USER DATA:
705  //-----------------------------------------------------------------------
706 
707 public:
708 
711 
713  void* m_userData;
714 
716  std::string m_userName;
717 
720 
721 
722  //-----------------------------------------------------------------------
723  // PROTECTED MEMBERS - SCENEGRAPH:
724  //-----------------------------------------------------------------------
725 
726 protected:
727 
730 
737 
739  std::vector<cGenericObject*> m_children;
740 
741 
742  //-----------------------------------------------------------------------
743  // PROTECTED MEMBERS - POSITION & ORIENTATION:
744  //-----------------------------------------------------------------------
745 
746 protected:
747 
750 
753 
756 
759 
762 
765 
766 
767  //-----------------------------------------------------------------------
768  // PROTECTED MEMBERS - BOUNDARY BOX
769  //-----------------------------------------------------------------------
770 
771 protected:
772 
775 
778 
781 
782 
783  //-----------------------------------------------------------------------
784  // PROTECTED MEMBERS - FRAME REPRESENTATION [X,Y,Z]:
785  //-----------------------------------------------------------------------
786 
787 protected:
788 
790  double m_frameSize;
791 
794 
795 
796  //-----------------------------------------------------------------------
797  // PROTECTED MEMBERS - GENERAL OPTIONS:
798  //-----------------------------------------------------------------------
799 
800 protected:
801 
803  bool m_enabled;
804 
807 
810 
813 
816 
819 
822 
825 
828 
831 
834 
837 
840 
848 
860 
863 
865  cShaderProgramPtr m_shaderProgram;
866 
869 
870 
871  //-----------------------------------------------------------------------
872  // PROTECTED MEMBERS - COLLISION DETECTION:
873  //-----------------------------------------------------------------------
874 
875 protected:
876 
879 
880 
881  //-----------------------------------------------------------------------
882  // PROTECTED MEMBERS - HAPTIC EFFECTS AND INTERACTIONS:
883  //-----------------------------------------------------------------------
884 
885 protected:
886 
888  std::vector<cGenericEffect*> m_effects;
889 
890 
891  //-----------------------------------------------------------------------
892  // PROTECTED VIRTUAL METHODS:
893  //-----------------------------------------------------------------------
894 
895 protected:
896 
898  virtual void render(cRenderOptions& a_options);
899 
901  virtual void updateGlobalPositions(const bool a_frameOnly) {};
902 
904  virtual void updateBoundaryBox() {};
905 
907  virtual void scaleObject(const double& a_scaleFactor) { m_boundaryBoxMin.mul(a_scaleFactor); m_boundaryBoxMax.mul(a_scaleFactor);}
908 
910  virtual void computeLocalInteraction(const cVector3d& a_toolPos,
911  const cVector3d& a_toolVel,
912  const unsigned int a_IDN);
913 
915  virtual cVector3d computeOtherInteractions(const cVector3d& a_toolPos,
916  const cVector3d& a_toolVel,
917  const unsigned int a_IDN,
918  cInteractionRecorder& a_interactions) { return cVector3d(0,0,0); }
919 
921  virtual bool computeOtherCollisionDetection(cVector3d& a_segmentPointA,
922  cVector3d& a_segmentPointB,
923  cCollisionRecorder& a_recorder,
924  cCollisionSettings& a_settings) {return(false);}
925 
926 
927  //-----------------------------------------------------------------------
928  // PROTECTED METHODS:
929  //-----------------------------------------------------------------------
930 
931 protected:
932 
935  const bool a_duplicateMaterialData,
936  const bool a_duplicateTextureData,
937  const bool a_duplicateMeshData,
938  const bool a_buildCollisionDetector);
939 
940 
941  //-----------------------------------------------------------------------
942  // PUBLIC MEMBERS - INTERACTIONS:
943  //-----------------------------------------------------------------------
944 
945 public:
946 
949 
952 
955 
956 
957  //-----------------------------------------------------------------------
958  // PUBLIC MEMBERS - GENERAL
959  //-----------------------------------------------------------------------
960 
961 public:
962 
964  virtual void renderSceneGraph(cRenderOptions& a_options);
965 
967  virtual void adjustCollisionSegment(cVector3d& a_segmentPointA, cVector3d& a_segmentPointAadjusted);
968 
970  virtual cVector3d computeInteractions(const cVector3d& a_toolPos,
971  const cVector3d& a_toolVel,
972  const unsigned int a_IDN,
973  cInteractionRecorder& a_interactions);
974 };
975 
976 //------------------------------------------------------------------------------
977 } // namespace chai3d
978 //------------------------------------------------------------------------------
979 
980 //------------------------------------------------------------------------------
981 #endif
982 //------------------------------------------------------------------------------
983 
This class implements a 3D vector.
Definition: CVector3d.h:88
bool createEffectStickSlip()
This method creates a stick-and-slip haptic effect.
Definition: CGenericObject.cpp:556
This structures provide a containers for storing rendering options that are passed through the sceneg...
Definition: CRenderOptions.h:82
virtual void setUseVertexColors(const bool a_useColors, const bool a_affectChildren=false)
This method enables or disables the use of per-vertex colors, optionally propagating the operation to...
Definition: CGenericObject.cpp:1029
void clearAllChildren()
This method clears all objects from its list of children, without deleting them.
Definition: CGenericObject.cpp:1912
cVector3d getGlobalPos() const
This method returns the global position of this object.
Definition: CGenericObject.h:187
void deleteAllChildren()
This method clears and delete all objects from its list of children.
Definition: CGenericObject.cpp:1931
cTransform getLocalTransform()
This method returns the local position and rotation matrix in a transformation matrix.
Definition: CGenericObject.h:219
virtual void setShowCollisionDetector(const bool a_showCollisionDetector, const bool a_affectChildren=false)
This method enables or disables the display of the collision detector, optionally propagating the cha...
Definition: CGenericObject.cpp:1721
bool getHapticEnabled() const
This method returns the haptic status of object (true means it can be felt when visible).
Definition: CGenericObject.h:389
cVector3d m_interactionNormal
Surface normal at the current interaction point.
Definition: CGenericObject.h:951
Implements general math utility functions.
bool createEffectVibration()
This method creates a vibration haptic effect.
Definition: CGenericObject.cpp:662
cVector3d getBoundaryCenter() const
This method computes and returns the center of this object&#39;s boundary box.
Definition: CGenericObject.h:554
bool getShowEnabled() const
This method returns the display status of object (true means it&#39;s visible).
Definition: CGenericObject.h:410
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:309
This class implements a 3D multi-mesh object.
Definition: CMultiMesh.h:80
cVector3d getBoundaryMin() const
This method returns the minimum point of this object&#39;s boundary box.
Definition: CGenericObject.h:548
virtual void setUseDisplayList(const bool a_useDisplayList, const bool a_affectChildren=false)
This method enabled or disables the use of a display list for rendering, optionally propagating the o...
Definition: CGenericObject.cpp:1114
bool removeChild(cGenericObject *a_object)
This method removes an object from the list of children, without deleting it.
Definition: CGenericObject.cpp:1830
virtual void setFriction(double a_staticFriction, double a_dynamicFriction, const bool a_affectChildren=true)
This method sets the static and dynamic friction properties (polygonal models only), optionally recursively affecting children.
Definition: CGenericObject.cpp:825
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:915
bool deleteEffectMagnetic()
This method deletes any current magnetic haptic effect.
Definition: CGenericObject.cpp:532
This class provides support for OpenGL display lists.
Definition: CDisplayList.h:76
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:176
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:243
double getFrameSize() const
This method returns the size of the graphical reference frame.
Definition: CGenericObject.h:579
Implements a normal map.
void deleteAllEffects()
This method removes all haptic effects.
Definition: CGenericObject.cpp:485
virtual void setFrameSize(const double a_size=1.0, const bool a_affectChildren=false)
This method sets the size of the rendered reference frame, optionally propagating the change to its c...
Definition: CGenericObject.cpp:1529
bool m_enabled
If true, the object may be rendered graphically and haptically.
Definition: CGenericObject.h:803
cVector3d m_localPos
The position of this object in my parent&#39;s reference frame.
Definition: CGenericObject.h:749
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:2430
cMatrix3d m_localRot
The rotation matrix that rotates my reference frame into my parent&#39;s reference frame.
Definition: CGenericObject.h:755
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:2056
cGenericCollision * getCollisionDetector() const
This method returns a pointer to this object&#39;s current collision detector.
Definition: CGenericObject.h:592
cGenericObject * getOwner()
This method returns the owner of this object.
Definition: CGenericObject.h:631
virtual void markForUpdate(const bool a_affectChildren=false)
This method invalidates any existing display lists, optionally propagating the operation to its child...
Definition: CGenericObject.cpp:1141
Implements basic structures for handling interaction events.
bool m_showBoundaryBox
If true, this object&#39;s boundary box is displayed as a set of lines.
Definition: CGenericObject.h:818
This class implements a base class for collision detection.
Definition: CGenericCollision.h:101
void setParent(cGenericObject *a_parent)
This method sets the parent of this object.
Definition: CGenericObject.h:622
bool m_useMaterialProperty
Should material properties be used?
Definition: CGenericObject.h:827
virtual void setUseCulling(const bool a_useCulling, const bool a_affectChildren=false)
This method enables or disables face-culling, optionally propagating the operation to my children...
Definition: CGenericObject.cpp:1002
bool getWireMode() const
This method returns whether wireframe rendering is enabled.
Definition: CGenericObject.h:416
cVector3d getLocalPos() const
This method returns the translational component of this matrix.
Definition: CTransform.h:485
cGenericObject()
Constructor of cGenericObject.
Definition: CGenericObject.cpp:77
std::shared_ptr< cTexture1d > cTexture1dPtr
Definition: CTexture1d.h:67
bool deleteEffectVibration()
This method deletes any current vibration haptic effect.
Definition: CGenericObject.cpp:691
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:628
virtual void setTexture(cTexture1dPtr a_texture, const bool a_affectChildren=false)
This method sets a texture to this object, optionally propagating the operation to its children...
Definition: CGenericObject.cpp:1295
bool m_cullingEnabled
Definition: CGenericObject.h:859
std::shared_ptr< cMaterial > cMaterialPtr
Definition: CMaterial.h:67
bool m_useVertexColors
Should per-vertex colors be used?
Definition: CGenericObject.h:830
double cDegToRad(const double &a_angleDeg)
This function converts an angle from degrees to radians.
Definition: CMaths.h:633
bool createEffectViscosity()
This method creates a viscous haptic effect.
Definition: CGenericObject.cpp:715
bool deleteChild(cGenericObject *a_object)
This method removes an object from its list of children and deletes it.
Definition: CGenericObject.cpp:1887
bool m_showEnabled
If true, this object is rendered.
Definition: CGenericObject.h:806
This class implements an abstract type.
Definition: CGenericType.h:73
bool m_showCollisionDetector
If true, the collision detector is displayed (if available) at this node.
Definition: CGenericObject.h:821
virtual void setWireMode(const bool a_showWireMode, const bool a_affectChildren=false)
This method enables or disables wireframe rendering, optionally propagating the operation to my child...
Definition: CGenericObject.cpp:967
bool removeFromGraph()
This method removes this object from its parent&#39;s list of children.
Definition: CGenericObject.cpp:1863
cMatrix3d m_globalRot
The rotation matrix that rotates my reference frame into the world&#39;s reference frame.
Definition: CGenericObject.h:758
virtual void setCollisionDetectorProperties(unsigned int a_displayDepth, cColorf &a_color, const bool a_affectChildren=false)
This method sets the collision detector graphic display properties.
Definition: CGenericObject.cpp:1752
void * m_userData
An arbitrary data pointer, not used by CHAI3D.
Definition: CGenericObject.h:713
Implementation of class that supports OpenGL display lists.
virtual void updateGlobalPositions(const bool a_frameOnly)
This method update the global position information about this object.
Definition: CGenericObject.h:901
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:286
This class implements a base class for all 2D or 3D objects in CHAI3D.
Definition: CGenericObject.h:112
cGenericObject * getParent() const
This method returns the parent of this object.
Definition: CGenericObject.h:625
virtual void deleteCollisionDetector(const bool a_affectChildren=false)
This method deletes any existing collision detector.
Definition: CGenericObject.cpp:1560
bool m_ghostEnabled
If true, object is enabled as ghost.
Definition: CGenericObject.h:812
cMatrix3d getGlobalRot() const
This method returns the global rotation matrix of this object.
Definition: CGenericObject.h:209
This class implements a base class for haptic effects.
Definition: CGenericEffect.h:117
This class implements a 3D matrix.
Definition: CMatrix3d.h:97
virtual void setLocalRot(const cMatrix3d &a_localRot)
This method sets the local rotation matrix for this object.
Definition: CGenericObject.h:190
cGenericObject * m_userExternalObject
A link to an external cGenericObject object, not used by CHAI3D.
Definition: CGenericObject.h:719
bool m_interactionInside
Was the last tool (haptic point) located inside the object?
Definition: CGenericObject.h:954
This class implements a collision detection recorder that stores all collision events that are report...
Definition: CCollisionBasics.h:185
This class implements a 4D transformation matrix encoded as column-major.
Definition: CTransform.h:75
cDisplayList m_displayList
Basic display list for current object.
Definition: CGenericObject.h:836
cMatrix3d getLocalRot() const
This method returns the local rotation matrix of this object.
Definition: CGenericObject.h:206
bool removeEffect(cGenericEffect *a_effect)
This method removes a haptic effect from this object.
Definition: CGenericObject.cpp:461
virtual void scale(const double &a_scaleFactor, const bool a_affectChildren=true)
This method scales the size of this object.
Definition: CGenericObject.cpp:1980
cVector3d getLocalPos() const
This method returns the local position of this object.
Definition: CGenericObject.h:184
virtual void scaleObject(const double &a_scaleFactor)
This method scales the size of this object with given scale factor.
Definition: CGenericObject.h:907
cShaderProgramPtr m_shaderProgram
Shader program.
Definition: CGenericObject.h:865
cVector3d m_boundaryBoxMax
Maximum position of boundary box.
Definition: CGenericObject.h:777
This structure stores the collision settings that are passed to a collision detector when querying fo...
Definition: CCollisionBasics.h:242
bool createEffectSurface()
This method creates a surface haptic effect.
Definition: CGenericObject.cpp:608
This class models material properties.
Definition: CMaterial.h:100
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:252
std::string m_userName
Name of current object, not used by CHAI3D.
Definition: CGenericObject.h:716
void setGhostEnabled(bool a_ghostEnabled)
This method enables or disables this object to be a ghost node.
Definition: CGenericObject.h:668
Implements a structure to store rendering options.
Implements a base class for haptic effects.
cVector3d m_prevGlobalPos
Previous position since last haptic computation.
Definition: CGenericObject.h:761
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:270
virtual void setShowBoundaryBox(const bool a_showBoundaryBox, const bool a_affectChildren=false)
This method enables or disabled the graphic display of the boundary box for this object, optionally propagating the change to its children.
Definition: CGenericObject.cpp:1352
cVector3d getBoundaryMax() const
This method returns the maximum point of this object&#39;s boundary box.
Definition: CGenericObject.h:551
bool m_useDisplayList
Should we use a display list to render this mesh?
Definition: CGenericObject.h:833
cVector3d m_boundaryBoxMin
Minimum position of boundary box.
Definition: CGenericObject.h:774
std::vector< cGenericObject * > m_children
List of children.
Definition: CGenericObject.h:739
virtual void setShowEnabled(const bool a_show, const bool a_affectChildren=true)
This method enables or disables the graphic display of this object, optionally propagating the change...
Definition: CGenericObject.cpp:853
virtual void setLocalPos(const cVector3d &a_localPos)
This method sets the local position of this object.
Definition: CGenericObject.h:162
bool addChild(cGenericObject *a_object)
This method add an object to the list of children.
Definition: CGenericObject.cpp:1787
cMaterialPtr m_material
Material property.
Definition: CGenericObject.h:694
Implements a transformation matrix.
cTransform getGlobalTransform()
This method returns the global position and rotation matrix in a transformation matrix.
Definition: CGenericObject.h:222
bool getUseMaterial() const
This method returns true is material properties are enabled, false otherwise.
Definition: CGenericObject.h:481
Implements OpenGL drawing macros.
virtual void setShaderProgram(cShaderProgramPtr a_shaderProgram, const bool a_affectChildren=false)
This method assigns a shader program to this object, optionally propagating the operation to its chil...
Definition: CGenericObject.cpp:1323
cMatrix3d cIdentity3d(void)
This function return a 3x3 identity matrix.
Definition: CMaths.h:1047
std::string m_name
Name of current object (filename).
Definition: CGenericObject.h:691
virtual cShaderProgramPtr getShaderProgram()
This method returns a pointer to the current shader program.
Definition: CGenericObject.h:522
bool getGhostEnabled()
This method returns truee if this object is a ghost node.
Definition: CGenericObject.h:671
bool getShowCollisionDetector()
This method returns true if the collision detector is being displayed graphically, false otherwise.
Definition: CGenericObject.h:607
int m_userTag
An arbitrary tag, not used by CHAI3D.
Definition: CGenericObject.h:710
virtual void computeBoundaryBox(const bool a_includeChildren=true)
This method computes this object&#39;s boundary box, optionally forcing it to bound child objects...
Definition: CGenericObject.cpp:1383
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:358
cEulerOrder
Definition: CMatrix3d.h:57
bool getShowBoundaryBox() const
This method returns true if the boundary box is being displayed, false otherwise. ...
Definition: CGenericObject.h:545
virtual void render(cRenderOptions &a_options)
This method renders this object graphically using OpenGL.
Definition: CGenericObject.cpp:2040
std::shared_ptr< cNormalMap > cNormalMapPtr
Definition: CNormalMap.h:65
Implements a general abstract type.
bool m_boundaryBoxEmpty
If true, then the boundary box does not include any object.
Definition: CGenericObject.h:780
bool m_useTextureMapping
Should texture mapping be used?
Definition: CGenericObject.h:824
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:2089
void computeGlobalPositionsFromRoot(const bool a_frameOnly=true)
This method computes the global position and rotation of current object only.
Definition: CGenericObject.cpp:398
void setCollisionDetector(cGenericCollision *a_collisionDetector)
This method sets a collision detector to this current object.
Definition: CGenericObject.h:589
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:305
Implements basic data structures for storing collision events.
This class defines a color using a GLfloat representation for each component.
Definition: CColor.h:138
Implements color properties.
bool m_showFrame
If true, this object&#39;s reference frame is rendered as a set of arrows.
Definition: CGenericObject.h:815
cGenericCollision * m_collisionDetector
The collision detector used to test for contact with this object.
Definition: CGenericObject.h:878
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:149
bool createEffectMagnetic()
This method creates a magnetic haptic effect.
Definition: CGenericObject.cpp:503
bool getUseTransparency() const
This method returns true if transparency is enabled, false otherwise.
Definition: CGenericObject.h:433
virtual void setMaterial(cMaterialPtr a_material, const bool a_affectChildren=false)
This method sets the material properties of this object, optionally propagating the operation to its ...
Definition: CGenericObject.cpp:1198
void translate(const cVector3d &a_translation)
This method translates this object by a specified offset.
Definition: CGenericObject.cpp:236
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:279
cNormalMapPtr m_normalMap
Normal map property.
Definition: CGenericObject.h:700
This class stores a list of interaction events.
Definition: CInteractionBasics.h:133
std::shared_ptr< cShaderProgram > cShaderProgramPtr
Definition: CShaderProgram.h:70
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:264
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:294
bool deleteEffectViscosity()
This method deletes any current viscous haptic effect.
Definition: CGenericObject.cpp:744
cMatrix3d getLocalRot() const
This method returns the rotation component of this matrix.
Definition: CTransform.h:502
std::vector< cGenericEffect * > m_effects
List of haptic effects programmed for this object.
Definition: CGenericObject.h:888
virtual void setUseMaterial(const bool a_useMaterial, const bool a_affectChildren=false)
This method enables or disables the use of material properties, optionally propagating the operation ...
Definition: CGenericObject.cpp:1166
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:1600
bool deleteEffectStickSlip()
This method delete any current stick-and-slip haptic effect.
Definition: CGenericObject.cpp:584
Implements material properties.
virtual void setEnabled(bool a_enabled, const bool a_affectChildren=false)
This method enables or disable this object. When an object is disabled, both haptic and graphic rende...
Definition: CGenericObject.cpp:213
static cMaterialPtr s_defaultMaterial
Default material property.
Definition: CGenericObject.h:862
virtual void renderSceneGraph(cRenderOptions &a_options)
This method renders the entire scene graph, starting from this object.
Definition: CGenericObject.cpp:2145
virtual void backupMaterialColors(const bool a_affectChildren=false)
This method creates a backup of the material colors of this object, optionally propagating the operat...
Definition: CGenericObject.cpp:1054
unsigned int getNumChildren()
This method returns the number of children from its list of children.
Definition: CGenericObject.h:655
virtual ~cGenericObject()
Destructor of cGenericObject.
Definition: CGenericObject.cpp:185
virtual void setHapticEnabled(const bool a_hapticEnabled, const bool a_affectChildren=true)
This method enables or disables haptic perception of this object, optionally propagating the change t...
Definition: CGenericObject.cpp:772
cVector3d m_globalPos
The position of this object in the world&#39;s reference frame.
Definition: CGenericObject.h:752
void mul(const double &a_scalar)
This method computes the multiplication of this vector with a scalar.
Definition: CVector3d.h:680
Definition: CAudioBuffer.cpp:56
cGenericObject * m_parent
Parent object.
Definition: CGenericObject.h:729
cTransform m_frameGL
OpenGL matrix describing my position and orientation transformation.
Definition: CGenericObject.h:868
bool getEnabled() const
This method returns true if the object is enabled, false otherwise.
Definition: CGenericObject.h:139
void setLocalTransform(const cTransform &a_transform)
This method returns the local position and rotation matrix by passing a transformation matrix...
Definition: CGenericObject.h:212
void copyfrom(const cMatrix3d &a_source)
This method copies all elements from another matrix to this one.
Definition: CMatrix3d.h:675
virtual void updateBoundaryBox()
This method updates the boundary box of this object.
Definition: CGenericObject.h:904
virtual void restoreMaterialColors(const bool a_affectChildren=false)
This method restores the material color properties of this object from a previous backup...
Definition: CGenericObject.cpp:1082
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:236
cGenericObject * getChild(const unsigned int a_index) const
This method returns a selected child from the list of children.
Definition: CGenericObject.h:634
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:330
bool m_useTransparency
Definition: CGenericObject.h:847
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:921
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:269
virtual void adjustCollisionSegment(cVector3d &a_segmentPointA, cVector3d &a_segmentPointAadjusted)
This method adjusts the collision segment to handle objects in motion.
Definition: CGenericObject.cpp:2404
bool deleteEffectSurface()
This method deletes any current surface haptic effect.
Definition: CGenericObject.cpp:638
virtual void setShowFrame(const bool a_showFrame, const bool a_affectChildren=false)
This method enables or disables the graphic display of the reference frame arrows for this object...
Definition: CGenericObject.cpp:1499
bool getBoundaryBoxEmpty()
This method returns true, if the boundary box is empty, otherwise false.
Definition: CGenericObject.h:557
bool getUseDisplayList() const
This method returns true if a display list is activated, false otherwise.
Definition: CGenericObject.h:452
double m_frameThicknessScale
Pen thickness of graphical representation of frame (X-Y-Z).
Definition: CGenericObject.h:793
bool m_hapticEnabled
If true, this object can be felt.
Definition: CGenericObject.h:809
double m_frameSize
Size of graphical representation of frame (X-Y-Z).
Definition: CGenericObject.h:790
static cColorf s_boundaryBoxColor
Color of the boundary box.
Definition: CGenericObject.h:532
virtual void setStiffness(const double a_stiffness, const bool a_affectChildren=true)
This method sets the haptic stiffness of the object, optionally recursively affecting children...
Definition: CGenericObject.cpp:798
bool addEffect(cGenericEffect *a_effect)
This method adds a haptic effect to this object.
Definition: CGenericObject.cpp:436
cVector3d m_interactionPoint
Projection of the most recent haptic point (tool) onto the surface of the virtual object...
Definition: CGenericObject.h:948
bool getUseTexture() const
This method returns true if texture-mapping is enabled, false otherwise.
Definition: CGenericObject.h:506
virtual void setUseTexture(const bool a_useTexture, const bool a_affectChildren=false)
This method enables or disables the use of texture-mapping, optionally propagating the operation to i...
Definition: CGenericObject.cpp:1265
bool getUseVertexColors() const
This method returns true is per-vertex color properties are enabled, false otherwise.
Definition: CGenericObject.h:468
bool getUseCulling() const
This method returns true if face-culling is enabled, false otherwise.
Definition: CGenericObject.h:422
cMatrix3d m_prevGlobalRot
Previous rotation since last haptic computation.
Definition: CGenericObject.h:764
virtual void setTransparencyLevel(const float a_level, const bool a_applyToVertices=false, const bool a_applyToTextures=false, const bool a_affectChildren=false)
This method sets the transparency level of the object.
Definition: CGenericObject.cpp:911
cGenericObject * m_owner
Definition: CGenericObject.h:736
virtual void setUseTransparency(const bool a_useTransparency, const bool a_affectChildren=false)
This method enables or disables transparency.
Definition: CGenericObject.cpp:880
cTexture1dPtr m_texture
Texture property.
Definition: CGenericObject.h:697
bool getShowFrame(void) const
This method returns true if the display of the reference frame is enabled, false otherwise.
Definition: CGenericObject.h:573
int m_triangleMode
The polygon rendering mode (GL_FILL or GL_LINE).
Definition: CGenericObject.h:839
unsigned int getNumDescendants(bool a_includeCurrentObject=false)
This method returns the total number of descendants, optionally including this object.
Definition: CGenericObject.cpp:1957