My Project
Loading...
Searching...
No Matches
CGenericObject.h
Go to the documentation of this file.
1//==============================================================================
2/*
3 Software License Agreement (BSD License)
4 Copyright (c) 2003-2024, 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.3.0
42*/
43//==============================================================================
44
45//------------------------------------------------------------------------------
46#ifndef CGenericObjectH
47#define CGenericObjectH
48//------------------------------------------------------------------------------
52#include "graphics/CDraw3D.h"
53#include "graphics/CColor.h"
56#include "materials/CMaterial.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//------------------------------------------------------------------------------
67namespace chai3d {
68//------------------------------------------------------------------------------
69
70//------------------------------------------------------------------------------
71class cGenericCollision;
72class cGenericForceAlgorithm;
73class cMultiMesh;
74class cShaderProgram;
75class cInteractionRecorder;
76//------------------------------------------------------------------------------
77typedef std::shared_ptr<cShaderProgram> cShaderProgramPtr;
78//------------------------------------------------------------------------------
79
80//==============================================================================
87//==============================================================================
88
89//==============================================================================
111//==============================================================================
113{
114 friend class cMultiMesh;
115
116 //--------------------------------------------------------------------------
117 // CONSTRUCTOR & DESTRUCTOR:
118 //--------------------------------------------------------------------------
119
120public:
121
124
126 virtual ~cGenericObject();
127
128
129 //--------------------------------------------------------------------------
130 // PUBLIC METHODS - GENERAL
131 //--------------------------------------------------------------------------
132
133public:
134
136 virtual std::string getClassName() { return ("GenericObject"); }
137
139 virtual void setEnabled(bool a_enabled,
140 const bool a_affectChildren = false,
141 const bool a_affectComponents = true);
142
144 bool getEnabled() const { return (m_enabled); }
145
147 cGenericObject* getObject(std::string& a_name);
148
149
150 //-----------------------------------------------------------------------
151 // PUBLIC METHODS - COPY:
152 //-----------------------------------------------------------------------
153
154public:
155
157 virtual cGenericObject* copy(const bool a_duplicateMaterialData = false,
158 const bool a_duplicateTextureData = false,
159 const bool a_duplicateMeshData = false,
160 const bool a_buildCollisionDetector = true) { return (NULL); }
161
162
163 //-----------------------------------------------------------------------
164 // PUBLIC METHODS - TRANSLATION AND ORIENTATION:
165 //-----------------------------------------------------------------------
166
167public:
168
170 virtual void setLocalPos(const cVector3d& a_localPos)
171 {
172 m_localPos = a_localPos;
173 }
174
175#ifdef C_USE_EIGEN
177 void setLocalPos(const Eigen::Vector3d& a_localPos)
178 {
179 setLocalPos(cVector3d(a_localPos[0], a_localPos[1], a_localPos[2]));
180 }
181#endif
182
184 void setLocalPos(const double a_x = 0.0,
185 const double a_y = 0.0,
186 const double a_z = 0.0)
187 {
188 setLocalPos(cVector3d(a_x, a_y, a_z));
189 }
190
192 inline cVector3d getLocalPos() const { return (m_localPos); }
193
195 inline cVector3d getGlobalPos() const { return (m_globalPos); }
196
198 virtual void setLocalRot(const cMatrix3d& a_localRot)
199 {
200 m_localRot = a_localRot;
201 }
202
203#ifdef C_USE_EIGEN
205 inline void setLocalRot(const Eigen::Matrix3d a_localRot)
206 {
207 cMatrix3d localRot;
208 localRot.copyfrom(a_localRot);
209 setLocalRot(localRot);
210 }
211#endif
212
214 inline cMatrix3d getLocalRot() const { return (m_localRot); }
215
217 inline cMatrix3d getGlobalRot() const { return (m_globalRot); }
218
220 inline void setLocalTransform(const cTransform& a_transform)
221 {
222 setLocalPos(a_transform.getLocalPos());
223 setLocalRot(a_transform.getLocalRot());
224 }
225
228
231
233 void translate(const cVector3d& a_translation);
234
236 void translate(const double a_x,
237 const double a_y,
238 const double a_z = 0.0);
239
241 void rotateAboutLocalAxisRad(const cVector3d& a_axis, const double a_angleRad);
242
244 inline void rotateAboutLocalAxisDeg(const cVector3d& a_axis,
245 const double a_angleDeg)
246 {
247 rotateAboutLocalAxisRad(a_axis, cDegToRad(a_angleDeg));
248 }
249
251 inline void rotateAboutLocalAxisRad(const double a_axisX,
252 const double a_axisY,
253 const double a_axisZ,
254 const double a_angleRad)
255 {
256 rotateAboutLocalAxisRad(cVector3d(a_axisX, a_axisY, a_axisZ), a_angleRad);
257 }
258
260 inline void rotateAboutLocalAxisDeg(const double a_axisX,
261 const double a_axisY,
262 const double a_axisZ,
263 const double a_angleDeg)
264 {
265 rotateAboutLocalAxisRad(cVector3d(a_axisX, a_axisY, a_axisZ), cDegToRad(a_angleDeg));
266 }
267
269 void rotateAboutGlobalAxisRad(const cVector3d& a_axis, const double a_angleRad);
270
272 inline void rotateAboutGlobalAxisDeg(const cVector3d& a_axis, const double a_angleDeg)
273 {
274 rotateAboutGlobalAxisRad(a_axis, cDegToRad(a_angleDeg));
275 }
276
278 inline void rotateAboutGlobalAxisRad(const double a_axisX,
279 const double a_axisY,
280 const double a_axisZ,
281 const double a_angleRad)
282 {
283 rotateAboutGlobalAxisRad(cVector3d(a_axisX, a_axisY, a_axisZ), a_angleRad);
284 }
285
287 inline void rotateAboutGlobalAxisDeg(const double a_axisX,
288 const double a_axisY,
289 const double a_axisZ,
290 const double a_angleDeg)
291 {
292 rotateAboutGlobalAxisRad(cVector3d(a_axisX, a_axisY, a_axisZ), cDegToRad(a_angleDeg));
293 }
294
296 void rotateExtrinsicEulerAnglesRad(const double& a_angleRad1,
297 const double& a_angleRad2,
298 const double& a_angleRad3,
299 const cEulerOrder a_eulerOrder);
300
302 void rotateExtrinsicEulerAnglesDeg(const double& a_angleDeg1,
303 const double& a_angleDeg2,
304 const double& a_angleDeg3,
305 const cEulerOrder a_eulerOrder)
306 {
307 rotateExtrinsicEulerAnglesRad(cDegToRad(a_angleDeg1), cDegToRad(a_angleDeg2), cDegToRad(a_angleDeg3), a_eulerOrder);
308 }
309
311 void rotateIntrinsicEulerAnglesRad(const double& a_angleRad1,
312 const double& a_angleRad2,
313 const double& a_angleRad3,
314 const cEulerOrder a_eulerOrder);
315
317 void rotateIntrinsicEulerAnglesDeg(const double& a_angleDeg1,
318 const double& a_angleDeg2,
319 const double& a_angleDeg3,
320 const cEulerOrder a_eulerOrder)
321 {
322 rotateIntrinsicEulerAnglesRad(cDegToRad(a_angleDeg1), cDegToRad(a_angleDeg2), cDegToRad(a_angleDeg3), a_eulerOrder);
323 }
324
325
326 //-----------------------------------------------------------------------
327 // PUBLIC METHODS - COMPUTING GLOBAL POSITIONS:
328 //-----------------------------------------------------------------------
329
330public:
331
333 virtual void computeGlobalPositions(const bool a_frameOnly = true,
334 const cVector3d& a_globalPos = cVector3d(0.0, 0.0, 0.0),
335 const cMatrix3d& a_globalRot = cIdentity3d());
336
338 void computeGlobalPositionsFromRoot(const bool a_frameOnly = true);
339
340
341 //-----------------------------------------------------------------------
342 // PUBLIC METHODS - HAPTIC EFFECTS:
343 //-----------------------------------------------------------------------
344
345public:
346
348 bool addEffect(cGenericEffect* a_effect);
349
351 bool removeEffect(cGenericEffect* a_effect);
352
354 void deleteAllEffects();
355
357 void createEffectMagnetic(const bool a_affectChildren = false, const bool a_affectComponents = true);
358
360 void deleteEffectMagnetic(const bool a_affectChildren = false, const bool a_affectComponents = true);
361
363 void createEffectStickSlip(const bool a_affectChildren = false, const bool a_affectComponents = true);
364
366 void deleteEffectStickSlip(const bool a_affectChildren = false, const bool a_affectComponents = true);
367
369 void createEffectSurface(const bool a_affectChildren = false, const bool a_affectComponents = true);
370
372 void deleteEffectSurface(const bool a_affectChildren = false, const bool a_affectComponents = true);
373
375 void createEffectVibration(const bool a_affectChildren = false, const bool a_affectComponents = true);
376
378 void deleteEffectVibration(const bool a_affectChildren = false, const bool a_affectComponents = true);
379
381 void createEffectViscosity(const bool a_affectChildren = false, const bool a_affectComponents = true);
382
384 void deleteEffectViscosity(const bool a_affectChildren = false, const bool a_affectComponents = true);
385
386
387 //-----------------------------------------------------------------------
388 // PUBLIC METHODS - HAPTIC PROPERTIES:
389 //-----------------------------------------------------------------------
390
391public:
392
394 virtual void setHapticEnabled(const bool a_hapticEnabled,
395 const bool a_affectChildren = true,
396 const bool a_affectComponents = true);
397
399 inline bool getHapticEnabled() const { return (m_hapticEnabled); }
400
402 virtual void setStiffness(const double a_stiffness,
403 const bool a_affectChildren = true,
404 const bool a_affectComponents = true);
405
407 virtual void setFriction(double a_staticFriction,
408 double a_dynamicFriction,
409 const bool a_affectChildren = true,
410 const bool a_affectComponents = true);
411
412
413 //-----------------------------------------------------------------------
414 // PUBLIC METHODS - GRAPHIC PROPERTIES:
415 //-----------------------------------------------------------------------
416
417public:
418
420 virtual void setShowEnabled(const bool a_show,
421 const bool a_affectChildren = true,
422 const bool a_affectComponents = true);
423
425 inline bool getShowEnabled() const { return (m_showEnabled); }
426
428 virtual void setWireMode(const bool a_showWireMode,
429 const bool a_affectChildren = false,
430 const bool a_affectComponents = true);
431
433 inline bool getWireMode() const { return (m_triangleMode == GL_LINE); }
434
436 virtual void setUseCulling(const bool a_useCulling,
437 const bool a_affectChildren = false,
438 const bool a_affectComponents = true);
439
441 inline bool getUseCulling() const { return (m_cullingEnabled); }
442
443
444 //-----------------------------------------------------------------------
445 // PUBLIC METHODS - TRANSPARENCY:
446 //-----------------------------------------------------------------------
447
449 virtual void setUseTransparency(const bool a_useTransparency,
450 const bool a_affectChildren = false,
451 const bool a_affectComponents = true);
452
454 inline bool getUseTransparency() const { return m_useTransparency; }
455
457 virtual void setTransparencyLevel(const float a_level,
458 const bool a_applyToVertices = false,
459 const bool a_applyToTextures = false,
460 const bool a_affectChildren = false,
461 const bool a_affectComponents = true);
462
463
464 //-----------------------------------------------------------------------
465 // PUBLIC METHODS - DISPLAY LISTS:
466 //-----------------------------------------------------------------------
467
468public:
469
471 virtual void setUseDisplayList(const bool a_useDisplayList,
472 const bool a_affectChildren = false,
473 const bool a_affectComponents = true);
474
476 inline bool getUseDisplayList() const { return (m_useDisplayList); }
477
479 virtual void markForUpdate(const bool a_affectChildren = false, const bool a_affectComponents = true);
480
481
482 //-----------------------------------------------------------------------
483 // PUBLIC METHODS - VERTEX COLORS:
484 //-----------------------------------------------------------------------
485
486public:
487
489 virtual void setUseVertexColors(const bool a_useColors,
490 const bool a_affectChildren = false,
491 const bool a_affectComponents = true);
492
494 inline bool getUseVertexColors() const { return (m_useVertexColors); }
495
496
497 //-----------------------------------------------------------------------
498 // PUBLIC METHODS - MATERIAL PROPERTIES:
499 //-----------------------------------------------------------------------
500
501public:
502
504 virtual void setUseMaterial(const bool a_useMaterial,
505 const bool a_affectChildren = false,
506 const bool a_affectComponents = true);
507
509 inline bool getUseMaterial() const { return (m_useMaterialProperty); }
510
512 virtual void setMaterial(cMaterialPtr a_material,
513 const bool a_affectChildren = false,
514 const bool a_affectComponents = true);
515
517 virtual void setMaterial(cMaterial& a_material,
518 const bool a_affectChildren = false,
519 const bool a_affectComponents = true);
520
522 virtual void backupMaterialColors(const bool a_affectChildren = false, const bool a_affectComponents = true);
523
525 virtual void restoreMaterialColors(const bool a_affectChildren = false, const bool a_affectComponents = true);
526
527
528 //--------------------------------------------------------------------------
529 // PUBLIC METHODS - TEXTURE PROPERTIES:
530 //-----------------------------------------------------------------------
531
532public:
533
535 virtual void setUseTexture(const bool a_useTexture,
536 const bool a_affectChildren = false,
537 const bool a_affectComponents = true);
538
540 inline bool getUseTexture() const { return (m_useTextureMapping); }
541
543 virtual void setTexture(cTexture1dPtr a_texture,
544 const bool a_affectChildren = false,
545 const bool a_affectComponents = true);
546
547
548 //-----------------------------------------------------------------------
549 // PUBLIC METHODS - SHADERS:
550 //-----------------------------------------------------------------------
551
552public:
553
555 virtual void setShaderProgram(cShaderProgramPtr a_shaderProgram,
556 const bool a_affectChildren = false,
557 const bool a_affectComponents = true);
558
561
562
563 //-----------------------------------------------------------------------
564 // PUBLIC MEMBERS - BOUNDARY BOX:
565 //-----------------------------------------------------------------------
566
567public:
568
571
572
573 //-----------------------------------------------------------------------
574 // PUBLIC METHODS - BOUNDARY BOX:
575 //-----------------------------------------------------------------------
576
577public:
578
580 virtual void setShowBoundaryBox(const bool a_showBoundaryBox,
581 const bool a_affectChildren = false,
582 const bool a_affectComponents = true);
583
585 inline bool getShowBoundaryBox() const { return (m_showBoundaryBox); }
586
588 inline cVector3d getBoundaryMin() const { return (m_boundaryBoxMin); }
589
591 inline cVector3d getBoundaryMax() const { return (m_boundaryBoxMax); }
592
595
597 inline bool getBoundaryBoxEmpty() { return (m_boundaryBoxEmpty); }
598
600 virtual void computeBoundaryBox(const bool a_includeChildren = true);
601
602
603 //-----------------------------------------------------------------------
604 // PUBLIC METHODS - REFERENCE FRAME REPRESENTATION:
605 //-----------------------------------------------------------------------
606
607public:
608
610 virtual void setShowFrame(const bool a_showFrame,
611 const bool a_affectChildren = false,
612 const bool a_affectComponents = true);
613
615 inline bool getShowFrame(void) const { return (m_showFrame); }
616
618 virtual void setFrameSize(const double a_size = 1.0,
619 const bool a_affectChildren = false,
620 const bool a_affectComponents = true);
621
623 inline double getFrameSize() const { return (m_frameSize); }
624
625
626 //-----------------------------------------------------------------------
627 // PUBLIC METHODS - COLLISION DETECTION:
628 //-----------------------------------------------------------------------
629
630public:
631
633 void setCollisionDetector(cGenericCollision* a_collisionDetector) { m_collisionDetector = a_collisionDetector; }
634
637
639 virtual void deleteCollisionDetector(const bool a_affectChildren = false, const bool a_affectComponents = true);
640
642 virtual bool computeCollisionDetection(const cVector3d& a_segmentPointA,
643 const cVector3d& a_segmentPointB,
644 cCollisionRecorder& a_recorder,
645 cCollisionSettings& a_settings);
646
648 virtual void setShowCollisionDetector(const bool a_showCollisionDetector,
649 const bool a_affectChildren = false,
650 const bool a_affectComponents = true);
651
654
656 virtual void setCollisionDetectorProperties(unsigned int a_displayDepth,
657 cColorf& a_color,
658 const bool a_affectChildren = false,
659 const bool a_affectComponents = true);
660
661
662 //-----------------------------------------------------------------------
663 // PUBLIC METHODS - SCENE GRAPH / CHILDREN:
664 //-----------------------------------------------------------------------
665
666public:
667
669 inline void setParent(cGenericObject* a_parent) { m_parent = a_parent; }
670
672 inline cGenericObject* getParent() const { return (m_parent); }
673
675 inline void setOwner(cGenericObject* a_owner) { m_owner = a_owner; }
676
678 inline cGenericObject* getOwner() { return (m_owner); }
679
682
684 inline cGenericObject* getChild(const unsigned int a_index) const { return (m_children[a_index]); }
685
687 bool addChild(cGenericObject* a_object);
688
690 bool removeChild(cGenericObject* a_object);
691
693 bool removeFromGraph();
694
696 bool deleteChild(cGenericObject *a_object);
697
699 void clearAllChildren();
700
702 void deleteAllChildren();
703
705 inline unsigned int getNumChildren() { return ((unsigned int)m_children.size()); }
706
708 inline unsigned int getNumDescendants(bool a_includeCurrentObject = false);
709
710
711 //-----------------------------------------------------------------------
712 // PUBLIC METHODS - OBJECT COMPONENTS:
713 //-----------------------------------------------------------------------
714
716 bool addComponent(cGenericObject* a_component);
717
719 bool removeComponent(cGenericObject* a_object);
720
722 bool deleteComponent(cGenericObject *a_object);
723
725 void clearAllComponents();
726
728 void deleteAllComponents();
729
731 inline unsigned int getNumComponents() { return ((unsigned int)m_components.size()); }
732
733
734 //-----------------------------------------------------------------------
735 // PUBLIC METHODS - GHOSTING:
736 //-----------------------------------------------------------------------
737
738public:
739
741 void setGhostEnabled(bool a_ghostEnabled) { m_ghostEnabled = a_ghostEnabled; }
742
744 bool getGhostEnabled() { return (m_ghostEnabled); }
745
746
747 //-----------------------------------------------------------------------
748 // PUBLIC METHODS - GEOMETRY:
749 //-----------------------------------------------------------------------
750
751public:
752
754 virtual void scale(const double& a_scaleFactor,
755 const bool a_affectChildren = true,
756 const bool a_affectComponents = true);
757
758
759 //-----------------------------------------------------------------------
760 // PUBLIC MEMBERS - PROPERTIES:
761 //-----------------------------------------------------------------------
762
763public:
764
767
770
773
774
775 //-----------------------------------------------------------------------
776 // PUBLIC MEMBERS - CUSTOM USER DATA:
777 //-----------------------------------------------------------------------
778
779public:
780
783
786
788 std::string m_userName;
789
792
793
794 //-----------------------------------------------------------------------
795 // PROTECTED MEMBERS - SCENEGRAPH:
796 //-----------------------------------------------------------------------
797
798protected:
799
802
809
811 std::vector<cGenericObject*> m_components;
812
814 std::vector<cGenericObject*> m_children;
815
816
817 //-----------------------------------------------------------------------
818 // PROTECTED MEMBERS - POSITION & ORIENTATION:
819 //-----------------------------------------------------------------------
820
821protected:
822
825
828
831
834
837
840
841
842 //-----------------------------------------------------------------------
843 // PROTECTED MEMBERS - BOUNDARY BOX
844 //-----------------------------------------------------------------------
845
846protected:
847
850
853
856
857
858 //-----------------------------------------------------------------------
859 // PROTECTED MEMBERS - FRAME REPRESENTATION [X,Y,Z]:
860 //-----------------------------------------------------------------------
861
862protected:
863
866
869
870
871 //-----------------------------------------------------------------------
872 // PROTECTED MEMBERS - GENERAL OPTIONS:
873 //-----------------------------------------------------------------------
874
875protected:
876
879
882
885
888
891
894
897
900
903
906
909
912
915
923
935
938
941
944
945
946 //-----------------------------------------------------------------------
947 // PROTECTED MEMBERS - COLLISION DETECTION:
948 //-----------------------------------------------------------------------
949
950protected:
951
954
955
956 //-----------------------------------------------------------------------
957 // PROTECTED MEMBERS - HAPTIC EFFECTS AND INTERACTIONS:
958 //-----------------------------------------------------------------------
959
960protected:
961
963 std::vector<cGenericEffect*> m_effects;
964
965
966 //-----------------------------------------------------------------------
967 // PROTECTED VIRTUAL METHODS:
968 //-----------------------------------------------------------------------
969
970protected:
971
973 virtual void render(cRenderOptions& a_options);
974
976 virtual void updateGlobalPositions(const bool a_frameOnly) {};
977
979 virtual void updateBoundaryBox() {};
980
982 virtual void scaleObject(const double& a_scaleFactor) { m_boundaryBoxMin.mul(a_scaleFactor); m_boundaryBoxMax.mul(a_scaleFactor);}
983
985 virtual void computeLocalInteraction(const cVector3d& a_toolPos,
986 const cVector3d& a_toolVel,
987 const unsigned int a_IDN);
988
991 const cVector3d& a_toolVel,
992 const unsigned int a_IDN,
993 cInteractionRecorder& a_interactions) { return cVector3d(0,0,0); }
994
996 virtual bool computeOtherCollisionDetection(cVector3d& a_segmentPointA,
997 cVector3d& a_segmentPointB,
998 cCollisionRecorder& a_recorder,
999 cCollisionSettings& a_settings) {return(false);}
1000
1001
1002 //-----------------------------------------------------------------------
1003 // PROTECTED METHODS:
1004 //-----------------------------------------------------------------------
1005
1006protected:
1007
1010 const bool a_duplicateMaterialData,
1011 const bool a_duplicateTextureData,
1012 const bool a_duplicateMeshData,
1013 const bool a_buildCollisionDetector);
1014
1015
1016 //-----------------------------------------------------------------------
1017 // PUBLIC MEMBERS - INTERACTIONS:
1018 //-----------------------------------------------------------------------
1019
1020public:
1021
1024
1027
1030
1031
1032 //-----------------------------------------------------------------------
1033 // PUBLIC MEMBERS - GENERAL
1034 //-----------------------------------------------------------------------
1035
1036public:
1037
1039 virtual void renderSceneGraph(cRenderOptions& a_options);
1040
1042 virtual void adjustCollisionSegment(cVector3d& a_segmentPointA, cVector3d& a_segmentPointAadjusted);
1043
1045 virtual cVector3d computeInteractions(const cVector3d& a_toolPos,
1046 const cVector3d& a_toolVel,
1047 const unsigned int a_IDN,
1048 cInteractionRecorder& a_interactions);
1049};
1050
1051//------------------------------------------------------------------------------
1052} // namespace chai3d
1053//------------------------------------------------------------------------------
1054
1055//------------------------------------------------------------------------------
1056#endif
1057//------------------------------------------------------------------------------
1058
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 normal map.
Implements a structure to store rendering options.
Implements a transformation matrix.
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 4D transformation matrix encoded as column-major.
Definition CTransform.h:76
cVector3d getLocalPos() const
This method returns the translational component of this matrix.
Definition CTransform.h:485
cMatrix3d getLocalRot() const
This method returns the rotation component of this matrix.
Definition CTransform.h:502
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