103 const bool a_affectChildren =
false);
106 virtual cMultiMesh*
copy(
const bool a_duplicateMaterialData =
false,
107 const bool a_duplicateTextureData =
false,
108 const bool a_duplicateMeshData =
false,
109 const bool a_buildCollisionDetector =
true);
120 const bool a_affectChildren =
false);
124 const bool a_affectChildren =
false);
128 double a_dynamicFriction,
129 const bool a_affectChildren =
false);
139 virtual void setShowEnabled(
const bool a_show,
const bool a_affectChildren =
false);
142 virtual void setWireMode(
const bool a_showWireMode,
143 const bool a_affectChildren =
true);
147 const bool a_affectChildren=
true);
150 virtual void setUseTransparency(
const bool a_useTransparency,
const bool a_affectChildren =
false);
154 const bool a_applyToVertices =
false,
155 const bool a_applyToTextures =
false,
156 const bool a_affectChildren =
false);
166 virtual void setUseDisplayList(
const bool a_useDisplayList,
const bool a_affectChildren =
false);
169 virtual void markForUpdate(
const bool a_affectChildren =
false);
179 virtual void setUseMaterial(
const bool a_useMaterial,
const bool a_affectChildren =
true);
201 virtual void setUseTexture(
const bool a_useTexture,
const bool a_affectChildren =
true);
224 virtual void setShowBoundaryBox(
const bool a_showBoundaryBox,
const bool a_affectChildren =
false);
244 const bool a_affectChildren =
false);
249 const bool a_affectChildren =
false);
267 const unsigned int a_IDN,
312 bool getVertex(
const unsigned int a_index,
cMesh*& a_mesh,
unsigned int& a_vertexIndex);
321 virtual void setUseVertexColors(
const bool a_useColors,
const bool a_affectChildren=
true);
334 bool getTriangle(
const unsigned int a_index,
cMesh*& a_mesh,
unsigned int& a_triangleIndex);
407 virtual bool saveToFile(std::string a_filename);
417 virtual void scale(
const double& a_scaleFactor,
const bool a_affectChildren =
true);
420 void scaleXYZ(
const double a_scaleX,
const double a_scaleY,
const double a_scaleZ);
440 const bool a_duplicateMaterialData,
441 const bool a_duplicateTextureData,
442 const bool a_duplicateMeshData,
443 const bool a_buildCollisionDetector);
This class implements a 3D vector.
Definition: CVector3d.h:88
virtual void backupMaterialColors(const bool a_affectChildren=false)
This method creates a backup of the material colors of this object, optionally propagating the operat...
Definition: CMultiMesh.cpp:433
virtual void setWireMode(const bool a_showWireMode, const bool a_affectChildren=true)
This method returns whether wireframe rendering is enabled.
Definition: CMultiMesh.cpp:361
This structures provide a containers for storing rendering options that are passed through the sceneg...
Definition: CRenderOptions.h:82
virtual bool loadFromFile(std::string a_filename)
This method loads a 3D object from a file.
Definition: CMultiMesh.cpp:1550
bool removeMesh(cMesh *a_mesh)
This method removes a mesh primitive from the list of meshes.
Definition: CMultiMesh.cpp:1165
virtual void setFriction(double a_staticFriction, double a_dynamicFriction, const bool a_affectChildren=false)
This method sets the static and dynamic friction properties (polygonal models only), optionally recursively affecting children.
Definition: CMultiMesh.cpp:253
bool addMesh(cMesh *a_mesh)
This method adds an existing mesh primitives to list of meshes.
Definition: CMultiMesh.cpp:1138
bool deleteAllMeshes()
This method deletes all meshes.
Definition: CMultiMesh.cpp:1251
virtual void setCollisionDetectorProperties(unsigned int a_displayDepth, cColorf &a_color, const bool a_affectChildren=false)
This method sets the collision detector graphic display properties.
Definition: CMultiMesh.cpp:1009
This class implements a 3D multi-mesh object.
Definition: CMultiMesh.h:80
virtual void setUseTexture(const bool a_useTexture, const bool a_affectChildren=true)
This method enables or disables the use of texture-mapping, optionally propagating the operation to i...
Definition: CMultiMesh.cpp:609
void setEdgeProperties(const double a_width, const cColorf &a_color)
This method sets the graphic properties for edge-rendering.
Definition: CMultiMesh.cpp:1741
void convertToSingleMesh(cMesh *a_mesh)
This method converts this multimesh into a single mesh object.
Definition: CMultiMesh.cpp:1491
unsigned int getNumTriangles() const
This method returns the the number of stored triangles.
Definition: CMultiMesh.cpp:1394
virtual void setTexture(cTexture1dPtr, const bool a_affectChildren=false)
This method sets a texture to this object, optionally propagating the operation to its children...
Definition: CMultiMesh.cpp:637
virtual void setHapticEnabled(const bool a_hapticEnabled, const bool a_affectChildren=false)
This method enables or disables haptic perception of this object, optionally propagating the change t...
Definition: CMultiMesh.cpp:204
virtual void markForUpdate(const bool a_affectChildren=false)
This method invalidates any existing display lists, optionally propagating the operation to its child...
Definition: CMultiMesh.cpp:505
void clear()
This method clears all triangles and vertices of multi-mesh.
Definition: CMultiMesh.cpp:1475
Implements a class to model polygonal meshes.
void computeAllNormals()
This method computes all triangle normals.
Definition: CMultiMesh.cpp:1655
virtual void setUseCulling(const bool a_useCulling, const bool a_affectChildren=true)
Enable or disabling face-culling, optionally propagating the operation to my children.
Definition: CMultiMesh.cpp:385
virtual void createAABBCollisionDetector(const double a_radius)
Set up an AABB collision detector for this mesh.
Definition: CMultiMesh.cpp:1933
void setShowTangents(const bool a_showTangents)
This method enables or disables the rendering of tangents and bi-tangents.
Definition: CMultiMesh.cpp:1688
virtual void updateGlobalPositions(const bool a_frameOnly)
This method update the global position information about this object.
Definition: CMultiMesh.cpp:1812
std::shared_ptr< cTexture1d > cTexture1dPtr
Definition: CTexture1d.h:67
virtual void createBruteForceCollisionDetector()
Set up a brute force collision detector for this mesh and (optionally) for its children.
Definition: CMultiMesh.cpp:1916
std::shared_ptr< cMaterial > cMaterialPtr
Definition: CMaterial.h:67
void scaleXYZ(const double a_scaleX, const double a_scaleY, const double a_scaleZ)
This method scales this object by using different factors along X,Y and Z axes.
Definition: CMultiMesh.cpp:1064
void copyMultiMeshProperties(cMultiMesh *a_obj, const bool a_duplicateMaterialData, const bool a_duplicateTextureData, const bool a_duplicateMeshData, const bool a_buildCollisionDetector)
This method copies all properties of this multi-mesh object to another.
Definition: CMultiMesh.cpp:136
virtual ~cMultiMesh()
Destructor of cMultiMesh.
Definition: CMultiMesh.cpp:83
virtual void setUseVertexColors(const bool a_useColors, const bool a_affectChildren=true)
This method enables or disables the use of per-vertex colors, optionally propagating the operation to...
Definition: CMultiMesh.cpp:410
virtual void setShaderProgram(cShaderProgramPtr a_shaderProgram, const bool a_affectChildren=false)
Set shader program.
Definition: CMultiMesh.cpp:663
virtual cVector3d computeInteractions(const cVector3d &a_toolPos, const cVector3d &a_toolVel, const unsigned int a_IDN, cInteractionRecorder &a_interactions)
Computer haptic interaction.
Definition: CMultiMesh.cpp:1973
cMesh * getMesh(unsigned int a_index)
This method returns a pointer to a mesh primitive by passing its index number.
Definition: CMultiMesh.cpp:1292
virtual void setStiffness(const double a_stiffness, const bool a_affectChildren=false)
This method sets the haptic stiffness of the object, optionally recursively affecting children...
Definition: CMultiMesh.cpp:228
cVector3d getVertexPos(unsigned int a_index)
This method returns the position data of specific vertex.
Definition: CMultiMesh.cpp:1418
This class implements a base class for all 2D or 3D objects in CHAI3D.
Definition: CGenericObject.h:112
virtual void scale(const double &a_scaleFactor, const bool a_affectChildren=true)
This method scales this object by a_scaleFactor (uniform scale).
Definition: CMultiMesh.cpp:1038
std::vector< cMesh * > * m_meshes
Array of meshes.
Definition: CMultiMesh.h:453
This class implements a collision detection recorder that stores all collision events that are report...
Definition: CCollisionBasics.h:185
void setNormalsLength(const double a_length)
This method set the length of normals for display purposes.
Definition: CMultiMesh.cpp:1884
void computeAllEdges(double a_angleThresholdDeg=40.0)
This method creates a list of edges by providing a threshold angle in degrees.
Definition: CMultiMesh.cpp:1779
int getNumMeshes()
This method retrieves the number of meshes that compose this multi-mesh object.
Definition: CMultiMesh.cpp:1276
void setNormalsProperties(const double a_length, const cColorf &a_color)
This method sets the graphic properties for normal-rendering.
Definition: CMultiMesh.cpp:1866
virtual void updateBoundaryBox()
This method updates the boundary box of this object.
Definition: CMultiMesh.cpp:720
This structure stores the collision settings that are passed to a collision detector when querying fo...
Definition: CCollisionBasics.h:242
virtual void setEnabled(bool a_enabled, const bool a_affectChildren=false)
This method enables or disables this object. When an object is disabled, both haptic and graphic rend...
Definition: CMultiMesh.cpp:178
void setEdgeLineWidth(const double a_width)
This method sets the line width of all edges.
Definition: CMultiMesh.cpp:1759
This class models material properties.
Definition: CMaterial.h:100
virtual void setShowCollisionDetector(const bool a_showCollisionDetector, const bool a_affectChildren=false)
This method enables or disables the display of the collision detector, optionally propagating the cha...
Definition: CMultiMesh.cpp:980
This class implements a 3D polygonal mesh.
Definition: CMesh.h:108
virtual bool computeCollisionDetection(const cVector3d &a_segmentPointA, const cVector3d &a_segmentPointB, cCollisionRecorder &a_recorder, cCollisionSettings &a_settings)
This method computes any collision between a segment and this object.
Definition: CMultiMesh.cpp:838
virtual void restoreMaterialColors(const bool a_affectChildren=false)
This method restores the material color properties of this object from a previous backup...
Definition: CMultiMesh.cpp:455
virtual void deleteCollisionDetector(const bool a_affectChildren=false)
This method deletes any existing collision detector.
Definition: CMultiMesh.cpp:805
virtual void setShowEnabled(const bool a_show, const bool a_affectChildren=false)
This method enables or disables the graphic display of this object, optionally propagating the change...
Definition: CMultiMesh.cpp:278
This class defines a color using a GLfloat representation for each component.
Definition: CColor.h:138
virtual void setMaterial(cMaterialPtr a_material, const bool a_affectChildren=false)
This method sets the material properties of this object, optionally propagating the operation to its ...
Definition: CMultiMesh.cpp:556
virtual void render(cRenderOptions &a_options)
This method renders this object graphically using OpenGL.
Definition: CMultiMesh.cpp:1950
void setVertexColor(const cColorf &a_color)
This method sets the color of each vertex.
Definition: CMultiMesh.cpp:1831
This class stores a list of interaction events.
Definition: CInteractionBasics.h:133
std::shared_ptr< cShaderProgram > cShaderProgramPtr
Definition: CShaderProgram.h:70
cMultiMesh()
Constructor of cMultiMesh.
Definition: CMultiMesh.cpp:71
bool getVertex(const unsigned int a_index, cMesh *&a_mesh, unsigned int &a_vertexIndex)
This method returns the index number and mesh of a specific vertex that is part of this multi-mesh...
Definition: CMultiMesh.cpp:1356
bool deleteMesh(cMesh *a_mesh)
This method deletes a mesh primitive from the list of meshes.
Definition: CMultiMesh.cpp:1221
unsigned int getNumVertices() const
This method returns the the number of stored vertices.
Definition: CMultiMesh.cpp:1456
cMesh * newMesh()
This method creates a new mesh primitive.
Definition: CMultiMesh.cpp:1114
Definition: CAudioBuffer.cpp:56
virtual void setUseMaterial(const bool a_useMaterial, const bool a_affectChildren=true)
This method enables or disables the use of material properties, optionally propagating the operation ...
Definition: CMultiMesh.cpp:527
void clearAllEdges()
This method clears all edges.
Definition: CMultiMesh.cpp:1794
virtual cMultiMesh * copy(const bool a_duplicateMaterialData=false, const bool a_duplicateTextureData=false, const bool a_duplicateMeshData=false, const bool a_buildCollisionDetector=true)
This method creates a copy of itself.
Definition: CMultiMesh.cpp:105
virtual void setShowBoundaryBox(const bool a_showBoundaryBox, const bool a_affectChildren=false)
This method enables or disabled the graphic display of the boundary box for this object, optionally propagating the change to its children.
Definition: CMultiMesh.cpp:699
void reverseAllNormals()
This method reverses all normals on this model.
Definition: CMultiMesh.cpp:1848
virtual void setUseDisplayList(const bool a_useDisplayList, const bool a_affectChildren=false)
This method enabled or disables the use of a display list for rendering, optionally propagating the o...
Definition: CMultiMesh.cpp:481
bool removeAllMesh()
This method removes all mesh primitives.
Definition: CMultiMesh.cpp:1194
void setShowEdges(const bool a_showEdges)
This method enables or disables the rendering of edges.
Definition: CMultiMesh.cpp:1722
void setShowNormals(const bool &a_showNormals)
This method enables or disables the rendering of vertex normals.
Definition: CMultiMesh.cpp:1901
virtual void setTransparencyLevel(const float a_level, const bool a_applyToVertices=false, const bool a_applyToTextures=false, const bool a_affectChildren=false)
This method sets the transparency level of the object.
Definition: CMultiMesh.cpp:332
void computeBTN()
This method computes the normal matrix vectors for all triangles.
Definition: CMultiMesh.cpp:1670
virtual bool saveToFile(std::string a_filename)
This method saves 3D object to a file.
Definition: CMultiMesh.cpp:1605
void setShowTriangles(const bool a_showTriangles)
This method enables or disables the rendering of triangles.
Definition: CMultiMesh.cpp:1705
bool getTriangle(const unsigned int a_index, cMesh *&a_mesh, unsigned int &a_triangleIndex)
This method returns the index number and mesh of a specific triangle that is part of this multi-mesh...
Definition: CMultiMesh.cpp:1315
virtual void setUseTransparency(const bool a_useTransparency, const bool a_affectChildren=false)
This method enables or disables transparency.
Definition: CMultiMesh.cpp:303