CMaterial.h
Go to the documentation of this file.
1 //==============================================================================
2 /*
3  Software License Agreement (BSD License)
4  Copyright (c) 2003-2016, CHAI3D.
5  (www.chai3d.org)
6 
7  All rights reserved.
8 
9  Redistribution and use in source and binary forms, with or without
10  modification, are permitted provided that the following conditions
11  are met:
12 
13  * Redistributions of source code must retain the above copyright
14  notice, this list of conditions and the following disclaimer.
15 
16  * Redistributions in binary form must reproduce the above
17  copyright notice, this list of conditions and the following
18  disclaimer in the documentation and/or other materials provided
19  with the distribution.
20 
21  * Neither the name of CHAI3D nor the names of its contributors may
22  be used to endorse or promote products derived from this software
23  without specific prior written permission.
24 
25  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
28  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
29  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
30  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
31  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
32  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
33  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
35  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36  POSSIBILITY OF SUCH DAMAGE.
37 
38  \author <http://www.chai3d.org>
39  \author Francois Conti
40  \version 3.2.0 $Rev: 1869 $
41 */
42 //==============================================================================
43 
44 //------------------------------------------------------------------------------
45 #ifndef CMaterialH
46 #define CMaterialH
47 //------------------------------------------------------------------------------
48 #include "audio/CAudioBuffer.h"
49 #include "graphics/CColor.h"
51 //------------------------------------------------------------------------------
52 
53 //------------------------------------------------------------------------------
54 namespace chai3d {
55 //------------------------------------------------------------------------------
56 
57 //==============================================================================
64 //==============================================================================
65 
66 //------------------------------------------------------------------------------
67 struct cMaterial;
68 typedef std::shared_ptr<cMaterial> cMaterialPtr;
69 //------------------------------------------------------------------------------
70 
71 //==============================================================================
99 //==============================================================================
100 struct cMaterial
101 {
102  //--------------------------------------------------------------------------
103  // CONSTRUCTOR & DESTRUCTOR:
104  //--------------------------------------------------------------------------
105 
106 public:
107 
109  cMaterial();
110 
112  virtual ~cMaterial() {};
113 
115  static cMaterialPtr create() { return (std::make_shared<cMaterial>()); }
116 
117 
118  //--------------------------------------------------------------------------
119  // PUBLIC METHODS - COPY:
120  //--------------------------------------------------------------------------
121 
122 public:
123 
125  cMaterialPtr copy();
126 
128  void setModificationFlags(const bool a_value);
129 
131  void copyTo(cMaterialPtr a_material);
132 
133 
134  //--------------------------------------------------------------------------
135  // PUBLIC METHODS - GRAPHIC PROPERTIES:
136  //--------------------------------------------------------------------------
137 
138 public:
139 
141  void setShininess(const GLuint a_shininess);
142 
144  GLuint getShininess() const { return (m_shininess); }
145 
147  void setTransparencyLevel(const float a_levelTransparency);
148 
150  inline bool isTransparent() const
151  {
152  return (m_ambient[4] < 1.0 ||
153  m_diffuse[4] < 1.0 ||
154  m_specular[4] < 1.0 ||
155  m_emission[4]);
156  }
157 
159  inline void backupColors()
160  {
165  }
166 
168  inline void restoreColors()
169  {
174  }
175 
177  virtual void render(cRenderOptions& a_options);
178 
179 
180  //--------------------------------------------------------------------------
181  // PUBLIC MEMBERS - GRAPHIC PROPERTIES:
182  //--------------------------------------------------------------------------
183 
184 public:
185 
188 
191 
194 
197 
200 
203 
206 
209 
210 
211  //--------------------------------------------------------------------------
212  // PUBLIC METHODS - HAPTIC EFFECTS PROPERTIES:
213  //--------------------------------------------------------------------------
214 
215 public:
216 
218  // SURFACE STIFFNESS
220 
222  void setStiffness(const double a_stiffness);
223 
225  inline double getStiffness() const { return (m_stiffness); }
226 
227 
229  // VISCOSITY
231 
233  void setViscosity(const double a_viscosity);
234 
236  inline double getViscosity() const { return (m_viscosity); }
237 
238 
240  // VIBRATION
242 
244  void setVibrationFrequency(const double a_vibrationFrequency);
245 
247  inline double getVibrationFrequency() const {return (m_vibrationFrequency); }
248 
250  void setVibrationAmplitude(const double a_vibrationAmplitude);
251 
253  inline double getVibrationAmplitude() const { return (m_vibrationAmplitude); }
254 
255 
257  // MAGNET
259 
261  void setMagnetMaxForce(const double a_magnetMaxForce);
262 
264  inline double getMagnetMaxForce() const { return (m_magnetMaxForce); }
265 
267  void setMagnetMaxDistance(const double a_magnetMaxDistance);
268 
270  inline double getMagnetMaxDistance() const { return (m_magnetMaxDistance); }
271 
272 
274  // STICK AND SLIP
276 
278  void setStickSlipForceMax(const double a_stickSlipForceMax);
279 
281  inline double getStickSlipForceMax() const { return (m_stickSlipForceMax); }
282 
284  void setStickSlipStiffness(double const a_stickSlipStiffness);
285 
287  inline double getStickSlipStiffness() const { return (m_stickSlipStiffness); }
288 
289 
290  //--------------------------------------------------------------------------
291  // PUBLIC METHODS - HAPTIC PROPERTIES (MESH OBJECTS ONLY)
292  //--------------------------------------------------------------------------
293 
294 public:
295 
297  // DAMPING
299 
301  void setDamping(const double a_dampingCoefficient);
302 
304  inline double getDamping() const { return (m_damping); }
305 
306 
308  // FRICTION
310 
312  void setUseHapticFriction(const bool a_useHapticFriction);
313 
315  inline bool getUseHapticFriction() const { return (m_useHapticFriction); }
316 
318  void setStaticFriction(const double a_friction);
319 
321  inline double getStaticFriction() const { return (m_staticFriction); }
322 
324  void setDynamicFriction(const double a_friction);
325 
327  inline double getDynamicFriction() const { return (m_dynamicFriction); }
328 
329 
331  // TEXTURE
333 
335  void setUseHapticTexture(const bool a_useHapticTexture);
336 
338  inline bool getUseHapticTexture() const { return (m_useHapticTexture); }
339 
341  void setTextureLevel(const double a_textureLevel);
342 
344  inline double getTextureLevel() const { return (m_textureLevel); }
345 
346 
348  // HAPTIC MODES
350 
352  void setUseHapticShading(const bool a_useHapticShading);
353 
355  inline bool getUseHapticShading() const { return (m_useHapticShading); }
356 
358  void setHapticTriangleFrontSide(const bool a_enabled);
359 
362 
364  void setHapticTriangleBackSide(const bool a_enabled);
365 
367  inline bool getHapticTriangleBackSide() const { return (m_hapticBackSideOfTriangles); }
368 
370  void setHapticTriangleSides(const bool a_enableFrontSide, const bool a_enableBackSide);
371 
372 
373  //--------------------------------------------------------------------------
374  // PUBLIC METHODS - AUDIO PROPERTIES
375  //--------------------------------------------------------------------------
376 
377 public:
378 
380  // AUDIO IMPACT
382 
384  void setAudioImpactBuffer(cAudioBuffer* a_audioImpactBuffer);
385 
388 
390  void setAudioImpactGain(const double a_audioImpactGain);
391 
393  inline double getAudioImpactGain() const { return (m_audioImpactGain); }
394 
395 
397  // AUDIO FRICTION
399 
401  void setAudioFrictionBuffer(cAudioBuffer* a_audioFrictionBuffer);
402 
405 
407  void setAudioFrictionGain(const double a_audioFrictionGain);
408 
410  inline double getAudioFrictionGain() const { return (m_audioFrictionGain); }
411 
413  void setAudioFrictionPitchGain(const double a_audioFrictionPitchGain);
414 
416  inline double getAudioFrictionPitchGain() const { return (m_audioFrictionPitchGain); }
417 
419  void setAudioFrictionPitchOffset(const double a_audioFrictionPitchOffset);
420 
422  inline double getAudioFrictionPitchOffset() const { return (m_audioFrictionPitchOffset); }
423 
424 
425  //--------------------------------------------------------------------------
426  // PUBLIC METHODS - COLOR PROPERTIES:
427  //--------------------------------------------------------------------------
428 
429 public:
430 
432  void setColor(cColorf& a_color);
433 
435  void setColor(cColorb& a_color);
436 
438  void setColorf(const GLfloat a_red,
439  const GLfloat a_green,
440  const GLfloat a_blue,
441  const GLfloat a_alpha = 1.0f);
442 
443 
444  //--------------------------------------------------------------------------
445  // PUBLIC METHODS - RED COLORS
446  //--------------------------------------------------------------------------
447 
448 public:
449 
451  inline void setRedIndian() { m_diffuse.setb(0xCD, 0x5C, 0x5C); updateColors();}
452 
454  inline void setRedLightCoral() { m_diffuse.setb(0xF0, 0x80, 0x80); updateColors();}
455 
457  inline void setRedSalmon() { m_diffuse.setb(0xFA, 0x80, 0x72); updateColors();}
458 
460  inline void setRedDarkSalmon() { m_diffuse.setb(0xE9, 0x96, 0x7A); updateColors();}
461 
463  inline void setRedLightSalmon() { m_diffuse.setb(0xFF, 0xA0, 0x7A); updateColors();}
464 
466  inline void setRedCrimson() { m_diffuse.setb(0xDC, 0x14, 0x3C); updateColors();}
467 
469  inline void setRed() { m_diffuse.setb(0xFF, 0x00, 0x00); updateColors();}
470 
472  inline void setRedFireBrick() { m_diffuse.setb(0xB2, 0x22, 0x22); updateColors();}
473 
475  inline void setRedDark() { m_diffuse.setb(0x8B, 0x00, 0x00); updateColors();}
476 
477 
478  //--------------------------------------------------------------------------
479  // PUBLIC METHODS - PINK COLORS
480  //--------------------------------------------------------------------------
481 
483  inline void setPink() { m_diffuse.setb(0xFF, 0xC0, 0xCB); updateColors();}
484 
486  inline void setPinkLight() { m_diffuse.setb(0xFF, 0xB6, 0xC); updateColors();}
487 
489  inline void setPinkHot() { m_diffuse.setb(0xFF, 0x69, 0xB4); updateColors();}
490 
492  inline void setPinkDeep() { m_diffuse.setb(0xFF, 0x14, 0x93); updateColors();}
493 
495  inline void setPinkMediumVioletRed() { m_diffuse.setb(0xC7, 0x15, 0x85); updateColors();}
496 
498  inline void setPinkPaleVioletRed() { m_diffuse.setb(0xDB, 0x70, 0x93); updateColors();}
499 
500 
501  //--------------------------------------------------------------------------
502  // PUBLIC METHODS - ORANGE COLORS
503  //--------------------------------------------------------------------------
504 
506  inline void setOrangeLightSalmon() { m_diffuse.setb(0xFF, 0xA0, 0x7A); updateColors();}
507 
509  inline void setOrangeCoral() { m_diffuse.setb(0xFF, 0x7F, 0x50); updateColors();}
510 
512  inline void setOrangeTomato() { m_diffuse.setb(0xFF, 0x63, 0x47); updateColors();}
513 
515  inline void setOrangeRed() { m_diffuse.setb(0xFF, 0x45, 0x00); updateColors();}
516 
518  inline void setOrangeDark() { m_diffuse.setb(0xFF, 0x8C, 0x00); updateColors();}
519 
521  inline void setOrange() { m_diffuse.setb(0xFF, 0xA5, 0x00); updateColors();}
522 
523 
524  //--------------------------------------------------------------------------
525  // PUBLIC METHODS - YELLOW COLORS
526  //--------------------------------------------------------------------------
527 
529  inline void setYellowGold() { m_diffuse.setb(0xFF, 0xD7, 0x00); updateColors();}
530 
532  inline void setYellow() { m_diffuse.setb(0xFF, 0xFF, 0x00); updateColors();}
533 
535  inline void setYellowLight() { m_diffuse.setb(0xFF, 0xFF, 0xE0); updateColors();}
536 
538  inline void setYellowLemonChiffon() { m_diffuse.setb(0xFF, 0xFA, 0xCD); updateColors();}
539 
541  inline void setYellowLightGoldenrod() { m_diffuse.setb(0xFA, 0xFA, 0xD); updateColors();}
542 
544  inline void setYellowPapayaWhip() { m_diffuse.setb(0xFF, 0xEF, 0xD5); updateColors();}
545 
547  inline void setYellowMoccasin() { m_diffuse.setb(0xFF, 0xE4, 0xB5); updateColors();}
548 
550  inline void setYellowPeachPuff() { m_diffuse.setb(0xFF, 0xDA, 0xB9); updateColors();}
551 
553  inline void setYellowPaleGoldenrod() { m_diffuse.setb(0xEE, 0xE8, 0xAA); updateColors();}
554 
556  inline void setYellowKhaki() { m_diffuse.setb(0xF0, 0xE6, 0x8C); updateColors();}
557 
559  inline void setYellowDarkKhaki() { m_diffuse.setb(0xBD, 0xB7, 0x6B); updateColors();}
560 
561 
562  //--------------------------------------------------------------------------
563  // PUBLIC METHODS - PURPLE COLORS
564  //--------------------------------------------------------------------------
565 
567  inline void setPurpleLavender() { m_diffuse.setb(0xE6, 0xE6, 0xFA); updateColors();}
568 
570  inline void setPurpleThistle() { m_diffuse.setb(0xD8, 0xBF, 0xD8); updateColors();}
571 
573  inline void setPurplePlum() { m_diffuse.setb(0xDD, 0xA0, 0xDD); updateColors();}
574 
576  inline void setPurpleViolet() { m_diffuse.setb(0xEE, 0x82, 0xEE); updateColors();}
577 
579  inline void setPurpleOrchid() { m_diffuse.setb(0xDA, 0x70, 0xD6); updateColors();}
580 
582  inline void setPurpleFuchsia() { m_diffuse.setb(0xFF, 0x00, 0xFF); updateColors();}
583 
585  inline void setPurpleMagenta() { m_diffuse.setb(0xFF, 0x00, 0xFF); updateColors();}
586 
588  inline void setPurpleMediumOrchid() { m_diffuse.setb(0xBA, 0x55, 0xD3); updateColors();}
589 
591  inline void setPurpleMedium() { m_diffuse.setb(0x93, 0x70, 0xDB); updateColors();}
592 
594  inline void setPurpleAmethyst() { m_diffuse.setb(0x99, 0x66, 0xCC); updateColors();}
595 
597  inline void setPurpleBlueViolet() { m_diffuse.setb(0x8A, 0x2B, 0xE2); updateColors();}
598 
600  inline void setPurpleDarkViolet() { m_diffuse.setb(0x94, 0x00, 0xD3); updateColors();}
601 
603  inline void setPurpleDarkOrchid() { m_diffuse.setb(0x99, 0x32, 0xCC); updateColors();}
604 
606  inline void setPurpleDarkMagenta() { m_diffuse.setb(0x8B, 0x00, 0x8B); updateColors();}
607 
609  inline void setPurple() { m_diffuse.setb(0x80, 0x00, 0x80); updateColors();}
610 
612  inline void setPurpleIndigo() { m_diffuse.setb(0x4B, 0x00, 0x82); updateColors();}
613 
615  inline void setPurpleSlateBlue() { m_diffuse.setb(0x6A, 0x5A, 0xCD); updateColors();}
616 
618  inline void setPurpleDarkSlateBlue() { m_diffuse.setb(0x48, 0x3D, 0x8B); updateColors();}
619 
621  inline void setPurpleMediumSlateBlue() { m_diffuse.setb(0x7B, 0x68, 0xEE); updateColors();}
622 
623 
624  //--------------------------------------------------------------------------
625  // PUBLIC METHODS - GREEN COLORS
626  //--------------------------------------------------------------------------
627 
629  inline void setGreenYellow() { m_diffuse.setb(0xAD, 0xFF, 0x2F); updateColors();}
630 
632  inline void setGreenChartreuse() { m_diffuse.setb(0x7F, 0xFF, 0x00); updateColors();}
633 
635  inline void setGreenLawn() { m_diffuse.setb(0x7C, 0xFC, 0x00); updateColors();}
636 
638  inline void setGreenLime() { m_diffuse.setb(0x00, 0xFF, 0x00); updateColors();}
639 
641  inline void setGreenLimeGreen() { m_diffuse.setb(0x32, 0xCD, 0x32); updateColors();}
642 
644  inline void setGreenPale() { m_diffuse.setb(0x98, 0xFB, 0x98); updateColors();}
645 
647  inline void setGreenLight() { m_diffuse.setb(0x90, 0xEE, 0x90); updateColors();}
648 
650  inline void setGreenMediumSpring() { m_diffuse.setb(0x00, 0xFA, 0x9A); updateColors();}
651 
653  inline void setGreenSpring() { m_diffuse.setb(0x00, 0xFF, 0x7F); updateColors();}
654 
656  inline void setGreenMediumSea() { m_diffuse.setb(0x3C, 0xB3, 0x71); updateColors();}
657 
659  inline void setGreenSea() { m_diffuse.setb(0x2E, 0x8B, 0x57); updateColors();}
660 
662  inline void setGreenForest() { m_diffuse.setb(0x22, 0x8B, 0x22); updateColors();}
663 
665  inline void setGreen() { m_diffuse.setb(0x00, 0x80, 0x00); updateColors();}
666 
668  inline void setGreenDark() { m_diffuse.setb(0x00, 0x64, 0x00); updateColors();}
669 
671  inline void setGreenYellowGreen() { m_diffuse.setb(0x9A, 0xCD, 0x32); updateColors();}
672 
674  inline void setGreenOliveDrab() { m_diffuse.setb(0x6B, 0x8E, 0x23); updateColors();}
675 
677  inline void setGreenOlive() { m_diffuse.setb(0x80, 0x80, 0x00); updateColors();}
678 
680  inline void setGreenDarkOlive() { m_diffuse.setb(0x55, 0x6B, 0x2F); updateColors();}
681 
683  inline void setGreenMediumAquamarine() { m_diffuse.setb(0x66, 0xCD, 0xAA); updateColors();}
684 
686  inline void setGreenDarkSea() { m_diffuse.setb(0x8F, 0xBC, 0x8F); updateColors();}
687 
689  inline void setGreenLightSea() { m_diffuse.setb(0x20, 0xB2, 0xAA); updateColors();}
690 
692  inline void setGreenDarkCyan() { m_diffuse.setb(0x00, 0x8B, 0x8B); updateColors();}
693 
695  inline void setGreenTeal() { m_diffuse.setb(0x00, 0x80, 0x80); updateColors();}
696 
697 
698  //--------------------------------------------------------------------------
699  // PUBLIC METHODS - BLUE COLORS
700  //--------------------------------------------------------------------------
701 
703  inline void setBlueAqua() { m_diffuse.setb(0x00, 0xFF, 0xFF); updateColors();}
704 
706  inline void setBlueCyan() { m_diffuse.setb(0x00, 0xFF, 0xFF); updateColors();}
707 
709  inline void setBlueLightCyan() { m_diffuse.setb(0xE0, 0xFF, 0xFF); updateColors();}
710 
712  inline void setBluePaleTurquoise() { m_diffuse.setb(0xAF, 0xEE, 0xEE); updateColors();}
713 
715  inline void setBlueAquamarine() { m_diffuse.setb(0x7F, 0xFF, 0xD4); updateColors();}
716 
718  inline void setBlueTurquoise() { m_diffuse.setb(0x40, 0xE0, 0xD0); updateColors();}
719 
721  inline void setBlueMediumTurquoise() { m_diffuse.setb(0x48, 0xD1, 0xCC); updateColors();}
722 
724  inline void setBlueDarkTurquoise() { m_diffuse.setb(0x00, 0xCE, 0xD1); updateColors();}
725 
727  inline void setBlueCadet() { m_diffuse.setb(0x5F, 0x9E, 0xA0); updateColors();}
728 
730  inline void setBlueSteel() { m_diffuse.setb(0x46, 0x82, 0xB4); updateColors();}
731 
733  inline void setBlueLightSteel() { m_diffuse.setb(0xB0, 0xC4, 0xDE); updateColors();}
734 
736  inline void setBluePowder() { m_diffuse.setb(0xB0, 0xE0, 0xE6); updateColors();}
737 
739  inline void setBlueLight() { m_diffuse.setb(0xAD, 0xD8, 0xE6); updateColors();}
740 
742  inline void setBlueSky() { m_diffuse.setb(0x87, 0xCE, 0xEB); updateColors();}
743 
745  inline void setBlueLightSky() { m_diffuse.setb(0x87, 0xCE, 0xFA); updateColors();}
746 
748  inline void setBlueDeepSky() { m_diffuse.setb(0x00, 0xBF, 0xFF); updateColors();}
749 
751  inline void setBlueDodger() { m_diffuse.setb(0x1E, 0x90, 0xFF); updateColors();}
752 
754  inline void setBlueCornflower() { m_diffuse.setb(0x64, 0x95, 0xED); updateColors();}
755 
757  inline void setBlueMediumSlate() { m_diffuse.setb(0x7B, 0x68, 0xEE); updateColors();}
758 
760  inline void setBlueRoyal() { m_diffuse.setb(0x41, 0x69, 0xE1); updateColors();}
761 
763  inline void setBlue() { m_diffuse.setb(0x00, 0x00, 0xFF); updateColors();}
764 
766  inline void setBlueMedium() { m_diffuse.setb(0x00, 0x00, 0xCD); updateColors();}
767 
769  inline void setBlueDark() { m_diffuse.setb(0x00, 0x00, 0x8B); updateColors();}
770 
772  inline void setBlueNavy() { m_diffuse.setb(0x00, 0x00, 0x80); updateColors();}
773 
775  inline void setBlueMidnight() { m_diffuse.setb(0x19, 0x19, 0x70); updateColors();}
776 
777 
778  //--------------------------------------------------------------------------
779  // PUBLIC METHODS - BROWN COLORS
780  //--------------------------------------------------------------------------
781 
783  inline void setBrownCornsilk() { m_diffuse.setb(0xFF, 0xF8, 0xDC); updateColors();}
784 
786  inline void setBrownBlanchedAlmond() { m_diffuse.setb(0xFF, 0xEB, 0xCD); updateColors();}
787 
789  inline void setBrownBisque() { m_diffuse.setb(0xFF, 0xE4, 0xC4); updateColors();}
790 
792  inline void setBrownNavajoWhite() { m_diffuse.setb(0xFF, 0xDE, 0xAD); updateColors();}
793 
795  inline void setBrownWheat() { m_diffuse.setb(0xF5, 0xDE, 0xB3); updateColors();}
796 
798  inline void setBrownBurlyWood() { m_diffuse.setb(0xDE, 0xB8, 0x87); updateColors();}
799 
801  inline void setBrownTan() { m_diffuse.setb(0xD2, 0xB4, 0x8C); updateColors();}
802 
804  inline void setBrownRosy() { m_diffuse.setb(0xBC, 0x8F, 0x8F); updateColors();}
805 
807  inline void setBrownSandy() { m_diffuse.setb(0xF4, 0xA4, 0x60); updateColors();}
808 
810  inline void setBrownGoldenrod() { m_diffuse.setb(0xDA, 0xA5, 0x20); updateColors();}
811 
813  inline void setBrownDarkGoldenrod() { m_diffuse.setb(0xB8, 0x86, 0x0B); updateColors();}
814 
816  inline void setBrownPeru() { m_diffuse.setb(0xCD, 0x85, 0x3F); updateColors();}
817 
819  inline void setBrownChocolate() { m_diffuse.setb(0xD2, 0x69, 0x1E); updateColors();}
820 
822  inline void setBrownSaddle() { m_diffuse.setb(0x8B, 0x45, 0x13); updateColors();}
823 
825  inline void setBrownSienna() { m_diffuse.setb(0xA0, 0x52, 0x2D); updateColors();}
826 
828  inline void setBrown() { m_diffuse.setb(0xA5, 0x2A, 0x2A); updateColors();}
829 
831  inline void setBrownMaroon() { m_diffuse.setb(0x80, 0x00, 0x00); updateColors();}
832 
833 
834  //--------------------------------------------------------------------------
835  // PUBLIC METHODS - WHITE COLORS
836  //--------------------------------------------------------------------------
837 
839  inline void setWhite() { m_diffuse.setb(0xFF, 0xFF, 0xFF); updateColors();}
840 
842  inline void setWhiteSnow() { m_diffuse.setb(0xFF, 0xFA, 0xFA); updateColors();}
843 
845  inline void setWhiteHoneydew() { m_diffuse.setb(0xF0, 0xFF, 0xF0); updateColors();}
846 
848  inline void setWhiteMintCream() { m_diffuse.setb(0xF5, 0xFF, 0xFA); updateColors();}
849 
851  inline void setWhiteAzure() { m_diffuse.setb(0xF0, 0xFF, 0xFF); updateColors();}
852 
854  inline void setWhiteAliceBlue() { m_diffuse.setb(0xF0, 0xF8, 0xFF); updateColors();}
855 
857  inline void setWhiteGhost() { m_diffuse.setb(0xF8, 0xF8, 0xFF); updateColors();}
858 
860  inline void setWhiteSmoke() { m_diffuse.setb(0xF5, 0xF5, 0xF5); updateColors();}
861 
863  inline void setWhiteSeashell() { m_diffuse.setb(0xFF, 0xF5, 0xEE); updateColors();}
864 
866  inline void setWhiteBeige() { m_diffuse.setb(0xF5, 0xF5, 0xDC); updateColors();}
867 
869  inline void setWhiteOldLace() { m_diffuse.setb(0xFD, 0xF5, 0xE6); updateColors();}
870 
872  inline void setWhiteFloral() { m_diffuse.setb(0xFF, 0xFA, 0xF0); updateColors();}
873 
875  inline void setWhiteIvory() { m_diffuse.setb(0xFF, 0xFF, 0xF0); updateColors();}
876 
878  inline void setWhiteAntique() { m_diffuse.setb(0xFA, 0xEB, 0xD7); updateColors();}
879 
881  inline void setWhiteLinen() { m_diffuse.setb(0xFA, 0xF0, 0xE6); updateColors();}
882 
884  inline void setWhiteLavenderBlush() { m_diffuse.setb(0xFF, 0xF0, 0xF5); updateColors();}
885 
887  inline void setWhiteMistyRose() { m_diffuse.setb(0xFF, 0xE4, 0xE1); updateColors();}
888 
889 
890  //--------------------------------------------------------------------------
891  // PUBLIC METHODS - GRAY COLORS
892  //--------------------------------------------------------------------------
893 
895  inline void setGrayGainsboro() { m_diffuse.setb(0xDC, 0xDC, 0xDC); updateColors();}
896 
898  inline void setGrayLight() { m_diffuse.setb(0xD3, 0xD3, 0xD3); updateColors();}
899 
901  inline void setGraySilver() { m_diffuse.setb(0xC0, 0xC0, 0xC0); updateColors();}
902 
904  inline void setGrayDark() { m_diffuse.setb(0xA9, 0xA9, 0xA9); updateColors();}
905 
907  inline void setGray() { m_diffuse.setb(0x80, 0x80, 0x80); updateColors();}
908 
910  inline void setGrayDim() { m_diffuse.setb(0x69, 0x69, 0x69); updateColors();}
911 
913  inline void setGrayLightSlate() { m_diffuse.setb(0x77, 0x88, 0x99); updateColors();}
914 
916  inline void setGraySlate() { m_diffuse.setb(0x70, 0x80, 0x90); updateColors();}
917 
919  inline void setGrayDarkSlate() { m_diffuse.setb(0x2F, 0x4F, 0x4F); updateColors();}
920 
922  inline void setBlack() { m_diffuse.setb(0x00, 0x00, 0x00); updateColors();}
923 
924 
925  //--------------------------------------------------------------------------
926  // PUBLIC METHODS - CUSTOM GRAY COLOR
927  //--------------------------------------------------------------------------
928 
929 public:
930 
931  // This method sets a custom gray level.
932  inline void setGrayLevel(const GLfloat a_level) { m_diffuse.set(a_level, a_level, a_level); updateColors(); }
933 
934 
935  //--------------------------------------------------------------------------
936  // PROTECTED METHODS - GRAPHICS:
937  //--------------------------------------------------------------------------
938 
939 protected:
940 
942  void updateColors();
943 
944 
945  //--------------------------------------------------------------------------
946  // PROTECTED MEMBERS - GRAPHICS PROPERTIES:
947  //--------------------------------------------------------------------------
948 
949 protected:
950 
952  GLuint m_shininess;
953 
956 
957 
958  //--------------------------------------------------------------------------
959  // PROTECTED MEMBERS - HAPTIC PROPERTIES:
960  //--------------------------------------------------------------------------
961 
962 protected:
963 
965  // SURFACE STIFFNESS
967 
969  double m_stiffness;
970 
973 
974 
976  // DAMPING
978 
979  // Damping level.
980  double m_damping;
981 
984 
985 
987  // VISCOSITY
989 
991  double m_viscosity;
992 
995 
996 
998  // FRICTION
1000 
1003 
1006 
1009 
1012 
1013 
1015  // TEXTURE
1017 
1020 
1023 
1024 
1026  // VIBRATION
1028 
1031 
1034 
1037 
1040 
1041 
1043  // MAGNET
1045 
1048 
1051 
1054 
1057 
1058 
1060  // STICK AND SLIP
1062 
1065 
1068 
1071 
1074 
1075 
1077  // HAPTIC MODES
1079 
1082 
1085 
1088 
1091 
1094 
1097 
1100 
1103 
1106 
1109 
1110 
1112  // SOUND PROPERTIES
1114 
1117 
1120 
1123 
1126 
1129 
1132 
1135 
1138 
1141 
1144 
1147 
1150 };
1151 
1152 //------------------------------------------------------------------------------
1153 } // namespace chai3d
1154 //------------------------------------------------------------------------------
1155 
1156 //------------------------------------------------------------------------------
1157 #endif
1158 //------------------------------------------------------------------------------
1159 
void setPurpleFuchsia()
This method sets the color to Fuchsia.
Definition: CMaterial.h:582
void setWhiteAliceBlue()
This method sets the color to Alice Blue.
Definition: CMaterial.h:854
void setRedSalmon()
This method sets the color to Red Salmon.
Definition: CMaterial.h:457
void setGrayLightSlate()
This method sets the color to Light Slate Gray.
Definition: CMaterial.h:913
void setBrownBisque()
This method sets the color to Bisque.
Definition: CMaterial.h:789
void setPurplePlum()
This method sets the color to Plum.
Definition: CMaterial.h:573
This structures provide a containers for storing rendering options that are passed through the sceneg...
Definition: CRenderOptions.h:82
void setRedCrimson()
This method sets the color to Red Crimson.
Definition: CMaterial.h:466
bool m_flag_hapticFrontSideOfTriangles
Flag to track if related member has been modified.
Definition: CMaterial.h:1102
void setGreenYellowGreen()
This method sets the color to Yellow Green.
Definition: CMaterial.h:671
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 setMagnetMaxDistance(const double a_magnetMaxDistance)
This method sets the maximum distance threshold from which magnetic forces are perceived [m]...
Definition: CMaterial.cpp:455
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 setRedDark()
This method sets the color to Dark Red.
Definition: CMaterial.h:475
void setWhiteLinen()
This method sets the color to Linen.
Definition: CMaterial.h:881
void setGrayLight()
This method sets the color to Light Gray.
Definition: CMaterial.h:898
void setPurpleDarkViolet()
This method sets the color to Dark Violet.
Definition: CMaterial.h:600
void setStickSlipStiffness(double const a_stickSlipStiffness)
This method sets the stiffness of the stick and slip model [N/m].
Definition: CMaterial.cpp:490
void setPurpleMediumOrchid()
This method sets the color to Medium Orchid.
Definition: CMaterial.h:588
double getAudioFrictionGain() const
This method returns the audio gain for sounds associated with friction.
Definition: CMaterial.h:410
void setViscosity(const double a_viscosity)
This method sets the level of viscosity.
Definition: CMaterial.cpp:382
void setBlueNavy()
This method sets the color to Navy.
Definition: CMaterial.h:772
void updateColors()
This method takes the current diffuse color and updates ambient and specular components.
Definition: CMaterial.cpp:244
void setPurpleMediumSlateBlue()
This method sets the color to Medium Slate Blue.
Definition: CMaterial.h:621
void setPurpleMagenta()
This method sets the color to Magenta.
Definition: CMaterial.h:585
bool m_flag_audioFrictionPitchGain
Flag to track if related member has been modified.
Definition: CMaterial.h:1143
void setBrownWheat()
This method sets the color to Wheat.
Definition: CMaterial.h:795
void setBrownPeru()
This method sets the color to Peru.
Definition: CMaterial.h:816
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 setGreenChartreuse()
This method sets the color to Chartreuse.
Definition: CMaterial.h:632
bool m_flag_viscosity
Flag to track if related member has been modified.
Definition: CMaterial.h:994
bool m_flag_audioFrictionGain
Flag to track if related member has been modified.
Definition: CMaterial.h:1137
cAudioBuffer * m_audioFrictionBuffer
Sound buffer associated with friction.
Definition: CMaterial.h:1122
bool m_flag_magnetMaxForce
Flag to track if related member has been modified.
Definition: CMaterial.h:1050
void setBlueLightCyan()
This method sets the color to Light Cyan.
Definition: CMaterial.h:709
void setBlueMediumTurquoise()
This method sets the color to Medium Turquoise.
Definition: CMaterial.h:721
void setBlueMediumSlate()
This method sets the color to Medium Slate Blue.
Definition: CMaterial.h:757
void setUseHapticFriction(const bool a_useHapticFriction)
This method enables or disables haptic friction. (Applies to polygonal objects only).
Definition: CMaterial.cpp:507
void setAudioImpactGain(const double a_audioImpactGain)
This method sets the audio gain for sounds associated with impacts.
Definition: CMaterial.cpp:655
bool m_flag_audioImpactGain
Flag to track if related member has been modified.
Definition: CMaterial.h:1131
cColorf m_emissionBackup
Emission color. (Backup)
Definition: CMaterial.h:208
bool m_flag_audioFrictionBuffer
Flag to track if related member has been modified.
Definition: CMaterial.h:1125
bool isTransparent() const
This method returns true if the material includes partial or full transparency color components...
Definition: CMaterial.h:150
void setVibrationAmplitude(const double a_vibrationAmplitude)
This method sets the vibration force amplitude [N].
Definition: CMaterial.cpp:418
bool getUseHapticShading() const
This method retruns the status of haptic shading. (Applies to polygonal objects only).
Definition: CMaterial.h:355
bool m_flag_audioFrictionPitchOffset
Flag to track if related member has been modified.
Definition: CMaterial.h:1149
void setGreenTeal()
This method sets the color to Teal.
Definition: CMaterial.h:695
double getVibrationAmplitude() const
This method returns the vibration force amplitude [N].
Definition: CMaterial.h:253
Implements an audio Buffer.
bool m_useHapticShading
If true, haptic shading is enabled.
Definition: CMaterial.h:1093
double m_textureLevel
Texture level constant.
Definition: CMaterial.h:1019
void setOrangeRed()
This method sets the color to Orange Red.
Definition: CMaterial.h:515
void setWhiteAntique()
This method sets the color to Antique White.
Definition: CMaterial.h:878
void setYellowLemonChiffon()
This method sets the color to Lemon Chiffon.
Definition: CMaterial.h:538
double getDynamicFriction() const
This method returns the dynamic friction level.
Definition: CMaterial.h:327
void setBlueCadet()
This method sets the color to Cadet Blue.
Definition: CMaterial.h:727
bool m_flag_hapticBackSideOfTriangles
Flag to track if related member has been modified.
Definition: CMaterial.h:1108
void setWhiteSnow()
This method sets the color to White Snow.
Definition: CMaterial.h:842
void setBrownNavajoWhite()
This method sets the color to Navajo White.
Definition: CMaterial.h:792
double getDamping() const
This method returns the damping coefficient.
Definition: CMaterial.h:304
double m_vibrationFrequency
Frequency of vibrations [Hz].
Definition: CMaterial.h:1030
cAudioBuffer * m_audioImpactBuffer
Sound buffer associated with impacts.
Definition: CMaterial.h:1116
void setBrownChocolate()
This method sets the color to Chocolate.
Definition: CMaterial.h:819
void setRed()
This method sets the color to Red.
Definition: CMaterial.h:469
void setGrayGainsboro()
This method sets the color to Gainsboro.
Definition: CMaterial.h:895
void setGrayDarkSlate()
This method sets the color to Dark Slate Gray.
Definition: CMaterial.h:919
void setDamping(const double a_dampingCoefficient)
This method sets the damping coefficient.
Definition: CMaterial.cpp:280
void setPurple()
This method sets the color to Purple.
Definition: CMaterial.h:609
void setPurpleThistle()
This method sets the color to Thistle.
Definition: CMaterial.h:570
double getAudioImpactGain() const
This method returns the gain value for sounds associated with impacts.
Definition: CMaterial.h:393
cAudioBuffer * getAudioImpactBuffer()
This method returns a pointer to the audio buffer associated with impacts.
Definition: CMaterial.h:387
void setGraySlate()
This method sets the color to Slate Gray.
Definition: CMaterial.h:916
void setBlack()
This method sets the color to Black.
Definition: CMaterial.h:922
void setBrownBurlyWood()
This method sets the color to Burly Wood.
Definition: CMaterial.h:798
void setOrangeDark()
This method sets the color to Dark Orange.
Definition: CMaterial.h:518
void setAudioFrictionPitchGain(const double a_audioFrictionPitchGain)
This method sets the audio pitch gain for sounds associated with friction.
Definition: CMaterial.cpp:689
cMaterialPtr copy()
This method creates a copy itself.
Definition: CMaterial.cpp:103
void setGrayDark()
This method sets the color to Dark Gray.
Definition: CMaterial.h:904
cMaterial()
Constructor of cMaterial.
Definition: CMaterial.cpp:57
void setRedLightCoral()
This method sets the color to Light Coral Red.
Definition: CMaterial.h:454
void setYellowPeachPuff()
This method sets the color to Peach Puff.
Definition: CMaterial.h:550
void setPurpleOrchid()
This method sets the color to Orchid.
Definition: CMaterial.h:579
void setBrownSienna()
This method sets the color to Sienna.
Definition: CMaterial.h:825
void setOrangeTomato()
This method sets the color to Orange Tomato.
Definition: CMaterial.h:512
void setBlueSteel()
This method sets the color to Steel Blue.
Definition: CMaterial.h:730
void setGreenSea()
This method sets the color to Sea Green.
Definition: CMaterial.h:659
void setWhiteLavenderBlush()
This method sets the color to Lavender Blush.
Definition: CMaterial.h:884
cColorf m_diffuseBackup
Diffuse color. (Backup)
Definition: CMaterial.h:202
bool m_flag_stiffness
Flag to track if related member has been modified.
Definition: CMaterial.h:972
double m_dynamicFriction
Dynamic friction constant [N].
Definition: CMaterial.h:1008
void setYellowDarkKhaki()
This method sets the color to Dark Khaki.
Definition: CMaterial.h:559
double getStiffness() const
This method returns the stiffness level [N/m].
Definition: CMaterial.h:225
bool m_flag_vibrationFrequency
Flag to track if related member has been modified.
Definition: CMaterial.h:1033
double m_audioFrictionPitchGain
General pitch gain for sounds associated with friction.
Definition: CMaterial.h:1140
bool m_flag_magnetMaxDistance
Flag to track if related member has been modified.
Definition: CMaterial.h:1056
void setMagnetMaxForce(const double a_magnetMaxForce)
This method sets the maximum force applied by the magnet effect [N].
Definition: CMaterial.cpp:436
void setModificationFlags(const bool a_value)
This method set a value value to all modification flags.
Definition: CMaterial.cpp:746
void setWhite()
This method sets the color to White.
Definition: CMaterial.h:839
void setPurpleMedium()
This method sets the color to Medium Purple.
Definition: CMaterial.h:591
void setBlueAquamarine()
This method sets the color to Aquamarine.
Definition: CMaterial.h:715
void setBlueDeepSky()
This method sets the color to Deep Sky Blue.
Definition: CMaterial.h:748
std::shared_ptr< cMaterial > cMaterialPtr
Definition: CMaterial.h:67
void setYellowLight()
This method sets the color to Light Yellow.
Definition: CMaterial.h:535
double getStaticFriction() const
This method returns the static friction level [N].
Definition: CMaterial.h:321
double m_stickSlipStiffness
Stiffness of stick slip model.
Definition: CMaterial.h:1070
void setPinkMediumVioletRed()
This method sets the color to Medium Violet Red.
Definition: CMaterial.h:495
void setRedFireBrick()
This method sets the color to Red Fire Brick.
Definition: CMaterial.h:472
void setGreenLight()
This method sets the color to Light Green.
Definition: CMaterial.h:647
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 setBrownMaroon()
This method sets the color to Maroon.
Definition: CMaterial.h:831
void setBlueMidnight()
This method sets the color to Midnight Blue.
Definition: CMaterial.h:775
void setWhiteAzure()
This method sets the color to Azure.
Definition: CMaterial.h:851
void setBlueLight()
This method sets the color to Light Blue.
Definition: CMaterial.h:739
bool m_hapticFrontSideOfTriangles
If true, then front side of triangles are rendered haptically (used by the proxy algorithm).
Definition: CMaterial.h:1099
double m_audioFrictionGain
General gain for sounds associated with friction.
Definition: CMaterial.h:1134
void copyTo(cColorf &a_color)
This method copies this color to another if it has been marked.
Definition: CColor.h:223
void setBlueLightSky()
This method sets the color to Light Sky Blue.
Definition: CMaterial.h:745
void setGreenYellow()
This method sets the color to Green Yellow.
Definition: CMaterial.h:629
void copyTo(cMaterialPtr a_material)
This method copies all modified members (the ones which are flagged) to another material object...
Definition: CMaterial.cpp:788
This class implements an audio buffer.
Definition: CAudioBuffer.h:78
void setTextureLevel(const double a_textureLevel)
This method sets the haptic texture level.
Definition: CMaterial.cpp:354
bool m_flag_useHapticFriction
Flag to track if related member has been modified.
Definition: CMaterial.h:1084
double m_vibrationAmplitude
Amplitude of vibrations [Hz].
Definition: CMaterial.h:1036
void setGreenDarkOlive()
This method sets the color to Dark Olive Green.
Definition: CMaterial.h:680
void setBlueMedium()
This method sets the color to Medium Blue.
Definition: CMaterial.h:766
double getMagnetMaxForce() const
This method returns the maximum force applied by the magnet effect[N].
Definition: CMaterial.h:264
double m_magnetMaxDistance
Maximum distance from which magnetic forces can be perceived.
Definition: CMaterial.h:1053
void setWhiteSmoke()
This method sets the color to White Smoke.
Definition: CMaterial.h:860
void setColor(cColorf &a_color)
This method defines a color property for this material.
Definition: CMaterial.cpp:215
void setPinkLight()
This method sets the color to Light Pink.
Definition: CMaterial.h:486
bool m_useHapticTexture
If true, haptic texture rendering is enabled.
Definition: CMaterial.h:1087
void setPurpleDarkMagenta()
This method sets the color to Dark Magenta.
Definition: CMaterial.h:606
virtual ~cMaterial()
Destructor of cMaterial.
Definition: CMaterial.h:112
void setBrownCornsilk()
This method sets the color to Cornsilk.
Definition: CMaterial.h:783
void setBrownTan()
This method sets the color to Tan.
Definition: CMaterial.h:801
void setHapticTriangleFrontSide(const bool a_enabled)
This method enables or disables haptic rendering on the front side of mesh triangles.
Definition: CMaterial.cpp:562
void setTransparencyLevel(const float a_levelTransparency)
This method sets the transparency level (alpha value) to all color components.
Definition: CMaterial.cpp:157
void setGray()
This method sets the color to Gray.
Definition: CMaterial.h:907
void setVibrationFrequency(const double a_vibrationFrequency)
This method set the vibration frequency [Hz].
Definition: CMaterial.cpp:400
void setGreenMediumSea()
This method sets the color to Medium Sea Green.
Definition: CMaterial.h:656
cAudioBuffer * getAudioFrictionBuffer()
This method returns a pointer to the audio buffer associated with friction.
Definition: CMaterial.h:404
GLuint m_shininess
Material shininess level.
Definition: CMaterial.h:952
void setGraySilver()
This method sets the color to Silver.
Definition: CMaterial.h:901
void setYellowMoccasin()
This method sets the color to Moccasin.
Definition: CMaterial.h:547
void setBrown()
This method sets the color to Brown.
Definition: CMaterial.h:828
void setBrownSaddle()
This method sets the color to Saddle Brown.
Definition: CMaterial.h:822
void setGreenLimeGreen()
This method sets the color to Lime Green.
Definition: CMaterial.h:641
void setDynamicFriction(const double a_friction)
This method sets the dynamic friction level.
Definition: CMaterial.cpp:326
void restoreColors()
This method restores the color properties from values stored in the backup members.
Definition: CMaterial.h:168
void setWhiteBeige()
This method sets the color to Beige.
Definition: CMaterial.h:866
bool getHapticTriangleFrontSide() const
This method returns the status about front side triangle haptic rendering. (Applies to polygonal obje...
Definition: CMaterial.h:361
void setYellowPaleGoldenrod()
This method sets the color to Pale Goldenrod.
Definition: CMaterial.h:553
bool m_flag_shininess
Flag to track if related member has been modified.
Definition: CMaterial.h:955
void setOrangeLightSalmon()
This method sets the color to Orange Light Salmon.
Definition: CMaterial.h:506
void setBrownDarkGoldenrod()
This method sets the color to Dark Brown Goldenrod.
Definition: CMaterial.h:813
virtual void render(cRenderOptions &a_options)
This method render the material using OpenGL.
Definition: CMaterial.cpp:723
This class defines a color using a GLubyte representation for each component.
Definition: CColor.h:1184
bool m_flag_stickSlipForceMax
Flag to track if related member has been modified.
Definition: CMaterial.h:1067
void setWhiteIvory()
This method sets the color to Ivory.
Definition: CMaterial.h:875
cColorf m_diffuse
Diffuse color.
Definition: CMaterial.h:190
This class models material properties.
Definition: CMaterial.h:100
void setPurpleBlueViolet()
This method sets the color to Blue Violet.
Definition: CMaterial.h:597
Implements a structure to store rendering options.
bool m_hapticBackSideOfTriangles
If true, then back side of triangles are rendered haptically (used by the proxy algorithm).
Definition: CMaterial.h:1105
void setBlue()
This method sets the color to Blue.
Definition: CMaterial.h:763
void setGreen()
This method sets the color to Green.
Definition: CMaterial.h:665
void setPinkDeep()
This method sets the color to Deep Pink.
Definition: CMaterial.h:492
void setOrangeCoral()
This method sets the color to Orange Coral.
Definition: CMaterial.h:509
bool m_useHapticFriction
If true, haptic friction rendering is enabled.
Definition: CMaterial.h:1081
void setWhiteGhost()
This method sets the color to Ghost White.
Definition: CMaterial.h:857
void setYellow()
This method sets the color to Yellow.
Definition: CMaterial.h:532
void setGreenMediumSpring()
This method sets the color to Medium Spring Green.
Definition: CMaterial.h:650
void setPurpleIndigo()
This method sets the color to Indigo.
Definition: CMaterial.h:612
double m_damping
Definition: CMaterial.h:980
void setYellowGold()
This method sets the color to Gold.
Definition: CMaterial.h:529
void setGreenLime()
This method sets the color to Lime.
Definition: CMaterial.h:638
void setGrayDim()
This method sets the color to Dim Gray.
Definition: CMaterial.h:910
cColorf m_ambient
Ambient color.
Definition: CMaterial.h:187
void setBlueDark()
This method sets the color to Dark Blue.
Definition: CMaterial.h:769
void setAudioFrictionGain(const double a_audioFrictionGain)
This method sets the audio gain for sounds associated with friction.
Definition: CMaterial.cpp:672
void setGreenPale()
This method sets the color to Pale Green.
Definition: CMaterial.h:644
double m_magnetMaxForce
Maximum force applied by magnetic effect [N].
Definition: CMaterial.h:1047
cColorf m_ambientBackup
Ambient color. (Backup)
Definition: CMaterial.h:199
void setBlueLightSteel()
This method sets the color to Light Steel Blue.
Definition: CMaterial.h:733
void setRedIndian()
This method sets the color to Red Indian.
Definition: CMaterial.h:451
double m_stiffness
Stiffness [N/m].
Definition: CMaterial.h:969
bool getUseHapticFriction() const
This method returns the status of haptic friction. (Applies to polygonal objects only).
Definition: CMaterial.h:315
void setGreenDarkSea()
This method sets the color to Dark Sea Green.
Definition: CMaterial.h:686
void setPinkHot()
This method sets the color to Hot Pink.
Definition: CMaterial.h:489
void setPurpleDarkSlateBlue()
This method sets the color to Dark Slate Blue.
Definition: CMaterial.h:618
void setAudioFrictionPitchOffset(const double a_audioFrictionPitchOffset)
This method sets the audio pitch offset for sounds associated with friction.
Definition: CMaterial.cpp:706
double m_audioImpactGain
General gain for sound associated with impacts.
Definition: CMaterial.h:1128
void setGreenForest()
This method sets the color to Forest Green.
Definition: CMaterial.h:662
void setGreenDarkCyan()
This method sets the color to Dark Cyan.
Definition: CMaterial.h:692
void setBluePowder()
This method sets the color to Powder Blue.
Definition: CMaterial.h:736
This class defines a color using a GLfloat representation for each component.
Definition: CColor.h:138
Implements color properties.
cColorf m_emission
Emission color.
Definition: CMaterial.h:196
bool getUseHapticTexture() const
This method returns the status of haptic texture rendering. (Applies to polygonal objects only)...
Definition: CMaterial.h:338
double m_stickSlipForceMax
Force threshold for stick and slip effect [N].
Definition: CMaterial.h:1064
void setWhiteHoneydew()
This method sets the color to Honeydew.
Definition: CMaterial.h:845
void setRedDarkSalmon()
This method sets the color to Dark Red Salmon.
Definition: CMaterial.h:460
void setPinkPaleVioletRed()
This method sets the color to Pale Violet Red.
Definition: CMaterial.h:498
void setWhiteMintCream()
This method sets the color to Mint Cream.
Definition: CMaterial.h:848
void setGreenLawn()
This method sets the color to Lawn Green.
Definition: CMaterial.h:635
void setRedLightSalmon()
This method sets the color to Light Red Salmon.
Definition: CMaterial.h:463
double getAudioFrictionPitchOffset() const
This method returns the audio pitch offset for sounds associated with friction.
Definition: CMaterial.h:422
void setYellowLightGoldenrod()
This method sets the color to Light Goldenrod.
Definition: CMaterial.h:541
void setBluePaleTurquoise()
This method sets the color to Pale Turquoise.
Definition: CMaterial.h:712
bool m_flag_stickSlipStiffness
Flag to track if related member has been modified.
Definition: CMaterial.h:1073
void setBlueSky()
This method sets the color to Sky Blue.
Definition: CMaterial.h:742
void setGreenSpring()
This method sets the color to Spring Green.
Definition: CMaterial.h:653
bool getHapticTriangleBackSide() const
This method returns the status about back side triangle haptic rendering. (Applies to polygonal objec...
Definition: CMaterial.h:367
bool m_flag_useHapticShading
Flag to track if related member has been modified.
Definition: CMaterial.h:1096
void setOrange()
This method sets the color to Orange.
Definition: CMaterial.h:521
double getMagnetMaxDistance() const
This method returns the maximum distance threshold from which magnetic forces are perceived [m]...
Definition: CMaterial.h:270
bool m_flag_audioImpactBuffer
Flag to track if related member has been modified.
Definition: CMaterial.h:1119
void setBlueDarkTurquoise()
This method sets the color to Dark Turquoise.
Definition: CMaterial.h:724
void setYellowKhaki()
This method sets the color to Khaki.
Definition: CMaterial.h:556
Definition: CAudioBuffer.cpp:56
bool m_flag_damping
Flag to track if related member has been modified.
Definition: CMaterial.h:983
void setBlueAqua()
This method sets the color to Aqua.
Definition: CMaterial.h:703
double getAudioFrictionPitchGain() const
This method returns the audio pitch gain for sounds associated with friction.
Definition: CMaterial.h:416
void setWhiteOldLace()
This method sets the color to Old Lace.
Definition: CMaterial.h:869
void setGreenOlive()
This method sets the color to Olive.
Definition: CMaterial.h:677
double getStickSlipForceMax() const
This method returns the maximum force threshold of a stick and slip model [N].
Definition: CMaterial.h:281
void setUseHapticShading(const bool a_useHapticShading)
This method enables or disables haptic shading. (Applies to polygonal objects only).
Definition: CMaterial.cpp:541
bool m_flag_textureLevel
Flag to track if related member has been modified.
Definition: CMaterial.h:1022
double getVibrationFrequency() const
This method returns the vibration frequency [Hz].
Definition: CMaterial.h:247
double getViscosity() const
This method returns the level of viscosity.
Definition: CMaterial.h:236
GLuint getShininess() const
This method returns the shininess level.
Definition: CMaterial.h:144
bool m_flag_useHapticTexture
Flag to track if related member has been modified.
Definition: CMaterial.h:1090
void setWhiteMistyRose()
This method sets the color to Misty Rose.
Definition: CMaterial.h:887
void setPurpleViolet()
This method sets the color to Violet.
Definition: CMaterial.h:576
void setGrayLevel(const GLfloat a_level)
Definition: CMaterial.h:932
static cMaterialPtr create()
Shared cMaterial allocator.
Definition: CMaterial.h:115
double getStickSlipStiffness() const
This method sets the stiffness of the stick and slip model [N/m].
Definition: CMaterial.h:287
void setBlueDodger()
This method sets the color to Doger Blue.
Definition: CMaterial.h:751
void setPink()
This method sets the color to Pink.
Definition: CMaterial.h:483
void backupColors()
This method creates a backup of its color properties. Any previous backup is lost.
Definition: CMaterial.h:159
bool m_flag_vibrationAmplitude
Flag to track if related member has been modified.
Definition: CMaterial.h:1039
void setShininess(const GLuint a_shininess)
This method sets the shininess (the exponent used for specular lighting).
Definition: CMaterial.cpp:178
void setGreenLightSea()
This method sets the color to Light Sea Green.
Definition: CMaterial.h:689
void setGreenDark()
This method sets the color to Dark Green.
Definition: CMaterial.h:668
void setBrownGoldenrod()
This method sets the color to Brown Goldenrod.
Definition: CMaterial.h:810
void setBrownRosy()
This method sets the color to Rosy Brown.
Definition: CMaterial.h:804
void setUseHapticTexture(const bool a_useHapticTexture)
This method enables or disables haptic texture rendering. (Applies to polygonal objects only)...
Definition: CMaterial.cpp:524
void setStaticFriction(const double a_friction)
This method sets the static friction level [N].
Definition: CMaterial.cpp:298
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
void setPurpleLavender()
This method sets the color to Lavendar.
Definition: CMaterial.h:567
double getTextureLevel() const
This method returns the haptic texture level.
Definition: CMaterial.h:344
double m_viscosity
Level of viscosity.
Definition: CMaterial.h:991
void setPurpleSlateBlue()
This method sets the color to Slate Blue.
Definition: CMaterial.h:615
void setPurpleAmethyst()
This method sets the color to Amethyst.
Definition: CMaterial.h:594
void setBrownSandy()
This method sets the color to Sandy Brown.
Definition: CMaterial.h:807
void setStiffness(const double a_stiffness)
This method set the stiffness level [N/m].
Definition: CMaterial.cpp:263
bool m_flag_staticFriction
Flag to track if related member has been modified.
Definition: CMaterial.h:1005
void setYellowPapayaWhip()
This method sets the color to Papaya Whip.
Definition: CMaterial.h:544
void setBlueRoyal()
This method sets the color to Royal Blue.
Definition: CMaterial.h:760
void setAudioFrictionBuffer(cAudioBuffer *a_audioFrictionBuffer)
This method sets an audio buffer associated with friction.
Definition: CMaterial.cpp:638
bool m_flag_dynamicFriction
Flag to track if related member has been modified.
Definition: CMaterial.h:1011
void setWhiteSeashell()
This method sets the color to Seashell.
Definition: CMaterial.h:863
void setBlueTurquoise()
This method sets the color to Turquoise.
Definition: CMaterial.h:718
void setPurpleDarkOrchid()
This method sets the color to Dark Orchid.
Definition: CMaterial.h:603
void setGreenMediumAquamarine()
This method sets the color to Medium Aquamarine.
Definition: CMaterial.h:683
void setBlueCornflower()
This method sets the color to Cornflower Blue.
Definition: CMaterial.h:754
cColorf m_specular
Specular color.
Definition: CMaterial.h:193
double m_audioFrictionPitchOffset
General pitch offset for sounds associated with friction.
Definition: CMaterial.h:1146
void setBrownBlanchedAlmond()
This method sets the color to Blanched Almond.
Definition: CMaterial.h:786
void setWhiteFloral()
This method sets the color to Floral White.
Definition: CMaterial.h:872
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 setGreenOliveDrab()
This method sets the color to Olive Drab.
Definition: CMaterial.h:674
void setHapticTriangleBackSide(const bool a_enabled)
This method enables or disables haptic rendering of back side of mesh triangles.
Definition: CMaterial.cpp:583
double m_staticFriction
Static friction constant [N].
Definition: CMaterial.h:1002
cColorf m_specularBackup
Specular color. (Backup)
Definition: CMaterial.h:205
void setBlueCyan()
This method sets the color to Cyan.
Definition: CMaterial.h:706