My Project
Loading...
Searching...
No Matches
CMaterial.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 \version 3.3.0
41*/
42//==============================================================================
43
44//------------------------------------------------------------------------------
45#ifndef CMaterialH
46#define CMaterialH
47//------------------------------------------------------------------------------
48#include "audio/CAudioBuffer.h"
49#include "graphics/CColor.h"
51#include "system/CGenericType.h"
52//------------------------------------------------------------------------------
53
54//------------------------------------------------------------------------------
55namespace chai3d {
56//------------------------------------------------------------------------------
57
58//==============================================================================
65//==============================================================================
66
67//------------------------------------------------------------------------------
68struct cMaterial;
69typedef std::shared_ptr<cMaterial> cMaterialPtr;
70//------------------------------------------------------------------------------
71
72//==============================================================================
100//==============================================================================
101struct cMaterial : public cGenericType
102{
103 //--------------------------------------------------------------------------
104 // CONSTRUCTOR & DESTRUCTOR:
105 //--------------------------------------------------------------------------
106
107public:
108
110 cMaterial();
111
113 virtual ~cMaterial() {};
114
116 static cMaterialPtr create() { return (std::make_shared<cMaterial>()); }
117
118
119 //--------------------------------------------------------------------------
120 // PUBLIC METHODS - COPY:
121 //--------------------------------------------------------------------------
122
123public:
124
126 virtual std::string getClassName() { return ("Material"); }
127
130
132 void setModificationFlags(const bool a_value);
133
135 void copyTo(cMaterialPtr a_material);
136
137
138 //--------------------------------------------------------------------------
139 // PUBLIC METHODS - GRAPHIC PROPERTIES:
140 //--------------------------------------------------------------------------
141
142public:
143
145 void setShininess(const GLuint a_shininess);
146
148 GLuint getShininess() const { return (m_shininess); }
149
151 void setTransparencyLevel(const float a_levelTransparency);
152
154 inline bool isTransparent() const
155 {
156 return (m_ambient[4] < 1.0 ||
157 m_diffuse[4] < 1.0 ||
158 m_specular[4] < 1.0 ||
159 m_emission[4]);
160 }
161
170
179
181 virtual void render(cRenderOptions& a_options);
182
183
184 //--------------------------------------------------------------------------
185 // PUBLIC MEMBERS - GRAPHIC PROPERTIES:
186 //--------------------------------------------------------------------------
187
188public:
189
192
195
198
201
204
207
210
213
214
215 //--------------------------------------------------------------------------
216 // PUBLIC METHODS - HAPTIC EFFECTS PROPERTIES:
217 //--------------------------------------------------------------------------
218
219public:
220
222 // SURFACE STIFFNESS
224
226 void setStiffness(const double a_stiffness);
227
229 inline double getStiffness() const { return (m_stiffness); }
230
231
233 // VISCOSITY
235
237 void setViscosity(const double a_viscosity);
238
240 inline double getViscosity() const { return (m_viscosity); }
241
242
244 // VIBRATION
246
248 void setVibrationFrequency(const double a_vibrationFrequency);
249
251 inline double getVibrationFrequency() const {return (m_vibrationFrequency); }
252
254 void setVibrationAmplitude(const double a_vibrationAmplitude);
255
257 inline double getVibrationAmplitude() const { return (m_vibrationAmplitude); }
258
259
261 // MAGNET
263
265 void setMagnetMaxForce(const double a_magnetMaxForce);
266
268 inline double getMagnetMaxForce() const { return (m_magnetMaxForce); }
269
271 void setMagnetMaxDistance(const double a_magnetMaxDistance);
272
274 inline double getMagnetMaxDistance() const { return (m_magnetMaxDistance); }
275
276
278 // STICK AND SLIP
280
282 void setStickSlipForceMax(const double a_stickSlipForceMax);
283
285 inline double getStickSlipForceMax() const { return (m_stickSlipForceMax); }
286
288 void setStickSlipStiffness(double const a_stickSlipStiffness);
289
291 inline double getStickSlipStiffness() const { return (m_stickSlipStiffness); }
292
293
294 //--------------------------------------------------------------------------
295 // PUBLIC METHODS - HAPTIC PROPERTIES (MESH OBJECTS ONLY)
296 //--------------------------------------------------------------------------
297
298public:
299
301 // DAMPING
303
305 void setDamping(const double a_dampingCoefficient);
306
308 inline double getDamping() const { return (m_damping); }
309
310
312 // FRICTION
314
316 void setUseHapticFriction(const bool a_useHapticFriction);
317
319 inline bool getUseHapticFriction() const { return (m_useHapticFriction); }
320
322 void setStaticFriction(const double a_friction);
323
325 inline double getStaticFriction() const { return (m_staticFriction); }
326
328 void setDynamicFriction(const double a_friction);
329
331 inline double getDynamicFriction() const { return (m_dynamicFriction); }
332
333
335 // TEXTURE
337
339 void setUseHapticTexture(const bool a_useHapticTexture);
340
342 inline bool getUseHapticTexture() const { return (m_useHapticTexture); }
343
345 void setTextureLevel(const double a_textureLevel);
346
348 inline double getTextureLevel() const { return (m_textureLevel); }
349
350
352 // HAPTIC MODES
354
356 void setUseHapticShading(const bool a_useHapticShading);
357
359 inline bool getUseHapticShading() const { return (m_useHapticShading); }
360
362 void setHapticTriangleFrontSide(const bool a_enabled);
363
366
368 void setHapticTriangleBackSide(const bool a_enabled);
369
372
374 void setHapticTriangleSides(const bool a_enableFrontSide, const bool a_enableBackSide);
375
376
377 //--------------------------------------------------------------------------
378 // PUBLIC METHODS - AUDIO PROPERTIES
379 //--------------------------------------------------------------------------
380
381public:
382
384 // AUDIO IMPACT
386
388 void setAudioImpactBuffer(cAudioBuffer* a_audioImpactBuffer);
389
392
394 void setAudioImpactGain(const double a_audioImpactGain);
395
397 inline double getAudioImpactGain() const { return (m_audioImpactGain); }
398
399
401 // AUDIO FRICTION
403
405 void setAudioFrictionBuffer(cAudioBuffer* a_audioFrictionBuffer);
406
409
411 void setAudioFrictionGain(const double a_audioFrictionGain);
412
414 inline double getAudioFrictionGain() const { return (m_audioFrictionGain); }
415
417 void setAudioFrictionPitchGain(const double a_audioFrictionPitchGain);
418
420 inline double getAudioFrictionPitchGain() const { return (m_audioFrictionPitchGain); }
421
423 void setAudioFrictionPitchOffset(const double a_audioFrictionPitchOffset);
424
426 inline double getAudioFrictionPitchOffset() const { return (m_audioFrictionPitchOffset); }
427
428
429 //--------------------------------------------------------------------------
430 // PUBLIC METHODS - COLOR PROPERTIES:
431 //--------------------------------------------------------------------------
432
433public:
434
436 void setColor(cColorf& a_color);
437
439 void setColor(cColorb& a_color);
440
442 void setColorf(const GLfloat a_red,
443 const GLfloat a_green,
444 const GLfloat a_blue,
445 const GLfloat a_alpha = 1.0f);
446
447
448 //--------------------------------------------------------------------------
449 // PUBLIC METHODS - RED COLORS
450 //--------------------------------------------------------------------------
451
452public:
453
455 inline void setRedIndian() { m_diffuse.setb(0xCD, 0x5C, 0x5C); updateColors();}
456
458 inline void setRedLightCoral() { m_diffuse.setb(0xF0, 0x80, 0x80); updateColors();}
459
461 inline void setRedSalmon() { m_diffuse.setb(0xFA, 0x80, 0x72); updateColors();}
462
464 inline void setRedDarkSalmon() { m_diffuse.setb(0xE9, 0x96, 0x7A); updateColors();}
465
467 inline void setRedLightSalmon() { m_diffuse.setb(0xFF, 0xA0, 0x7A); updateColors();}
468
470 inline void setRedCrimson() { m_diffuse.setb(0xDC, 0x14, 0x3C); updateColors();}
471
473 inline void setRed() { m_diffuse.setb(0xFF, 0x00, 0x00); updateColors();}
474
476 inline void setRedFireBrick() { m_diffuse.setb(0xB2, 0x22, 0x22); updateColors();}
477
479 inline void setRedDark() { m_diffuse.setb(0x8B, 0x00, 0x00); updateColors();}
480
481
482 //--------------------------------------------------------------------------
483 // PUBLIC METHODS - PINK COLORS
484 //--------------------------------------------------------------------------
485
487 inline void setPink() { m_diffuse.setb(0xFF, 0xC0, 0xCB); updateColors();}
488
490 inline void setPinkLight() { m_diffuse.setb(0xFF, 0xB6, 0xC); updateColors();}
491
493 inline void setPinkHot() { m_diffuse.setb(0xFF, 0x69, 0xB4); updateColors();}
494
496 inline void setPinkDeep() { m_diffuse.setb(0xFF, 0x14, 0x93); updateColors();}
497
499 inline void setPinkMediumVioletRed() { m_diffuse.setb(0xC7, 0x15, 0x85); updateColors();}
500
502 inline void setPinkPaleVioletRed() { m_diffuse.setb(0xDB, 0x70, 0x93); updateColors();}
503
504
505 //--------------------------------------------------------------------------
506 // PUBLIC METHODS - ORANGE COLORS
507 //--------------------------------------------------------------------------
508
510 inline void setOrangeLightSalmon() { m_diffuse.setb(0xFF, 0xA0, 0x7A); updateColors();}
511
513 inline void setOrangeCoral() { m_diffuse.setb(0xFF, 0x7F, 0x50); updateColors();}
514
516 inline void setOrangeTomato() { m_diffuse.setb(0xFF, 0x63, 0x47); updateColors();}
517
519 inline void setOrangeRed() { m_diffuse.setb(0xFF, 0x45, 0x00); updateColors();}
520
522 inline void setOrangeDark() { m_diffuse.setb(0xFF, 0x8C, 0x00); updateColors();}
523
525 inline void setOrange() { m_diffuse.setb(0xFF, 0xA5, 0x00); updateColors();}
526
527
528 //--------------------------------------------------------------------------
529 // PUBLIC METHODS - YELLOW COLORS
530 //--------------------------------------------------------------------------
531
533 inline void setYellowGold() { m_diffuse.setb(0xFF, 0xD7, 0x00); updateColors();}
534
536 inline void setYellow() { m_diffuse.setb(0xFF, 0xFF, 0x00); updateColors();}
537
539 inline void setYellowLight() { m_diffuse.setb(0xFF, 0xFF, 0xE0); updateColors();}
540
542 inline void setYellowLemonChiffon() { m_diffuse.setb(0xFF, 0xFA, 0xCD); updateColors();}
543
545 inline void setYellowLightGoldenrod() { m_diffuse.setb(0xFA, 0xFA, 0xD); updateColors();}
546
548 inline void setYellowPapayaWhip() { m_diffuse.setb(0xFF, 0xEF, 0xD5); updateColors();}
549
551 inline void setYellowMoccasin() { m_diffuse.setb(0xFF, 0xE4, 0xB5); updateColors();}
552
554 inline void setYellowPeachPuff() { m_diffuse.setb(0xFF, 0xDA, 0xB9); updateColors();}
555
557 inline void setYellowPaleGoldenrod() { m_diffuse.setb(0xEE, 0xE8, 0xAA); updateColors();}
558
560 inline void setYellowKhaki() { m_diffuse.setb(0xF0, 0xE6, 0x8C); updateColors();}
561
563 inline void setYellowDarkKhaki() { m_diffuse.setb(0xBD, 0xB7, 0x6B); updateColors();}
564
565
566 //--------------------------------------------------------------------------
567 // PUBLIC METHODS - PURPLE COLORS
568 //--------------------------------------------------------------------------
569
571 inline void setPurpleLavender() { m_diffuse.setb(0xE6, 0xE6, 0xFA); updateColors();}
572
574 inline void setPurpleThistle() { m_diffuse.setb(0xD8, 0xBF, 0xD8); updateColors();}
575
577 inline void setPurplePlum() { m_diffuse.setb(0xDD, 0xA0, 0xDD); updateColors();}
578
580 inline void setPurpleViolet() { m_diffuse.setb(0xEE, 0x82, 0xEE); updateColors();}
581
583 inline void setPurpleOrchid() { m_diffuse.setb(0xDA, 0x70, 0xD6); updateColors();}
584
586 inline void setPurpleFuchsia() { m_diffuse.setb(0xFF, 0x00, 0xFF); updateColors();}
587
589 inline void setPurpleMagenta() { m_diffuse.setb(0xFF, 0x00, 0xFF); updateColors();}
590
592 inline void setPurpleMediumOrchid() { m_diffuse.setb(0xBA, 0x55, 0xD3); updateColors();}
593
595 inline void setPurpleMedium() { m_diffuse.setb(0x93, 0x70, 0xDB); updateColors();}
596
598 inline void setPurpleAmethyst() { m_diffuse.setb(0x99, 0x66, 0xCC); updateColors();}
599
601 inline void setPurpleBlueViolet() { m_diffuse.setb(0x8A, 0x2B, 0xE2); updateColors();}
602
604 inline void setPurpleDarkViolet() { m_diffuse.setb(0x94, 0x00, 0xD3); updateColors();}
605
607 inline void setPurpleDarkOrchid() { m_diffuse.setb(0x99, 0x32, 0xCC); updateColors();}
608
610 inline void setPurpleDarkMagenta() { m_diffuse.setb(0x8B, 0x00, 0x8B); updateColors();}
611
613 inline void setPurple() { m_diffuse.setb(0x80, 0x00, 0x80); updateColors();}
614
616 inline void setPurpleIndigo() { m_diffuse.setb(0x4B, 0x00, 0x82); updateColors();}
617
619 inline void setPurpleSlateBlue() { m_diffuse.setb(0x6A, 0x5A, 0xCD); updateColors();}
620
622 inline void setPurpleDarkSlateBlue() { m_diffuse.setb(0x48, 0x3D, 0x8B); updateColors();}
623
625 inline void setPurpleMediumSlateBlue() { m_diffuse.setb(0x7B, 0x68, 0xEE); updateColors();}
626
627
628 //--------------------------------------------------------------------------
629 // PUBLIC METHODS - GREEN COLORS
630 //--------------------------------------------------------------------------
631
633 inline void setGreenYellow() { m_diffuse.setb(0xAD, 0xFF, 0x2F); updateColors();}
634
636 inline void setGreenChartreuse() { m_diffuse.setb(0x7F, 0xFF, 0x00); updateColors();}
637
639 inline void setGreenLawn() { m_diffuse.setb(0x7C, 0xFC, 0x00); updateColors();}
640
642 inline void setGreenLime() { m_diffuse.setb(0x00, 0xFF, 0x00); updateColors();}
643
645 inline void setGreenLimeGreen() { m_diffuse.setb(0x32, 0xCD, 0x32); updateColors();}
646
648 inline void setGreenPale() { m_diffuse.setb(0x98, 0xFB, 0x98); updateColors();}
649
651 inline void setGreenLight() { m_diffuse.setb(0x90, 0xEE, 0x90); updateColors();}
652
654 inline void setGreenMediumSpring() { m_diffuse.setb(0x00, 0xFA, 0x9A); updateColors();}
655
657 inline void setGreenSpring() { m_diffuse.setb(0x00, 0xFF, 0x7F); updateColors();}
658
660 inline void setGreenMediumSea() { m_diffuse.setb(0x3C, 0xB3, 0x71); updateColors();}
661
663 inline void setGreenSea() { m_diffuse.setb(0x2E, 0x8B, 0x57); updateColors();}
664
666 inline void setGreenForest() { m_diffuse.setb(0x22, 0x8B, 0x22); updateColors();}
667
669 inline void setGreen() { m_diffuse.setb(0x00, 0x80, 0x00); updateColors();}
670
672 inline void setGreenDark() { m_diffuse.setb(0x00, 0x64, 0x00); updateColors();}
673
675 inline void setGreenYellowGreen() { m_diffuse.setb(0x9A, 0xCD, 0x32); updateColors();}
676
678 inline void setGreenOliveDrab() { m_diffuse.setb(0x6B, 0x8E, 0x23); updateColors();}
679
681 inline void setGreenOlive() { m_diffuse.setb(0x80, 0x80, 0x00); updateColors();}
682
684 inline void setGreenDarkOlive() { m_diffuse.setb(0x55, 0x6B, 0x2F); updateColors();}
685
687 inline void setGreenMediumAquamarine() { m_diffuse.setb(0x66, 0xCD, 0xAA); updateColors();}
688
690 inline void setGreenDarkSea() { m_diffuse.setb(0x8F, 0xBC, 0x8F); updateColors();}
691
693 inline void setGreenLightSea() { m_diffuse.setb(0x20, 0xB2, 0xAA); updateColors();}
694
696 inline void setGreenDarkCyan() { m_diffuse.setb(0x00, 0x8B, 0x8B); updateColors();}
697
699 inline void setGreenTeal() { m_diffuse.setb(0x00, 0x80, 0x80); updateColors();}
700
701
702 //--------------------------------------------------------------------------
703 // PUBLIC METHODS - BLUE COLORS
704 //--------------------------------------------------------------------------
705
707 inline void setBlueAqua() { m_diffuse.setb(0x00, 0xFF, 0xFF); updateColors();}
708
710 inline void setBlueCyan() { m_diffuse.setb(0x00, 0xFF, 0xFF); updateColors();}
711
713 inline void setBlueLightCyan() { m_diffuse.setb(0xE0, 0xFF, 0xFF); updateColors();}
714
716 inline void setBluePaleTurquoise() { m_diffuse.setb(0xAF, 0xEE, 0xEE); updateColors();}
717
719 inline void setBlueAquamarine() { m_diffuse.setb(0x7F, 0xFF, 0xD4); updateColors();}
720
722 inline void setBlueTurquoise() { m_diffuse.setb(0x40, 0xE0, 0xD0); updateColors();}
723
725 inline void setBlueMediumTurquoise() { m_diffuse.setb(0x48, 0xD1, 0xCC); updateColors();}
726
728 inline void setBlueDarkTurquoise() { m_diffuse.setb(0x00, 0xCE, 0xD1); updateColors();}
729
731 inline void setBlueCadet() { m_diffuse.setb(0x5F, 0x9E, 0xA0); updateColors();}
732
734 inline void setBlueSteel() { m_diffuse.setb(0x46, 0x82, 0xB4); updateColors();}
735
737 inline void setBlueLightSteel() { m_diffuse.setb(0xB0, 0xC4, 0xDE); updateColors();}
738
740 inline void setBluePowder() { m_diffuse.setb(0xB0, 0xE0, 0xE6); updateColors();}
741
743 inline void setBlueLight() { m_diffuse.setb(0xAD, 0xD8, 0xE6); updateColors();}
744
746 inline void setBlueSky() { m_diffuse.setb(0x87, 0xCE, 0xEB); updateColors();}
747
749 inline void setBlueLightSky() { m_diffuse.setb(0x87, 0xCE, 0xFA); updateColors();}
750
752 inline void setBlueDeepSky() { m_diffuse.setb(0x00, 0xBF, 0xFF); updateColors();}
753
755 inline void setBlueDodger() { m_diffuse.setb(0x1E, 0x90, 0xFF); updateColors();}
756
758 inline void setBlueCornflower() { m_diffuse.setb(0x64, 0x95, 0xED); updateColors();}
759
761 inline void setBlueMediumSlate() { m_diffuse.setb(0x7B, 0x68, 0xEE); updateColors();}
762
764 inline void setBlueRoyal() { m_diffuse.setb(0x41, 0x69, 0xE1); updateColors();}
765
767 inline void setBlue() { m_diffuse.setb(0x00, 0x00, 0xFF); updateColors();}
768
770 inline void setBlueMedium() { m_diffuse.setb(0x00, 0x00, 0xCD); updateColors();}
771
773 inline void setBlueDark() { m_diffuse.setb(0x00, 0x00, 0x8B); updateColors();}
774
776 inline void setBlueNavy() { m_diffuse.setb(0x00, 0x00, 0x80); updateColors();}
777
779 inline void setBlueMidnight() { m_diffuse.setb(0x19, 0x19, 0x70); updateColors();}
780
781
782 //--------------------------------------------------------------------------
783 // PUBLIC METHODS - BROWN COLORS
784 //--------------------------------------------------------------------------
785
787 inline void setBrownCornsilk() { m_diffuse.setb(0xFF, 0xF8, 0xDC); updateColors();}
788
790 inline void setBrownBlanchedAlmond() { m_diffuse.setb(0xFF, 0xEB, 0xCD); updateColors();}
791
793 inline void setBrownBisque() { m_diffuse.setb(0xFF, 0xE4, 0xC4); updateColors();}
794
796 inline void setBrownNavajoWhite() { m_diffuse.setb(0xFF, 0xDE, 0xAD); updateColors();}
797
799 inline void setBrownWheat() { m_diffuse.setb(0xF5, 0xDE, 0xB3); updateColors();}
800
802 inline void setBrownBurlyWood() { m_diffuse.setb(0xDE, 0xB8, 0x87); updateColors();}
803
805 inline void setBrownTan() { m_diffuse.setb(0xD2, 0xB4, 0x8C); updateColors();}
806
808 inline void setBrownRosy() { m_diffuse.setb(0xBC, 0x8F, 0x8F); updateColors();}
809
811 inline void setBrownSandy() { m_diffuse.setb(0xF4, 0xA4, 0x60); updateColors();}
812
814 inline void setBrownGoldenrod() { m_diffuse.setb(0xDA, 0xA5, 0x20); updateColors();}
815
817 inline void setBrownDarkGoldenrod() { m_diffuse.setb(0xB8, 0x86, 0x0B); updateColors();}
818
820 inline void setBrownPeru() { m_diffuse.setb(0xCD, 0x85, 0x3F); updateColors();}
821
823 inline void setBrownChocolate() { m_diffuse.setb(0xD2, 0x69, 0x1E); updateColors();}
824
826 inline void setBrownSaddle() { m_diffuse.setb(0x8B, 0x45, 0x13); updateColors();}
827
829 inline void setBrownSienna() { m_diffuse.setb(0xA0, 0x52, 0x2D); updateColors();}
830
832 inline void setBrown() { m_diffuse.setb(0xA5, 0x2A, 0x2A); updateColors();}
833
835 inline void setBrownMaroon() { m_diffuse.setb(0x80, 0x00, 0x00); updateColors();}
836
837
838 //--------------------------------------------------------------------------
839 // PUBLIC METHODS - WHITE COLORS
840 //--------------------------------------------------------------------------
841
843 inline void setWhite() { m_diffuse.setb(0xFF, 0xFF, 0xFF); updateColors();}
844
846 inline void setWhiteSnow() { m_diffuse.setb(0xFF, 0xFA, 0xFA); updateColors();}
847
849 inline void setWhiteHoneydew() { m_diffuse.setb(0xF0, 0xFF, 0xF0); updateColors();}
850
852 inline void setWhiteMintCream() { m_diffuse.setb(0xF5, 0xFF, 0xFA); updateColors();}
853
855 inline void setWhiteAzure() { m_diffuse.setb(0xF0, 0xFF, 0xFF); updateColors();}
856
858 inline void setWhiteAliceBlue() { m_diffuse.setb(0xF0, 0xF8, 0xFF); updateColors();}
859
861 inline void setWhiteGhost() { m_diffuse.setb(0xF8, 0xF8, 0xFF); updateColors();}
862
864 inline void setWhiteSmoke() { m_diffuse.setb(0xF5, 0xF5, 0xF5); updateColors();}
865
867 inline void setWhiteSeashell() { m_diffuse.setb(0xFF, 0xF5, 0xEE); updateColors();}
868
870 inline void setWhiteBeige() { m_diffuse.setb(0xF5, 0xF5, 0xDC); updateColors();}
871
873 inline void setWhiteOldLace() { m_diffuse.setb(0xFD, 0xF5, 0xE6); updateColors();}
874
876 inline void setWhiteFloral() { m_diffuse.setb(0xFF, 0xFA, 0xF0); updateColors();}
877
879 inline void setWhiteIvory() { m_diffuse.setb(0xFF, 0xFF, 0xF0); updateColors();}
880
882 inline void setWhiteAntique() { m_diffuse.setb(0xFA, 0xEB, 0xD7); updateColors();}
883
885 inline void setWhiteLinen() { m_diffuse.setb(0xFA, 0xF0, 0xE6); updateColors();}
886
888 inline void setWhiteLavenderBlush() { m_diffuse.setb(0xFF, 0xF0, 0xF5); updateColors();}
889
891 inline void setWhiteMistyRose() { m_diffuse.setb(0xFF, 0xE4, 0xE1); updateColors();}
892
893
894 //--------------------------------------------------------------------------
895 // PUBLIC METHODS - GRAY COLORS
896 //--------------------------------------------------------------------------
897
899 inline void setGrayGainsboro() { m_diffuse.setb(0xDC, 0xDC, 0xDC); updateColors();}
900
902 inline void setGrayLight() { m_diffuse.setb(0xD3, 0xD3, 0xD3); updateColors();}
903
905 inline void setGraySilver() { m_diffuse.setb(0xC0, 0xC0, 0xC0); updateColors();}
906
908 inline void setGrayDark() { m_diffuse.setb(0xA9, 0xA9, 0xA9); updateColors();}
909
911 inline void setGray() { m_diffuse.setb(0x80, 0x80, 0x80); updateColors();}
912
914 inline void setGrayDim() { m_diffuse.setb(0x69, 0x69, 0x69); updateColors();}
915
917 inline void setGrayLightSlate() { m_diffuse.setb(0x77, 0x88, 0x99); updateColors();}
918
920 inline void setGraySlate() { m_diffuse.setb(0x70, 0x80, 0x90); updateColors();}
921
923 inline void setGrayDarkSlate() { m_diffuse.setb(0x2F, 0x4F, 0x4F); updateColors();}
924
926 inline void setBlack() { m_diffuse.setb(0x00, 0x00, 0x00); updateColors();}
927
928
929 //--------------------------------------------------------------------------
930 // PUBLIC METHODS - CUSTOM GRAY COLOR
931 //--------------------------------------------------------------------------
932
933public:
934
935 // This method sets a custom gray level.
936 inline void setGrayLevel(const GLfloat a_level) { m_diffuse.set(a_level, a_level, a_level); updateColors(); }
937
938
939 //--------------------------------------------------------------------------
940 // PROTECTED METHODS - GRAPHICS:
941 //--------------------------------------------------------------------------
942
943protected:
944
946 void updateColors();
947
948
949 //--------------------------------------------------------------------------
950 // PROTECTED MEMBERS - GRAPHICS PROPERTIES:
951 //--------------------------------------------------------------------------
952
953protected:
954
957
960
961
962 //--------------------------------------------------------------------------
963 // PROTECTED MEMBERS - HAPTIC PROPERTIES:
964 //--------------------------------------------------------------------------
965
966protected:
967
969 // NAMES
971
973 std::string m_name;
974
976 std::string m_filename;
977
978
980 // SURFACE STIFFNESS
982
985
988
989
991 // DAMPING
993
994 // Damping level.
995 double m_damping;
996
999
1000
1002 // VISCOSITY
1004
1007
1010
1011
1013 // FRICTION
1015
1018
1021
1024
1027
1028
1030 // TEXTURE
1032
1035
1038
1039
1041 // VIBRATION
1043
1046
1049
1052
1055
1056
1058 // MAGNET
1060
1063
1066
1069
1072
1073
1075 // STICK AND SLIP
1077
1080
1083
1086
1089
1090
1092 // HAPTIC MODES
1094
1097
1100
1103
1106
1109
1112
1115
1118
1121
1124
1125
1127 // SOUND PROPERTIES
1129
1132
1135
1138
1141
1144
1147
1150
1153
1156
1159
1162
1165};
1166
1167//------------------------------------------------------------------------------
1168} // namespace chai3d
1169//------------------------------------------------------------------------------
1170
1171//------------------------------------------------------------------------------
1172#endif
1173//------------------------------------------------------------------------------
1174
Implements an audio Buffer.
Implements color properties.
Implements a general abstract type.
Implements a structure to store rendering options.
This class implements an audio buffer.
Definition CAudioBuffer.h:79
This class implements an abstract type.
Definition CGenericType.h:76
Definition CAudioBuffer.cpp:57
std::shared_ptr< cMaterial > cMaterialPtr
Definition CMaterial.h:69
This class defines a color using a GLubyte representation for each component.
Definition CColor.h:1185
This class defines a color using a GLfloat representation for each component.
Definition CColor.h:139
void set(const GLfloat a_red, const GLfloat a_green, const GLfloat a_blue, const GLfloat a_alpha)
This method sets the color by passing its RGBA components as GLfloat parameters.
Definition CColor.h:244
void setb(const GLubyte a_red, const GLubyte a_green, const GLubyte a_blue, const GLubyte a_alpha)
This method sets the color by passing its RGBA components as GLubyte parameters.
Definition CColor.h:291
void copyTo(cColorf &a_color)
This method copies this color to another if it has been marked.
Definition CColor.h:223
This class models material properties.
Definition CMaterial.h:102
void setPurpleIndigo()
This method sets the color to Indigo.
Definition CMaterial.h:616
void setPurpleDarkOrchid()
This method sets the color to Dark Orchid.
Definition CMaterial.h:607
void setRedDarkSalmon()
This method sets the color to Dark Red Salmon.
Definition CMaterial.h:464
void setAudioFrictionPitchOffset(const double a_audioFrictionPitchOffset)
This method sets the audio pitch offset for sounds associated with friction.
Definition CMaterial.cpp:706
void setBlueLightCyan()
This method sets the color to Light Cyan.
Definition CMaterial.h:713
void setGrayLightSlate()
This method sets the color to Light Slate Gray.
Definition CMaterial.h:917
void setRed()
This method sets the color to Red.
Definition CMaterial.h:473
bool m_flag_audioFrictionPitchGain
Flag to track if related member has been modified.
Definition CMaterial.h:1158
void setHapticTriangleBackSide(const bool a_enabled)
This method enables or disables haptic rendering of back side of mesh triangles.
Definition CMaterial.cpp:583
void setBlueCadet()
This method sets the color to Cadet Blue.
Definition CMaterial.h:731
void setWhiteFloral()
This method sets the color to Floral White.
Definition CMaterial.h:876
void setWhiteSmoke()
This method sets the color to White Smoke.
Definition CMaterial.h:864
void setBlueMediumTurquoise()
This method sets the color to Medium Turquoise.
Definition CMaterial.h:725
void setBlueAquamarine()
This method sets the color to Aquamarine.
Definition CMaterial.h:719
void setPurpleDarkMagenta()
This method sets the color to Dark Magenta.
Definition CMaterial.h:610
void setOrangeRed()
This method sets the color to Orange Red.
Definition CMaterial.h:519
double getVibrationAmplitude() const
This method returns the vibration force amplitude [N].
Definition CMaterial.h:257
void setHapticTriangleFrontSide(const bool a_enabled)
This method enables or disables haptic rendering on the front side of mesh triangles.
Definition CMaterial.cpp:562
double m_audioFrictionPitchGain
General pitch gain for sounds associated with friction.
Definition CMaterial.h:1155
cMaterial()
Constructor of cMaterial.
Definition CMaterial.cpp:57
void setGreenMediumSpring()
This method sets the color to Medium Spring Green.
Definition CMaterial.h:654
void setHapticTriangleSides(const bool a_enableFrontSide, const bool a_enableBackSide)
This method enables or disables haptic rendering of front and back sides of mesh triangles.
Definition CMaterial.cpp:601
void setWhiteBeige()
This method sets the color to Beige.
Definition CMaterial.h:870
void setUseHapticTexture(const bool a_useHapticTexture)
This method enables or disables haptic texture rendering. (Applies to polygonal objects only).
Definition CMaterial.cpp:524
void setBlueLightSteel()
This method sets the color to Light Steel Blue.
Definition CMaterial.h:737
double m_staticFriction
Static friction constant [N].
Definition CMaterial.h:1017
double m_stickSlipForceMax
Force threshold for stick and slip effect [N].
Definition CMaterial.h:1079
void setBlueDodger()
This method sets the color to Doger Blue.
Definition CMaterial.h:755
void setTransparencyLevel(const float a_levelTransparency)
This method sets the transparency level (alpha value) to all color components.
Definition CMaterial.cpp:157
double getDamping() const
This method returns the damping coefficient.
Definition CMaterial.h:308
void setPurpleThistle()
This method sets the color to Thistle.
Definition CMaterial.h:574
void setPurpleMediumOrchid()
This method sets the color to Medium Orchid.
Definition CMaterial.h:592
bool m_flag_hapticBackSideOfTriangles
Flag to track if related member has been modified.
Definition CMaterial.h:1123
bool m_flag_useHapticFriction
Flag to track if related member has been modified.
Definition CMaterial.h:1099
void setYellow()
This method sets the color to Yellow.
Definition CMaterial.h:536
void setUseHapticShading(const bool a_useHapticShading)
This method enables or disables haptic shading. (Applies to polygonal objects only).
Definition CMaterial.cpp:541
double getVibrationFrequency() const
This method returns the vibration frequency [Hz].
Definition CMaterial.h:251
void setBlueRoyal()
This method sets the color to Royal Blue.
Definition CMaterial.h:764
void setWhiteSnow()
This method sets the color to White Snow.
Definition CMaterial.h:846
void setPinkLight()
This method sets the color to Light Pink.
Definition CMaterial.h:490
void setGraySlate()
This method sets the color to Slate Gray.
Definition CMaterial.h:920
void setGreenTeal()
This method sets the color to Teal.
Definition CMaterial.h:699
bool m_flag_stickSlipForceMax
Flag to track if related member has been modified.
Definition CMaterial.h:1082
void setBlueCyan()
This method sets the color to Cyan.
Definition CMaterial.h:710
double getViscosity() const
This method returns the level of viscosity.
Definition CMaterial.h:240
void setBrownRosy()
This method sets the color to Rosy Brown.
Definition CMaterial.h:808
bool m_flag_vibrationFrequency
Flag to track if related member has been modified.
Definition CMaterial.h:1048
void setGreenForest()
This method sets the color to Forest Green.
Definition CMaterial.h:666
void setGrayDarkSlate()
This method sets the color to Dark Slate Gray.
Definition CMaterial.h:923
void setAudioImpactBuffer(cAudioBuffer *a_audioImpactBuffer)
This method sets an audio buffer associated to impacts between a tool and an object.
Definition CMaterial.cpp:620
void setBrownGoldenrod()
This method sets the color to Brown Goldenrod.
Definition CMaterial.h:814
void setYellowKhaki()
This method sets the color to Khaki.
Definition CMaterial.h:560
cColorf m_emissionBackup
Emission color. (Backup)
Definition CMaterial.h:212
double getStickSlipStiffness() const
This method sets the stiffness of the stick and slip model [N/m].
Definition CMaterial.h:291
void setWhiteMintCream()
This method sets the color to Mint Cream.
Definition CMaterial.h:852
void setGrayLight()
This method sets the color to Light Gray.
Definition CMaterial.h:902
void setBrownBlanchedAlmond()
This method sets the color to Blanched Almond.
Definition CMaterial.h:790
void setPurpleViolet()
This method sets the color to Violet.
Definition CMaterial.h:580
void backupColors()
This method creates a backup of its color properties. Any previous backup is lost.
Definition CMaterial.h:163
double m_magnetMaxForce
Maximum force applied by magnetic effect [N].
Definition CMaterial.h:1062
void setStickSlipForceMax(const double a_stickSlipForceMax)
This method sets the maximum force threshold of a stick and slip model [N].
Definition CMaterial.cpp:473
void setBrownSandy()
This method sets the color to Sandy Brown.
Definition CMaterial.h:811
double m_damping
Definition CMaterial.h:995
void setWhiteAzure()
This method sets the color to Azure.
Definition CMaterial.h:855
void setAudioFrictionBuffer(cAudioBuffer *a_audioFrictionBuffer)
This method sets an audio buffer associated with friction.
Definition CMaterial.cpp:638
double m_stiffness
Stiffness [N/m].
Definition CMaterial.h:984
void setYellowLight()
This method sets the color to Light Yellow.
Definition CMaterial.h:539
void setBluePowder()
This method sets the color to Powder Blue.
Definition CMaterial.h:740
bool m_flag_textureLevel
Flag to track if related member has been modified.
Definition CMaterial.h:1037
cColorf m_specular
Specular color.
Definition CMaterial.h:197
void setViscosity(const double a_viscosity)
This method sets the level of viscosity.
Definition CMaterial.cpp:382
void setPinkPaleVioletRed()
This method sets the color to Pale Violet Red.
Definition CMaterial.h:502
void setWhiteAntique()
This method sets the color to Antique White.
Definition CMaterial.h:882
void setGreenSea()
This method sets the color to Sea Green.
Definition CMaterial.h:663
void setModificationFlags(const bool a_value)
This method set a value value to all modification flags.
Definition CMaterial.cpp:746
void setPurpleDarkSlateBlue()
This method sets the color to Dark Slate Blue.
Definition CMaterial.h:622
void setShininess(const GLuint a_shininess)
This method sets the shininess (the exponent used for specular lighting).
Definition CMaterial.cpp:178
void setDynamicFriction(const double a_friction)
This method sets the dynamic friction level.
Definition CMaterial.cpp:326
void setRedSalmon()
This method sets the color to Red Salmon.
Definition CMaterial.h:461
void setWhite()
This method sets the color to White.
Definition CMaterial.h:843
void setStiffness(const double a_stiffness)
This method set the stiffness level [N/m].
Definition CMaterial.cpp:263
void setBlack()
This method sets the color to Black.
Definition CMaterial.h:926
void setVibrationAmplitude(const double a_vibrationAmplitude)
This method sets the vibration force amplitude [N].
Definition CMaterial.cpp:418
void setYellowGold()
This method sets the color to Gold.
Definition CMaterial.h:533
GLuint m_shininess
Material shininess level.
Definition CMaterial.h:956
void setBlueSky()
This method sets the color to Sky Blue.
Definition CMaterial.h:746
void setWhiteHoneydew()
This method sets the color to Honeydew.
Definition CMaterial.h:849
void setWhiteSeashell()
This method sets the color to Seashell.
Definition CMaterial.h:867
void setBrownTan()
This method sets the color to Tan.
Definition CMaterial.h:805
void setOrange()
This method sets the color to Orange.
Definition CMaterial.h:525
bool m_flag_vibrationAmplitude
Flag to track if related member has been modified.
Definition CMaterial.h:1054
void setGray()
This method sets the color to Gray.
Definition CMaterial.h:911
void setPinkDeep()
This method sets the color to Deep Pink.
Definition CMaterial.h:496
void setGrayDark()
This method sets the color to Dark Gray.
Definition CMaterial.h:908
void setBrownBurlyWood()
This method sets the color to Burly Wood.
Definition CMaterial.h:802
void setBlueDarkTurquoise()
This method sets the color to Dark Turquoise.
Definition CMaterial.h:728
void setWhiteOldLace()
This method sets the color to Old Lace.
Definition CMaterial.h:873
bool getUseHapticFriction() const
This method returns the status of haptic friction. (Applies to polygonal objects only).
Definition CMaterial.h:319
double getDynamicFriction() const
This method returns the dynamic friction level.
Definition CMaterial.h:331
void setGrayGainsboro()
This method sets the color to Gainsboro.
Definition CMaterial.h:899
void setGreenLightSea()
This method sets the color to Light Sea Green.
Definition CMaterial.h:693
bool m_flag_audioFrictionBuffer
Flag to track if related member has been modified.
Definition CMaterial.h:1140
void setBlueTurquoise()
This method sets the color to Turquoise.
Definition CMaterial.h:722
GLuint getShininess() const
This method returns the shininess level.
Definition CMaterial.h:148
virtual std::string getClassName()
This method returns the name of the object class.
Definition CMaterial.h:126
void setPurpleAmethyst()
This method sets the color to Amethyst.
Definition CMaterial.h:598
void setRedLightCoral()
This method sets the color to Light Coral Red.
Definition CMaterial.h:458
double m_stickSlipStiffness
Stiffness of stick slip model.
Definition CMaterial.h:1085
void setColorf(const GLfloat a_red, const GLfloat a_green, const GLfloat a_blue, const GLfloat a_alpha=1.0f)
This method defines a color property for this material.
Definition CMaterial.cpp:198
bool m_useHapticFriction
If true, haptic friction rendering is enabled.
Definition CMaterial.h:1096
void setWhiteLinen()
This method sets the color to Linen.
Definition CMaterial.h:885
void setGreenChartreuse()
This method sets the color to Chartreuse.
Definition CMaterial.h:636
double getAudioFrictionGain() const
This method returns the audio gain for sounds associated with friction.
Definition CMaterial.h:414
void restoreColors()
This method restores the color properties from values stored in the backup members.
Definition CMaterial.h:172
cColorf m_ambientBackup
Ambient color. (Backup)
Definition CMaterial.h:203
double getMagnetMaxForce() const
This method returns the maximum force applied by the magnet effect[N].
Definition CMaterial.h:268
bool m_flag_shininess
Flag to track if related member has been modified.
Definition CMaterial.h:959
double getStiffness() const
This method returns the stiffness level [N/m].
Definition CMaterial.h:229
void setPurpleLavender()
This method sets the color to Lavendar.
Definition CMaterial.h:571
void setPurplePlum()
This method sets the color to Plum.
Definition CMaterial.h:577
bool m_flag_audioFrictionGain
Flag to track if related member has been modified.
Definition CMaterial.h:1152
void setGreenLime()
This method sets the color to Lime.
Definition CMaterial.h:642
void setBrownWheat()
This method sets the color to Wheat.
Definition CMaterial.h:799
bool m_flag_audioFrictionPitchOffset
Flag to track if related member has been modified.
Definition CMaterial.h:1164
void setTextureLevel(const double a_textureLevel)
This method sets the haptic texture level.
Definition CMaterial.cpp:354
void setAudioFrictionPitchGain(const double a_audioFrictionPitchGain)
This method sets the audio pitch gain for sounds associated with friction.
Definition CMaterial.cpp:689
void setBrownNavajoWhite()
This method sets the color to Navajo White.
Definition CMaterial.h:796
bool m_flag_stickSlipStiffness
Flag to track if related member has been modified.
Definition CMaterial.h:1088
cColorf m_diffuse
Diffuse color.
Definition CMaterial.h:194
void setGreenSpring()
This method sets the color to Spring Green.
Definition CMaterial.h:657
void setYellowLightGoldenrod()
This method sets the color to Light Goldenrod.
Definition CMaterial.h:545
cAudioBuffer * m_audioImpactBuffer
Sound buffer associated with impacts.
Definition CMaterial.h:1131
void setStickSlipStiffness(double const a_stickSlipStiffness)
This method sets the stiffness of the stick and slip model [N/m].
Definition CMaterial.cpp:490
void setGrayDim()
This method sets the color to Dim Gray.
Definition CMaterial.h:914
void setGreenDarkCyan()
This method sets the color to Dark Cyan.
Definition CMaterial.h:696
std::string m_filename
Material filename.
Definition CMaterial.h:976
void setPinkHot()
This method sets the color to Hot Pink.
Definition CMaterial.h:493
double getAudioFrictionPitchOffset() const
This method returns the audio pitch offset for sounds associated with friction.
Definition CMaterial.h:426
void setBlueLightSky()
This method sets the color to Light Sky Blue.
Definition CMaterial.h:749
void setStaticFriction(const double a_friction)
This method sets the static friction level [N].
Definition CMaterial.cpp:298
bool m_flag_magnetMaxForce
Flag to track if related member has been modified.
Definition CMaterial.h:1065
bool m_flag_audioImpactGain
Flag to track if related member has been modified.
Definition CMaterial.h:1146
void setRedLightSalmon()
This method sets the color to Light Red Salmon.
Definition CMaterial.h:467
void setWhiteMistyRose()
This method sets the color to Misty Rose.
Definition CMaterial.h:891
void setPurple()
This method sets the color to Purple.
Definition CMaterial.h:613
bool m_flag_useHapticTexture
Flag to track if related member has been modified.
Definition CMaterial.h:1105
cMaterialPtr copy()
This method creates a copy itself.
Definition CMaterial.cpp:103
double m_dynamicFriction
Dynamic friction constant [N].
Definition CMaterial.h:1023
void setOrangeTomato()
This method sets the color to Orange Tomato.
Definition CMaterial.h:516
void setGreen()
This method sets the color to Green.
Definition CMaterial.h:669
void setPurpleSlateBlue()
This method sets the color to Slate Blue.
Definition CMaterial.h:619
void setBlueMidnight()
This method sets the color to Midnight Blue.
Definition CMaterial.h:779
void setGreenDarkOlive()
This method sets the color to Dark Olive Green.
Definition CMaterial.h:684
void setYellowMoccasin()
This method sets the color to Moccasin.
Definition CMaterial.h:551
void setDamping(const double a_dampingCoefficient)
This method sets the damping coefficient.
Definition CMaterial.cpp:280
void setPurpleMedium()
This method sets the color to Medium Purple.
Definition CMaterial.h:595
std::string m_name
Material name.
Definition CMaterial.h:973
bool m_flag_audioImpactBuffer
Flag to track if related member has been modified.
Definition CMaterial.h:1134
cColorf m_emission
Emission color.
Definition CMaterial.h:200
void setBrownChocolate()
This method sets the color to Chocolate.
Definition CMaterial.h:823
bool getUseHapticTexture() const
This method returns the status of haptic texture rendering. (Applies to polygonal objects only).
Definition CMaterial.h:342
void setBrownSaddle()
This method sets the color to Saddle Brown.
Definition CMaterial.h:826
void setGreenDark()
This method sets the color to Dark Green.
Definition CMaterial.h:672
void setBrown()
This method sets the color to Brown.
Definition CMaterial.h:832
double m_viscosity
Level of viscosity.
Definition CMaterial.h:1006
void setPurpleMediumSlateBlue()
This method sets the color to Medium Slate Blue.
Definition CMaterial.h:625
void setGreenYellow()
This method sets the color to Green Yellow.
Definition CMaterial.h:633
void setBrownCornsilk()
This method sets the color to Cornsilk.
Definition CMaterial.h:787
void setRedFireBrick()
This method sets the color to Red Fire Brick.
Definition CMaterial.h:476
double getAudioFrictionPitchGain() const
This method returns the audio pitch gain for sounds associated with friction.
Definition CMaterial.h:420
double m_vibrationAmplitude
Amplitude of vibrations [Hz].
Definition CMaterial.h:1051
void setBluePaleTurquoise()
This method sets the color to Pale Turquoise.
Definition CMaterial.h:716
void setBrownMaroon()
This method sets the color to Maroon.
Definition CMaterial.h:835
void updateColors()
This method takes the current diffuse color and updates ambient and specular components.
Definition CMaterial.cpp:244
void setBlue()
This method sets the color to Blue.
Definition CMaterial.h:767
cAudioBuffer * m_audioFrictionBuffer
Sound buffer associated with friction.
Definition CMaterial.h:1137
void setPurpleFuchsia()
This method sets the color to Fuchsia.
Definition CMaterial.h:586
void setOrangeCoral()
This method sets the color to Orange Coral.
Definition CMaterial.h:513
double getAudioImpactGain() const
This method returns the gain value for sounds associated with impacts.
Definition CMaterial.h:397
void setGreenPale()
This method sets the color to Pale Green.
Definition CMaterial.h:648
void setGrayLevel(const GLfloat a_level)
Definition CMaterial.h:936
void setBrownSienna()
This method sets the color to Sienna.
Definition CMaterial.h:829
void setVibrationFrequency(const double a_vibrationFrequency)
This method set the vibration frequency [Hz].
Definition CMaterial.cpp:400
void setAudioImpactGain(const double a_audioImpactGain)
This method sets the audio gain for sounds associated with impacts.
Definition CMaterial.cpp:655
void setColor(cColorf &a_color)
This method defines a color property for this material.
Definition CMaterial.cpp:215
void setOrangeLightSalmon()
This method sets the color to Orange Light Salmon.
Definition CMaterial.h:510
double m_vibrationFrequency
Frequency of vibrations [Hz].
Definition CMaterial.h:1045
void setPurpleDarkViolet()
This method sets the color to Dark Violet.
Definition CMaterial.h:604
bool getHapticTriangleBackSide() const
This method returns the status about back side triangle haptic rendering. (Applies to polygonal objec...
Definition CMaterial.h:371
bool m_flag_stiffness
Flag to track if related member has been modified.
Definition CMaterial.h:987
bool m_flag_staticFriction
Flag to track if related member has been modified.
Definition CMaterial.h:1020
bool m_flag_dynamicFriction
Flag to track if related member has been modified.
Definition CMaterial.h:1026
void setYellowLemonChiffon()
This method sets the color to Lemon Chiffon.
Definition CMaterial.h:542
void setBrownBisque()
This method sets the color to Bisque.
Definition CMaterial.h:793
void setOrangeDark()
This method sets the color to Dark Orange.
Definition CMaterial.h:522
void setGreenMediumAquamarine()
This method sets the color to Medium Aquamarine.
Definition CMaterial.h:687
virtual void render(cRenderOptions &a_options)
This method render the material using OpenGL.
Definition CMaterial.cpp:723
void setBlueMedium()
This method sets the color to Medium Blue.
Definition CMaterial.h:770
void setWhiteLavenderBlush()
This method sets the color to Lavender Blush.
Definition CMaterial.h:888
void setBlueLight()
This method sets the color to Light Blue.
Definition CMaterial.h:743
void setBlueDeepSky()
This method sets the color to Deep Sky Blue.
Definition CMaterial.h:752
void setWhiteAliceBlue()
This method sets the color to Alice Blue.
Definition CMaterial.h:858
void setRedDark()
This method sets the color to Dark Red.
Definition CMaterial.h:479
void setMagnetMaxDistance(const double a_magnetMaxDistance)
This method sets the maximum distance threshold from which magnetic forces are perceived [m].
Definition CMaterial.cpp:455
void setBlueNavy()
This method sets the color to Navy.
Definition CMaterial.h:776
void setGreenLimeGreen()
This method sets the color to Lime Green.
Definition CMaterial.h:645
void setUseHapticFriction(const bool a_useHapticFriction)
This method enables or disables haptic friction. (Applies to polygonal objects only).
Definition CMaterial.cpp:507
static cMaterialPtr create()
Shared cMaterial allocator.
Definition CMaterial.h:116
void setWhiteIvory()
This method sets the color to Ivory.
Definition CMaterial.h:879
cAudioBuffer * getAudioImpactBuffer()
This method returns a pointer to the audio buffer associated with impacts.
Definition CMaterial.h:391
void setGreenOliveDrab()
This method sets the color to Olive Drab.
Definition CMaterial.h:678
cColorf m_ambient
Ambient color.
Definition CMaterial.h:191
void copyTo(cMaterialPtr a_material)
This method copies all modified members (the ones which are flagged) to another material object.
Definition CMaterial.cpp:788
virtual ~cMaterial()
Destructor of cMaterial.
Definition CMaterial.h:113
void setGreenYellowGreen()
This method sets the color to Yellow Green.
Definition CMaterial.h:675
bool isTransparent() const
This method returns true if the material includes partial or full transparency color components.
Definition CMaterial.h:154
bool m_flag_viscosity
Flag to track if related member has been modified.
Definition CMaterial.h:1009
void setPurpleOrchid()
This method sets the color to Orchid.
Definition CMaterial.h:583
void setGraySilver()
This method sets the color to Silver.
Definition CMaterial.h:905
void setGreenLawn()
This method sets the color to Lawn Green.
Definition CMaterial.h:639
void setYellowDarkKhaki()
This method sets the color to Dark Khaki.
Definition CMaterial.h:563
cAudioBuffer * getAudioFrictionBuffer()
This method returns a pointer to the audio buffer associated with friction.
Definition CMaterial.h:408
bool getHapticTriangleFrontSide() const
This method returns the status about front side triangle haptic rendering. (Applies to polygonal obje...
Definition CMaterial.h:365
void setBrownDarkGoldenrod()
This method sets the color to Dark Brown Goldenrod.
Definition CMaterial.h:817
void setYellowPeachPuff()
This method sets the color to Peach Puff.
Definition CMaterial.h:554
void setWhiteGhost()
This method sets the color to Ghost White.
Definition CMaterial.h:861
void setBlueMediumSlate()
This method sets the color to Medium Slate Blue.
Definition CMaterial.h:761
void setPurpleMagenta()
This method sets the color to Magenta.
Definition CMaterial.h:589
void setBlueSteel()
This method sets the color to Steel Blue.
Definition CMaterial.h:734
cColorf m_specularBackup
Specular color. (Backup)
Definition CMaterial.h:209
void setGreenLight()
This method sets the color to Light Green.
Definition CMaterial.h:651
void setBlueCornflower()
This method sets the color to Cornflower Blue.
Definition CMaterial.h:758
bool m_flag_useHapticShading
Flag to track if related member has been modified.
Definition CMaterial.h:1111
void setAudioFrictionGain(const double a_audioFrictionGain)
This method sets the audio gain for sounds associated with friction.
Definition CMaterial.cpp:672
double getStaticFriction() const
This method returns the static friction level [N].
Definition CMaterial.h:325
void setBlueAqua()
This method sets the color to Aqua.
Definition CMaterial.h:707
void setGreenMediumSea()
This method sets the color to Medium Sea Green.
Definition CMaterial.h:660
double m_magnetMaxDistance
Maximum distance from which magnetic forces can be perceived.
Definition CMaterial.h:1068
double getStickSlipForceMax() const
This method returns the maximum force threshold of a stick and slip model [N].
Definition CMaterial.h:285
double getTextureLevel() const
This method returns the haptic texture level.
Definition CMaterial.h:348
bool m_useHapticTexture
If true, haptic texture rendering is enabled.
Definition CMaterial.h:1102
double m_audioFrictionGain
General gain for sounds associated with friction.
Definition CMaterial.h:1149
void setPurpleBlueViolet()
This method sets the color to Blue Violet.
Definition CMaterial.h:601
bool m_hapticFrontSideOfTriangles
If true, then front side of triangles are rendered haptically (used by the proxy algorithm).
Definition CMaterial.h:1114
void setRedIndian()
This method sets the color to Red Indian.
Definition CMaterial.h:455
void setPinkMediumVioletRed()
This method sets the color to Medium Violet Red.
Definition CMaterial.h:499
double m_audioFrictionPitchOffset
General pitch offset for sounds associated with friction.
Definition CMaterial.h:1161
bool getUseHapticShading() const
This method retruns the status of haptic shading. (Applies to polygonal objects only).
Definition CMaterial.h:359
void setBlueDark()
This method sets the color to Dark Blue.
Definition CMaterial.h:773
bool m_flag_hapticFrontSideOfTriangles
Flag to track if related member has been modified.
Definition CMaterial.h:1117
void setPink()
This method sets the color to Pink.
Definition CMaterial.h:487
double m_textureLevel
Texture level constant.
Definition CMaterial.h:1034
void setGreenOlive()
This method sets the color to Olive.
Definition CMaterial.h:681
void setBrownPeru()
This method sets the color to Peru.
Definition CMaterial.h:820
void setRedCrimson()
This method sets the color to Red Crimson.
Definition CMaterial.h:470
bool m_flag_magnetMaxDistance
Flag to track if related member has been modified.
Definition CMaterial.h:1071
void setYellowPapayaWhip()
This method sets the color to Papaya Whip.
Definition CMaterial.h:548
void setMagnetMaxForce(const double a_magnetMaxForce)
This method sets the maximum force applied by the magnet effect [N].
Definition CMaterial.cpp:436
bool m_hapticBackSideOfTriangles
If true, then back side of triangles are rendered haptically (used by the proxy algorithm).
Definition CMaterial.h:1120
double m_audioImpactGain
General gain for sound associated with impacts.
Definition CMaterial.h:1143
double getMagnetMaxDistance() const
This method returns the maximum distance threshold from which magnetic forces are perceived [m].
Definition CMaterial.h:274
cColorf m_diffuseBackup
Diffuse color. (Backup)
Definition CMaterial.h:206
void setGreenDarkSea()
This method sets the color to Dark Sea Green.
Definition CMaterial.h:690
bool m_useHapticShading
If true, haptic shading is enabled.
Definition CMaterial.h:1108
void setYellowPaleGoldenrod()
This method sets the color to Pale Goldenrod.
Definition CMaterial.h:557
bool m_flag_damping
Flag to track if related member has been modified.
Definition CMaterial.h:998
This structures provide a containers for storing rendering options that are passed through the sceneg...
Definition CRenderOptions.h:83