Description

Class defining a collision shape.

#include <ChCollisionShape.h>

Inheritance diagram for chrono::ChCollisionShape:
Collaboration diagram for chrono::ChCollisionShape:

Public Types

enum  Type {
  SPHERE, ELLIPSOID, BOX, CYLINDER,
  CYLSHELL, CONVEXHULL, TRIANGLEMESH, BARREL,
  POINT, SEGMENT, TRIANGLE, MESHTRIANGLE,
  CAPSULE, CONE, ROUNDEDBOX, ROUNDEDCYL,
  TETRAHEDRON, PATH2D, SEGMENT2D, ARC2D,
  UNKNOWN_SHAPE
}
 Supported collision shape types.
 

Public Member Functions

 ChCollisionShape (Type type=Type::UNKNOWN_SHAPE)
 
 ChCollisionShape (Type type, std::shared_ptr< ChContactMaterial > material)
 
Type GetType () const
 
std::shared_ptr< ChContactMaterialGetMaterial () const
 
ChContactMethod GetContactMethod () const
 
virtual ChAABB GetBoundingBox () const
 Get the shape bounding box. More...
 
void SetMutable (bool val)
 Set this collision shape as modifiable (default: false). More...
 
bool IsMutable () const
 Return true if the collision shape is marked as modifiable.
 
void SetParentShape (std::shared_ptr< ChCollisionShape > parent)
 Set the parent shape. More...
 
ChCollisionShapeGetParentShape () const
 Get the parent shape. More...
 
virtual void ArchiveOut (ChArchiveOut &archive_out)
 Method to allow serialization of transient data to archives.
 
virtual void ArchiveIn (ChArchiveIn &archive_in)
 Method to allow de-serialization of transient data from archives.
 

Protected Attributes

Type m_type
 type of collision shape
 
bool is_mutable = false
 flag indicating whether the shape is rigid or deformable
 
std::shared_ptr< ChContactMaterialm_material = nullptr
 surface contact material
 
ChCollisionShapem_parent = nullptr
 parent collision shape (if part of compound)
 

Friends

class ChCollisionModel
 

Member Function Documentation

◆ GetBoundingBox()

◆ GetParentShape()

ChCollisionShape* chrono::ChCollisionShape::GetParentShape ( ) const
inline

Get the parent shape.

Returns nullptr is this collision shape is not part of a compound.

◆ SetMutable()

void chrono::ChCollisionShape::SetMutable ( bool  val)
inline

Set this collision shape as modifiable (default: false).

Set to true to indicate that the asset may change and therefore requires updates (e.g. for a deformable triangular mesh). Note that this also includes changes in materials. A collision system may take advantage of this setting to accelerate rendering.

◆ SetParentShape()

void chrono::ChCollisionShape::SetParentShape ( std::shared_ptr< ChCollisionShape parent)

Set the parent shape.

This is meaningful only for collision shapes that are part of a compound (for example, a ChCollisionShapeMeshTriangle which is part of a ChCollisionShapeTriangleMesh). For collision shapes that are not part of a compound, the parent shape should be left at its default nullptr value.


The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono/collision/ChCollisionShape.h
  • /builds/uwsbel/chrono/src/chrono/collision/ChCollisionShape.cpp