This class models material properties. More...
#include <CMaterial.h>
Public Member Functions | |
cMaterial () | |
Constructor of cMaterial. More... | |
virtual | ~cMaterial () |
Destructor of cMaterial. More... | |
cMaterialPtr | copy () |
This method creates a copy itself. More... | |
void | setModificationFlags (const bool a_value) |
This method set a value value to all modification flags. More... | |
void | copyTo (cMaterialPtr a_material) |
This method copies all modified members (the ones which are flagged) to another material object. More... | |
void | setShininess (const GLuint a_shininess) |
This method sets the shininess (the exponent used for specular lighting). More... | |
GLuint | getShininess () const |
This method returns the shininess level. More... | |
void | setTransparencyLevel (const float a_levelTransparency) |
This method sets the transparency level (alpha value) to all color components. More... | |
bool | isTransparent () const |
This method returns true if the material includes partial or full transparency color components. More... | |
void | backupColors () |
This method creates a backup of its color properties. Any previous backup is lost. More... | |
void | restoreColors () |
This method restores the color properties from values stored in the backup members. More... | |
virtual void | render (cRenderOptions &a_options) |
This method render the material using OpenGL. More... | |
void | setStiffness (const double a_stiffness) |
This method set the stiffness level [N/m]. More... | |
double | getStiffness () const |
This method returns the stiffness level [N/m]. More... | |
void | setViscosity (const double a_viscosity) |
This method sets the level of viscosity. More... | |
double | getViscosity () const |
This method returns the level of viscosity. More... | |
void | setVibrationFrequency (const double a_vibrationFrequency) |
This method set the vibration frequency [Hz]. More... | |
double | getVibrationFrequency () const |
This method returns the vibration frequency [Hz]. More... | |
void | setVibrationAmplitude (const double a_vibrationAmplitude) |
This method sets the vibration force amplitude [N]. More... | |
double | getVibrationAmplitude () const |
This method returns the vibration force amplitude [N]. More... | |
void | setMagnetMaxForce (const double a_magnetMaxForce) |
This method sets the maximum force applied by the magnet effect [N]. More... | |
double | getMagnetMaxForce () const |
This method returns the maximum force applied by the magnet effect[N]. More... | |
void | setMagnetMaxDistance (const double a_magnetMaxDistance) |
This method sets the maximum distance threshold from which magnetic forces are perceived [m]. More... | |
double | getMagnetMaxDistance () const |
This method returns the maximum distance threshold from which magnetic forces are perceived [m]. More... | |
void | setStickSlipForceMax (const double a_stickSlipForceMax) |
This method sets the maximum force threshold of a stick and slip model [N]. More... | |
double | getStickSlipForceMax () const |
This method returns the maximum force threshold of a stick and slip model [N]. More... | |
void | setStickSlipStiffness (double const a_stickSlipStiffness) |
This method sets the stiffness of the stick and slip model [N/m]. More... | |
double | getStickSlipStiffness () const |
This method sets the stiffness of the stick and slip model [N/m]. More... | |
void | setDamping (const double a_dampingCoefficient) |
This method sets the damping coefficient. More... | |
double | getDamping () const |
This method returns the damping coefficient. More... | |
void | setUseHapticFriction (const bool a_useHapticFriction) |
This method enables or disables haptic friction. (Applies to polygonal objects only). More... | |
bool | getUseHapticFriction () const |
This method returns the status of haptic friction. (Applies to polygonal objects only). More... | |
void | setStaticFriction (const double a_friction) |
This method sets the static friction level [N]. More... | |
double | getStaticFriction () const |
This method returns the static friction level [N]. More... | |
void | setDynamicFriction (const double a_friction) |
This method sets the dynamic friction level. More... | |
double | getDynamicFriction () const |
This method returns the dynamic friction level. More... | |
void | setUseHapticTexture (const bool a_useHapticTexture) |
This method enables or disables haptic texture rendering. (Applies to polygonal objects only). More... | |
bool | getUseHapticTexture () const |
This method returns the status of haptic texture rendering. (Applies to polygonal objects only). More... | |
void | setTextureLevel (const double a_textureLevel) |
This method sets the haptic texture level. More... | |
double | getTextureLevel () const |
This method returns the haptic texture level. More... | |
void | setUseHapticShading (const bool a_useHapticShading) |
This method enables or disables haptic shading. (Applies to polygonal objects only). More... | |
bool | getUseHapticShading () const |
This method retruns the status of haptic shading. (Applies to polygonal objects only). More... | |
void | setHapticTriangleFrontSide (const bool a_enabled) |
This method enables or disables haptic rendering on the front side of mesh triangles. More... | |
bool | getHapticTriangleFrontSide () const |
This method returns the status about front side triangle haptic rendering. (Applies to polygonal objects only). More... | |
void | setHapticTriangleBackSide (const bool a_enabled) |
This method enables or disables haptic rendering of back side of mesh triangles. More... | |
bool | getHapticTriangleBackSide () const |
This method returns the status about back side triangle haptic rendering. (Applies to polygonal objects only). More... | |
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. More... | |
void | setAudioImpactBuffer (cAudioBuffer *a_audioImpactBuffer) |
This method sets an audio buffer associated to impacts between a tool and an object. More... | |
cAudioBuffer * | getAudioImpactBuffer () |
This method returns a pointer to the audio buffer associated with impacts. More... | |
void | setAudioImpactGain (const double a_audioImpactGain) |
This method sets the audio gain for sounds associated with impacts. More... | |
double | getAudioImpactGain () const |
This method returns the gain value for sounds associated with impacts. More... | |
void | setAudioFrictionBuffer (cAudioBuffer *a_audioFrictionBuffer) |
This method sets an audio buffer associated with friction. More... | |
cAudioBuffer * | getAudioFrictionBuffer () |
This method returns a pointer to the audio buffer associated with friction. More... | |
void | setAudioFrictionGain (const double a_audioFrictionGain) |
This method sets the audio gain for sounds associated with friction. More... | |
double | getAudioFrictionGain () const |
This method returns the audio gain for sounds associated with friction. More... | |
void | setAudioFrictionPitchGain (const double a_audioFrictionPitchGain) |
This method sets the audio pitch gain for sounds associated with friction. More... | |
double | getAudioFrictionPitchGain () const |
This method returns the audio pitch gain for sounds associated with friction. More... | |
void | setAudioFrictionPitchOffset (const double a_audioFrictionPitchOffset) |
This method sets the audio pitch offset for sounds associated with friction. More... | |
double | getAudioFrictionPitchOffset () const |
This method returns the audio pitch offset for sounds associated with friction. More... | |
void | setColor (cColorf &a_color) |
This method defines a color property for this material. More... | |
void | setColor (cColorb &a_color) |
This method defines a color property for this material. More... | |
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. More... | |
void | setRedIndian () |
This method sets the color to Red Indian. More... | |
void | setRedLightCoral () |
This method sets the color to Light Coral Red. More... | |
void | setRedSalmon () |
This method sets the color to Red Salmon. More... | |
void | setRedDarkSalmon () |
This method sets the color to Dark Red Salmon. More... | |
void | setRedLightSalmon () |
This method sets the color to Light Red Salmon. More... | |
void | setRedCrimson () |
This method sets the color to Red Crimson. More... | |
void | setRed () |
This method sets the color to Red. More... | |
void | setRedFireBrick () |
This method sets the color to Red Fire Brick. More... | |
void | setRedDark () |
This method sets the color to Dark Red. More... | |
void | setPink () |
This method sets the color to Pink. More... | |
void | setPinkLight () |
This method sets the color to Light Pink. More... | |
void | setPinkHot () |
This method sets the color to Hot Pink. More... | |
void | setPinkDeep () |
This method sets the color to Deep Pink. More... | |
void | setPinkMediumVioletRed () |
This method sets the color to Medium Violet Red. More... | |
void | setPinkPaleVioletRed () |
This method sets the color to Pale Violet Red. More... | |
void | setOrangeLightSalmon () |
This method sets the color to Orange Light Salmon. More... | |
void | setOrangeCoral () |
This method sets the color to Orange Coral. More... | |
void | setOrangeTomato () |
This method sets the color to Orange Tomato. More... | |
void | setOrangeRed () |
This method sets the color to Orange Red. More... | |
void | setOrangeDark () |
This method sets the color to Dark Orange. More... | |
void | setOrange () |
This method sets the color to Orange. More... | |
void | setYellowGold () |
This method sets the color to Gold. More... | |
void | setYellow () |
This method sets the color to Yellow. More... | |
void | setYellowLight () |
This method sets the color to Light Yellow. More... | |
void | setYellowLemonChiffon () |
This method sets the color to Lemon Chiffon. More... | |
void | setYellowLightGoldenrod () |
This method sets the color to Light Goldenrod. More... | |
void | setYellowPapayaWhip () |
This method sets the color to Papaya Whip. More... | |
void | setYellowMoccasin () |
This method sets the color to Moccasin. More... | |
void | setYellowPeachPuff () |
This method sets the color to Peach Puff. More... | |
void | setYellowPaleGoldenrod () |
This method sets the color to Pale Goldenrod. More... | |
void | setYellowKhaki () |
This method sets the color to Khaki. More... | |
void | setYellowDarkKhaki () |
This method sets the color to Dark Khaki. More... | |
void | setPurpleLavender () |
This method sets the color to Lavendar. More... | |
void | setPurpleThistle () |
This method sets the color to Thistle. More... | |
void | setPurplePlum () |
This method sets the color to Plum. More... | |
void | setPurpleViolet () |
This method sets the color to Violet. More... | |
void | setPurpleOrchid () |
This method sets the color to Orchid. More... | |
void | setPurpleFuchsia () |
This method sets the color to Fuchsia. More... | |
void | setPurpleMagenta () |
This method sets the color to Magenta. More... | |
void | setPurpleMediumOrchid () |
This method sets the color to Medium Orchid. More... | |
void | setPurpleMedium () |
This method sets the color to Medium Purple. More... | |
void | setPurpleAmethyst () |
This method sets the color to Amethyst. More... | |
void | setPurpleBlueViolet () |
This method sets the color to Blue Violet. More... | |
void | setPurpleDarkViolet () |
This method sets the color to Dark Violet. More... | |
void | setPurpleDarkOrchid () |
This method sets the color to Dark Orchid. More... | |
void | setPurpleDarkMagenta () |
This method sets the color to Dark Magenta. More... | |
void | setPurple () |
This method sets the color to Purple. More... | |
void | setPurpleIndigo () |
This method sets the color to Indigo. More... | |
void | setPurpleSlateBlue () |
This method sets the color to Slate Blue. More... | |
void | setPurpleDarkSlateBlue () |
This method sets the color to Dark Slate Blue. More... | |
void | setPurpleMediumSlateBlue () |
This method sets the color to Medium Slate Blue. More... | |
void | setGreenYellow () |
This method sets the color to Green Yellow. More... | |
void | setGreenChartreuse () |
This method sets the color to Chartreuse. More... | |
void | setGreenLawn () |
This method sets the color to Lawn Green. More... | |
void | setGreenLime () |
This method sets the color to Lime. More... | |
void | setGreenLimeGreen () |
This method sets the color to Lime Green. More... | |
void | setGreenPale () |
This method sets the color to Pale Green. More... | |
void | setGreenLight () |
This method sets the color to Light Green. More... | |
void | setGreenMediumSpring () |
This method sets the color to Medium Spring Green. More... | |
void | setGreenSpring () |
This method sets the color to Spring Green. More... | |
void | setGreenMediumSea () |
This method sets the color to Medium Sea Green. More... | |
void | setGreenSea () |
This method sets the color to Sea Green. More... | |
void | setGreenForest () |
This method sets the color to Forest Green. More... | |
void | setGreen () |
This method sets the color to Green. More... | |
void | setGreenDark () |
This method sets the color to Dark Green. More... | |
void | setGreenYellowGreen () |
This method sets the color to Yellow Green. More... | |
void | setGreenOliveDrab () |
This method sets the color to Olive Drab. More... | |
void | setGreenOlive () |
This method sets the color to Olive. More... | |
void | setGreenDarkOlive () |
This method sets the color to Dark Olive Green. More... | |
void | setGreenMediumAquamarine () |
This method sets the color to Medium Aquamarine. More... | |
void | setGreenDarkSea () |
This method sets the color to Dark Sea Green. More... | |
void | setGreenLightSea () |
This method sets the color to Light Sea Green. More... | |
void | setGreenDarkCyan () |
This method sets the color to Dark Cyan. More... | |
void | setGreenTeal () |
This method sets the color to Teal. More... | |
void | setBlueAqua () |
This method sets the color to Aqua. More... | |
void | setBlueCyan () |
This method sets the color to Cyan. More... | |
void | setBlueLightCyan () |
This method sets the color to Light Cyan. More... | |
void | setBluePaleTurquoise () |
This method sets the color to Pale Turquoise. More... | |
void | setBlueAquamarine () |
This method sets the color to Aquamarine. More... | |
void | setBlueTurquoise () |
This method sets the color to Turquoise. More... | |
void | setBlueMediumTurquoise () |
This method sets the color to Medium Turquoise. More... | |
void | setBlueDarkTurquoise () |
This method sets the color to Dark Turquoise. More... | |
void | setBlueCadet () |
This method sets the color to Cadet Blue. More... | |
void | setBlueSteel () |
This method sets the color to Steel Blue. More... | |
void | setBlueLightSteel () |
This method sets the color to Light Steel Blue. More... | |
void | setBluePowder () |
This method sets the color to Powder Blue. More... | |
void | setBlueLight () |
This method sets the color to Light Blue. More... | |
void | setBlueSky () |
This method sets the color to Sky Blue. More... | |
void | setBlueLightSky () |
This method sets the color to Light Sky Blue. More... | |
void | setBlueDeepSky () |
This method sets the color to Deep Sky Blue. More... | |
void | setBlueDodger () |
This method sets the color to Doger Blue. More... | |
void | setBlueCornflower () |
This method sets the color to Cornflower Blue. More... | |
void | setBlueMediumSlate () |
This method sets the color to Medium Slate Blue. More... | |
void | setBlueRoyal () |
This method sets the color to Royal Blue. More... | |
void | setBlue () |
This method sets the color to Blue. More... | |
void | setBlueMedium () |
This method sets the color to Medium Blue. More... | |
void | setBlueDark () |
This method sets the color to Dark Blue. More... | |
void | setBlueNavy () |
This method sets the color to Navy. More... | |
void | setBlueMidnight () |
This method sets the color to Midnight Blue. More... | |
void | setBrownCornsilk () |
This method sets the color to Cornsilk. More... | |
void | setBrownBlanchedAlmond () |
This method sets the color to Blanched Almond. More... | |
void | setBrownBisque () |
This method sets the color to Bisque. More... | |
void | setBrownNavajoWhite () |
This method sets the color to Navajo White. More... | |
void | setBrownWheat () |
This method sets the color to Wheat. More... | |
void | setBrownBurlyWood () |
This method sets the color to Burly Wood. More... | |
void | setBrownTan () |
This method sets the color to Tan. More... | |
void | setBrownRosy () |
This method sets the color to Rosy Brown. More... | |
void | setBrownSandy () |
This method sets the color to Sandy Brown. More... | |
void | setBrownGoldenrod () |
This method sets the color to Brown Goldenrod. More... | |
void | setBrownDarkGoldenrod () |
This method sets the color to Dark Brown Goldenrod. More... | |
void | setBrownPeru () |
This method sets the color to Peru. More... | |
void | setBrownChocolate () |
This method sets the color to Chocolate. More... | |
void | setBrownSaddle () |
This method sets the color to Saddle Brown. More... | |
void | setBrownSienna () |
This method sets the color to Sienna. More... | |
void | setBrown () |
This method sets the color to Brown. More... | |
void | setBrownMaroon () |
This method sets the color to Maroon. More... | |
void | setWhite () |
This method sets the color to White. More... | |
void | setWhiteSnow () |
This method sets the color to White Snow. More... | |
void | setWhiteHoneydew () |
This method sets the color to Honeydew. More... | |
void | setWhiteMintCream () |
This method sets the color to Mint Cream. More... | |
void | setWhiteAzure () |
This method sets the color to Azure. More... | |
void | setWhiteAliceBlue () |
This method sets the color to Alice Blue. More... | |
void | setWhiteGhost () |
This method sets the color to Ghost White. More... | |
void | setWhiteSmoke () |
This method sets the color to White Smoke. More... | |
void | setWhiteSeashell () |
This method sets the color to Seashell. More... | |
void | setWhiteBeige () |
This method sets the color to Beige. More... | |
void | setWhiteOldLace () |
This method sets the color to Old Lace. More... | |
void | setWhiteFloral () |
This method sets the color to Floral White. More... | |
void | setWhiteIvory () |
This method sets the color to Ivory. More... | |
void | setWhiteAntique () |
This method sets the color to Antique White. More... | |
void | setWhiteLinen () |
This method sets the color to Linen. More... | |
void | setWhiteLavenderBlush () |
This method sets the color to Lavender Blush. More... | |
void | setWhiteMistyRose () |
This method sets the color to Misty Rose. More... | |
void | setGrayGainsboro () |
This method sets the color to Gainsboro. More... | |
void | setGrayLight () |
This method sets the color to Light Gray. More... | |
void | setGraySilver () |
This method sets the color to Silver. More... | |
void | setGrayDark () |
This method sets the color to Dark Gray. More... | |
void | setGray () |
This method sets the color to Gray. More... | |
void | setGrayDim () |
This method sets the color to Dim Gray. More... | |
void | setGrayLightSlate () |
This method sets the color to Light Slate Gray. More... | |
void | setGraySlate () |
This method sets the color to Slate Gray. More... | |
void | setGrayDarkSlate () |
This method sets the color to Dark Slate Gray. More... | |
void | setBlack () |
This method sets the color to Black. More... | |
void | setGrayLevel (const GLfloat a_level) |
Static Public Member Functions | |
static cMaterialPtr | create () |
Shared cMaterial allocator. More... | |
Public Attributes | |
cColorf | m_ambient |
Ambient color. More... | |
cColorf | m_diffuse |
Diffuse color. More... | |
cColorf | m_specular |
Specular color. More... | |
cColorf | m_emission |
Emission color. More... | |
cColorf | m_ambientBackup |
Ambient color. (Backup) More... | |
cColorf | m_diffuseBackup |
Diffuse color. (Backup) More... | |
cColorf | m_specularBackup |
Specular color. (Backup) More... | |
cColorf | m_emissionBackup |
Emission color. (Backup) More... | |
Protected Member Functions | |
void | updateColors () |
This method takes the current diffuse color and updates ambient and specular components. More... | |
Protected Attributes | |
GLuint | m_shininess |
Material shininess level. More... | |
bool | m_flag_shininess |
Flag to track if related member has been modified. More... | |
double | m_stiffness |
Stiffness [N/m]. More... | |
bool | m_flag_stiffness |
Flag to track if related member has been modified. More... | |
double | m_damping |
bool | m_flag_damping |
Flag to track if related member has been modified. More... | |
double | m_viscosity |
Level of viscosity. More... | |
bool | m_flag_viscosity |
Flag to track if related member has been modified. More... | |
double | m_staticFriction |
Static friction constant [N]. More... | |
bool | m_flag_staticFriction |
Flag to track if related member has been modified. More... | |
double | m_dynamicFriction |
Dynamic friction constant [N]. More... | |
bool | m_flag_dynamicFriction |
Flag to track if related member has been modified. More... | |
double | m_textureLevel |
Texture level constant. More... | |
bool | m_flag_textureLevel |
Flag to track if related member has been modified. More... | |
double | m_vibrationFrequency |
Frequency of vibrations [Hz]. More... | |
bool | m_flag_vibrationFrequency |
Flag to track if related member has been modified. More... | |
double | m_vibrationAmplitude |
Amplitude of vibrations [Hz]. More... | |
bool | m_flag_vibrationAmplitude |
Flag to track if related member has been modified. More... | |
double | m_magnetMaxForce |
Maximum force applied by magnetic effect [N]. More... | |
bool | m_flag_magnetMaxForce |
Flag to track if related member has been modified. More... | |
double | m_magnetMaxDistance |
Maximum distance from which magnetic forces can be perceived. More... | |
bool | m_flag_magnetMaxDistance |
Flag to track if related member has been modified. More... | |
double | m_stickSlipForceMax |
Force threshold for stick and slip effect [N]. More... | |
bool | m_flag_stickSlipForceMax |
Flag to track if related member has been modified. More... | |
double | m_stickSlipStiffness |
Stiffness of stick slip model. More... | |
bool | m_flag_stickSlipStiffness |
Flag to track if related member has been modified. More... | |
bool | m_useHapticFriction |
If true, haptic friction rendering is enabled. More... | |
bool | m_flag_useHapticFriction |
Flag to track if related member has been modified. More... | |
bool | m_useHapticTexture |
If true, haptic texture rendering is enabled. More... | |
bool | m_flag_useHapticTexture |
Flag to track if related member has been modified. More... | |
bool | m_useHapticShading |
If true, haptic shading is enabled. More... | |
bool | m_flag_useHapticShading |
Flag to track if related member has been modified. More... | |
bool | m_hapticFrontSideOfTriangles |
If true, then front side of triangles are rendered haptically (used by the proxy algorithm). More... | |
bool | m_flag_hapticFrontSideOfTriangles |
Flag to track if related member has been modified. More... | |
bool | m_hapticBackSideOfTriangles |
If true, then back side of triangles are rendered haptically (used by the proxy algorithm). More... | |
bool | m_flag_hapticBackSideOfTriangles |
Flag to track if related member has been modified. More... | |
cAudioBuffer * | m_audioImpactBuffer |
Sound buffer associated with impacts. More... | |
bool | m_flag_audioImpactBuffer |
Flag to track if related member has been modified. More... | |
cAudioBuffer * | m_audioFrictionBuffer |
Sound buffer associated with friction. More... | |
bool | m_flag_audioFrictionBuffer |
Flag to track if related member has been modified. More... | |
double | m_audioImpactGain |
General gain for sound associated with impacts. More... | |
bool | m_flag_audioImpactGain |
Flag to track if related member has been modified. More... | |
double | m_audioFrictionGain |
General gain for sounds associated with friction. More... | |
bool | m_flag_audioFrictionGain |
Flag to track if related member has been modified. More... | |
double | m_audioFrictionPitchGain |
General pitch gain for sounds associated with friction. More... | |
bool | m_flag_audioFrictionPitchGain |
Flag to track if related member has been modified. More... | |
double | m_audioFrictionPitchOffset |
General pitch offset for sounds associated with friction. More... | |
bool | m_flag_audioFrictionPitchOffset |
Flag to track if related member has been modified. More... | |
This class provides a description for handling OpenGL graphic material properties. These include: ambient color, diffuse color, specular color, emissive color, and shininess.
Haptic properties are also defined in this class. Properties include stiffness, dynamic friction, and static friction, viscosity, vibration and magnetic effects. Force rendering algorithms will lookup the material properties of an object to compute the desired force rendering effect.
cMaterial also allows the programmer to backup the current materials colors by calling method backup(). These colors can later be retrieved by calling the method restore().
This capability can be very useful when implementing a selection procedure where objects change color when being being selected by a computer mouse for instance. A different color can be applied to the selected object and then restored to the original color once the selection has been completed.
chai3d::cMaterial::cMaterial | ( | ) |
Constructor of cMaterial.
|
inlinevirtual |
|
inlinestatic |
cMaterialPtr chai3d::cMaterial::copy | ( | ) |
This method creates a copy of itself.
void chai3d::cMaterial::setModificationFlags | ( | const bool | a_value | ) |
This method sets all the modification flags to a desired value.
a_value | Value to be assigned to modification flags. |
void chai3d::cMaterial::copyTo | ( | cMaterialPtr | a_material | ) |
This method copies all modified variables to material object passed as argument.
a_material | Destination material where values are copied to. |
void chai3d::cMaterial::setShininess | ( | const GLuint | a_shininess | ) |
This method sets the level of shininess. The value is clamped to range from 0 to 128.
a_shininess | Level of shininess |
|
inline |
void chai3d::cMaterial::setTransparencyLevel | ( | const float | a_levelTransparency | ) |
This method sets the transparency level by setting the alpha value to all color members including ambient, diffuse, specular, and emission.
a_levelTransparency | Level of transparency. |
|
inline |
|
inline |
|
inline |
|
virtual |
This method renders this material using OpenGL.
a_options | Rendering options. |
void chai3d::cMaterial::setStiffness | ( | const double | a_stiffness | ) |
This method sets the level of stiffness for this material. The value is clamped to be a non-negative value.
a_stiffness | Level of stiffness. |
|
inline |
void chai3d::cMaterial::setViscosity | ( | const double | a_viscosity | ) |
This method sets the level of viscosity. The value is clamped to be a non-negative value.
a_viscosity | Level of viscosity. |
|
inline |
void chai3d::cMaterial::setVibrationFrequency | ( | const double | a_vibrationFrequency | ) |
This method sets the frequency of vibration. The value is clamped to be a non-negative value.
a_vibrationFrequency | Frequency of vibration [Hz]. |
|
inline |
void chai3d::cMaterial::setVibrationAmplitude | ( | const double | a_vibrationAmplitude | ) |
This method set the amplitude of vibration. The value is clamped to be a non-negative value.
a_vibrationAmplitude | Amplitude of vibrations [N]. |
|
inline |
void chai3d::cMaterial::setMagnetMaxForce | ( | const double | a_magnetMaxForce | ) |
This method sets the maximum force applied by the magnet [N]. The value is clamped to be a non-negative value.
a_magnetMaxForce | Maximum force of magnet. |
|
inline |
void chai3d::cMaterial::setMagnetMaxDistance | ( | const double | a_magnetMaxDistance | ) |
This method sets the maximum distance from which the magnetic force can be perceived [m]
a_magnetMaxDistance | Maximum distance from object where magnet is active. |
|
inline |
void chai3d::cMaterial::setStickSlipForceMax | ( | const double | a_stickSlipForceMax | ) |
This method sets the maximum force threshold for the stick and slip model [N]. The value is clamped to be a non-negative value.
a_stickSlipForceMax | Maximum force threshold. |
|
inline |
void chai3d::cMaterial::setStickSlipStiffness | ( | double const | a_stickSlipStiffness | ) |
This method sets the stiffness for the stick and slip model [N/m].
a_stickSlipStiffness | Stiffness property. |
|
inline |
void chai3d::cMaterial::setDamping | ( | const double | a_damping | ) |
This method sets the level of damping.
a_damping | Level of damping. |
|
inline |
void chai3d::cMaterial::setUseHapticFriction | ( | const bool | a_useHapticFriction | ) |
This method enables or disables rendering of haptic friction.
a_useHapticFriction | If true, haptic friction rendering in enabled. |
|
inline |
void chai3d::cMaterial::setStaticFriction | ( | const double | a_friction | ) |
This method sets the level of static friction. The value is clamped to be a non-negative value.
a_friction | Level of friction. |
|
inline |
void chai3d::cMaterial::setDynamicFriction | ( | const double | a_friction | ) |
This method sets the level of dynamic friction. The value is clamped to be a non-negative value.
a_friction | Level of friction. |
|
inline |
void chai3d::cMaterial::setUseHapticTexture | ( | const bool | a_useHapticTexture | ) |
This method enables or disables haptic texture rendering.
a_useHapticTexture | If true, haptic texture rendering in enabled. |
|
inline |
void chai3d::cMaterial::setTextureLevel | ( | const double | a_textureLevel | ) |
This method sets the intensity at which the texture map of an object is perceived.
a_textureLevel | Intensity level. |
|
inline |
void chai3d::cMaterial::setUseHapticShading | ( | const bool | a_useHapticShading | ) |
This method enables or disables haptic shading.
a_useHapticShading | If true, haptic shading in enabled. |
|
inline |
void chai3d::cMaterial::setHapticTriangleFrontSide | ( | const bool | a_enabled | ) |
This method enables or disables front side haptic rendering.
If a_enabled
is set to true, then haptic rendering occurs on front side of triangles. This option applies to mesh objects which are rendered using the proxy force algorithm.
a_enabled | If true, then haptic rendering is enabled. |
|
inline |
void chai3d::cMaterial::setHapticTriangleBackSide | ( | const bool | a_enabled | ) |
This method enables or disables back side haptic rendering.
If a_enabled
is set to true, then haptic rendering occurs on back side of triangles. This option applies to mesh objects which are rendered using the proxy force algorithm.
a_enabled | If true, then haptic rendering is enabled. |
|
inline |
void chai3d::cMaterial::setHapticTriangleSides | ( | const bool | a_enableFrontSide, |
const bool | a_enableBackSide | ||
) |
This method defines which sides haptic rendering must occur with triangles.
a_enableFrontSide | If true, then haptic rendering is enabled for front sides. |
a_enableBackSide | If true, then haptic rendering is enabled for back sides. |
void chai3d::cMaterial::setAudioImpactBuffer | ( | cAudioBuffer * | a_audioImpactBuffer | ) |
This method sets an audio buffer associated with any impacts between a haptic tool and an object.
a_audioImpactBuffer | Audio buffer. |
|
inline |
void chai3d::cMaterial::setAudioImpactGain | ( | const double | a_audioImpactGain | ) |
This method sets the audio gain related to impact sounds.
a_audioImpactGain | Audio gain associated to impact. |
|
inline |
void chai3d::cMaterial::setAudioFrictionBuffer | ( | cAudioBuffer * | a_audioFrictionBuffer | ) |
This method sets an audio buffer associated with any friction caused by a haptic tool touching an object.
a_audioFrictionBuffer | Audio buffer. |
|
inline |
void chai3d::cMaterial::setAudioFrictionGain | ( | const double | a_audioFrictionGain | ) |
This method sets the audio gain related to friction sounds.
a_audioFrictionGain | Audio gain associated to friction. |
|
inline |
void chai3d::cMaterial::setAudioFrictionPitchGain | ( | const double | a_audioFrictionPitchGain | ) |
This method sets the audio friction pitch gain.
a_audioFrictionPitchGain | Audio pitch gain associated to friction. |
|
inline |
void chai3d::cMaterial::setAudioFrictionPitchOffset | ( | const double | a_audioFrictionPitchOffset | ) |
This method sets the audio friction pitch offset.
a_audioFrictionPitchOffset | Audio pitch offset associated to friction. |
|
inline |
void chai3d::cMaterial::setColor | ( | cColorf & | a_color | ) |
This method defines a color property for this material.
a_color | Color. |
void chai3d::cMaterial::setColor | ( | cColorb & | a_color | ) |
Define a color property for the material.
a_color | Color. |
void chai3d::cMaterial::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.
a_red | Red component |
a_green | Green component |
a_blue | Blue component |
a_alpha | Alpha component |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
protected |
When a new color is defined by calling methods such as setColorf() or setRed(), the selected color is first set to the diffuse component. This method updates the ambient component by setting it equal to 50% of the diffuse color. The specular color is finally set to pure white.
cColorf chai3d::cMaterial::m_ambient |
cColorf chai3d::cMaterial::m_diffuse |
cColorf chai3d::cMaterial::m_specular |
cColorf chai3d::cMaterial::m_emission |
cColorf chai3d::cMaterial::m_ambientBackup |
cColorf chai3d::cMaterial::m_diffuseBackup |
cColorf chai3d::cMaterial::m_specularBackup |
cColorf chai3d::cMaterial::m_emissionBackup |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |