|
AGX Dynamics 2.41.2.0
|
Base class for a shape. More...
#include <Shape.h>
Inheritance diagram for agxCollide::Shape:Public Types | |
| enum | Type { GROUP , BOX , CAPSULE , CYLINDER , LINE , PLANE , SPHERE , TRIMESH , HEIGHT_FIELD , CONVEX , WIRE_SHAPE , CONE , HOLLOW_CONE , HOLLOW_CYLINDER , NUM_TYPES } |
| Define the type of a Shape. More... | |
Public Member Functions | |
| ShapeGroup * | asGroup () |
| Auto-cast shape to group. | |
| const ShapeGroup * | asGroup () const |
| Auto-cast shape to group. | |
| virtual agx::Real | calculateBoundingRadius (BoundingAABB &localAABB) const |
Calculate the bounding volume (AABB) into localAABB and calculate the bounding radius based on the new AABB size. | |
| virtual agx::SPDMatrix3x3 | calculateInertia (agx::Real mass) const =0 |
| Calculate the inertia for the shape given a mass. | |
| virtual BoundingAABB | calculateLocalBound () const =0 |
| Calculate the bounding volume in the local coordinate system. | |
| virtual Shape * | clone () const |
| Create a clone. | |
| const BoundingAABB & | getBoundingVolume () const |
| virtual agx::Vec3 | getCenter () const |
| agx::Physics::Geometry::ShapePtr | getEntity () const |
| Geometry * | getGeometry () |
| const Geometry * | getGeometry () const |
| agx::AffineMatrix4x4 | getLocalTransform () const |
| agx::UInt32 | getModifiedCount () const |
| agxCollide::RenderData * | getRenderData () |
| const agxCollide::RenderData * | getRenderData () const |
| If this is a ShapeGroup, then this method will return nullptr as the render data is stored in the actual children (Box, Mesh etc. | |
| virtual agx::Vec3 | getSupportPoint (const agx::Vec3 &supportDirection) const |
| Returns the support point on face of the shape. | |
| agx::AffineMatrix4x4 | getTransform () const |
| agx::UInt8 | getType () const |
| const char * | getTypeName () const |
| virtual agx::Real | getVolume () const =0 |
| Return the volume of the shape. | |
| virtual bool | hasSupportFunction () const |
| bool | isGroup () const |
| virtual void | propagateTransform (const agx::AffineMatrix4x4 &transform) |
| virtual void | setRenderData (agxCollide::RenderData *renderData) |
| Store render data with the Shape. | |
| virtual const BoundingAABB & | updateBoundingVolume ()=0 |
| Calculate the bounding volume based on the current Shape parameters including transformation. | |
Public Member Functions inherited from agx::Referenced | |
| Referenced () | |
| Default constructor. | |
| Referenced (const Referenced &) | |
| template<typename T > | |
| T * | as () |
| Subclass casting. | |
| template<typename T > | |
| const T * | as () const |
| template<typename T > | |
| T * | asSafe () |
| Safe subclass casting, return nullptr if template type does not match. | |
| template<typename T > | |
| const T * | asSafe () const |
| int | getReferenceCount () const |
| template<typename T > | |
| bool | is () const |
| Subclass test. | |
| Referenced & | operator= (const Referenced &) |
| Assignment operator. Will increment the number of references to the referenced object. | |
| void | reference (void *ptr=nullptr) const |
| Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. | |
| void | unreference (void *ptr=nullptr) const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. | |
| void | unreference_nodelete () const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. | |
Public Member Functions inherited from agxStream::Serializable | |
| virtual | ~Serializable () |
| Destructor for normal C++ use but hidden from SWIG bindings. | |
| virtual const char * | getClassName () const |
| bool | getEnableSerialization () const |
| bool | getEnableUuidGeneration () |
| agx::UInt32 | getIndex () const |
| This index is given at creation of this object. | |
| virtual StorageAgent * | getStorageAgent () const =0 |
| agx::Uuid | getUuid () const |
| bool | isFinished () const |
| void | setEnableSerialization (bool flag) |
| Set to false to disable serialization of this object. | |
| void | setFinished () |
| Tells this class that it is restored correctly and should not be deleted during destruction of an Archive. | |
| void | setUuid (const agx::Uuid &uuid) |
| Explicitly set a Uuid on a serializable object. | |
Static Public Member Functions | |
| static BoundingAABB | calculateBound (const agx::AffineMatrix4x4 &transform, const BoundingAABB &localBound) |
| static const char * | getTypeName (agx::UInt8 type) |
Static Public Member Functions inherited from agx::Referenced | |
| template<typename T > | |
| static bool | ValidateCast (const Referenced *object) |
Static Public Member Functions inherited from agxStream::Serializable | |
| static void | setEnableUuidGeneration (bool flag) |
| Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled. | |
Protected Member Functions | |
| Shape (Type type, agx::Physics::Geometry::ShapePtr entity=agx::Physics::Geometry::ShapeModel::createInstance()) | |
| Constructor. | |
| virtual | ~Shape () |
| Destructor. | |
| agx::UInt32 | incrementModifiedCount () |
| Increment the number of times the shape have been modified. | |
| void | syncronizeShapeIndex () |
Protected Member Functions inherited from agx::Referenced | |
| virtual | ~Referenced () |
| Destructor. | |
| void | allocateObserverVector () const |
| void | deleteUsingDeleteHandler () const |
Protected Member Functions inherited from agxStream::Serializable | |
| Serializable () | |
| Default constructor. | |
| Serializable (const Serializable &other) | |
| Copy constructor. | |
| void | generateUuid () |
Protected Attributes | |
| agx::Physics::Geometry::ShapeRef | m_entity |
| Geometry * | m_geometry |
| agx::ref_ptr< agx::Referenced > | m_internalData |
| ShapeGroup * | m_parent |
| agxCollide::RenderDataRef | m_renderData |
| agx::Index | m_shapeIndex |
Protected Attributes inherited from agx::Referenced | |
| Mutex | m_mutex |
| ObserverContainer | m_observers |
| AtomicValue | m_refCount |
Additional Inherited Members | |
Static Protected Member Functions inherited from agx::Referenced | |
| static DeleteHandler * | getDeleteHandler () |
| static void | setDeleteHandler (DeleteHandler *handler) |
| Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. | |
|
protected |
Constructor.
| type | - Type of the Shape |
| entity | - pointer to an entity. By default a new instance is created. |
|
protectedvirtual |
Destructor.
| ShapeGroup * agxCollide::Shape::asGroup | ( | ) |
| const ShapeGroup * agxCollide::Shape::asGroup | ( | ) | const |
|
static |
|
virtual |
Calculate the bounding volume (AABB) into localAABB and calculate the bounding radius based on the new AABB size.
Reimplemented in agxCollide::Sphere.
|
pure virtual |
Calculate the inertia for the shape given a mass.
Implemented in agxCollide::Box, agxCollide::Capsule, agxCollide::Cone, agxCollide::Cylinder, agxCollide::HollowCone, agxCollide::HollowCylinder, agxCollide::Line, agxCollide::Mesh, agxCollide::Plane, and agxCollide::Sphere.
|
pure virtual |
Calculate the bounding volume in the local coordinate system.
Implemented in agxCollide::Box, agxCollide::Capsule, agxCollide::Cone, agxCollide::Cylinder, agxCollide::HollowCone, agxCollide::HollowCylinder, agxCollide::Line, agxCollide::Mesh, agxCollide::Plane, agxCollide::Sphere, and agxCollide::WireShape.
|
virtual |
Create a clone.
Reimplemented in agxCollide::Box, agxCollide::Capsule, agxCollide::Cone, agxCollide::Convex, agxCollide::Cylinder, agxCollide::HeightField, agxCollide::HollowCone, agxCollide::HollowCylinder, agxCollide::Plane, agxCollide::Sphere, and agxCollide::Trimesh.
| const BoundingAABB & agxCollide::Shape::getBoundingVolume | ( | ) | const |
|
inlinevirtual |
Reimplemented in agxCollide::Cone, agxCollide::HollowCone, and agxCollide::Mesh.
|
inline |
| Geometry * agxCollide::Shape::getGeometry | ( | ) |
| const Geometry * agxCollide::Shape::getGeometry | ( | ) | const |
| agx::AffineMatrix4x4 agxCollide::Shape::getLocalTransform | ( | ) | const |
| agx::UInt32 agxCollide::Shape::getModifiedCount | ( | ) | const |
| agxCollide::RenderData * agxCollide::Shape::getRenderData | ( | ) |
| const agxCollide::RenderData * agxCollide::Shape::getRenderData | ( | ) | const |
|
inlinevirtual |
Returns the support point on face of the shape.
| supportDirection | - Direction in shape coords where to find a support point |
Reimplemented in agxCollide::Box, agxCollide::Capsule, agxCollide::Cone, agxCollide::Convex, agxCollide::Cylinder, agxCollide::HollowCone, agxCollide::HollowCylinder, agxCollide::Line, and agxCollide::Sphere.
| agx::AffineMatrix4x4 agxCollide::Shape::getTransform | ( | ) | const |
| agx::UInt8 agxCollide::Shape::getType | ( | ) | const |
Definition at line 396 of file Shape.h.
Referenced by agxCollide::ColliderTable::getCollider().
| const char * agxCollide::Shape::getTypeName | ( | ) | const |
|
static |
type
|
pure virtual |
Return the volume of the shape.
Implemented in agxCollide::Box, agxCollide::Capsule, agxCollide::Cone, agxCollide::Cylinder, agxCollide::HollowCone, agxCollide::HollowCylinder, agxCollide::Line, agxCollide::Mesh, agxCollide::Plane, and agxCollide::Sphere.
|
inlinevirtual |
Reimplemented in agxCollide::Box, agxCollide::Capsule, agxCollide::Cone, agxCollide::Convex, agxCollide::Cylinder, agxCollide::HollowCone, agxCollide::HollowCylinder, agxCollide::Line, and agxCollide::Sphere.
Definition at line 512 of file Shape.h.
Referenced by agxCollide::FallbackConvexCollider< ShapeType1, ShapeType2 >::_calculateContacts().
|
protected |
Increment the number of times the shape have been modified.
Definition at line 478 of file Shape.h.
Referenced by agxCollide::Mesh::setBottomMargin().
| bool agxCollide::Shape::isGroup | ( | ) | const |
|
virtual |
|
virtual |
Store render data with the Shape.
If the shape is a Group, the render data will be stored in all the children and NOT in the actual ShapeGroup. It is better to actually access the actual primitives and store the render data there instead of the group.
|
protected |
|
pure virtual |
Calculate the bounding volume based on the current Shape parameters including transformation.
Implemented in agxCollide::Box, agxCollide::Capsule, agxCollide::Cone, agxCollide::Cylinder, agxCollide::HollowCone, agxCollide::HollowCylinder, agxCollide::Line, agxCollide::Mesh, agxCollide::Plane, agxCollide::Sphere, and agxCollide::WireShape.
|
protected |
Definition at line 282 of file Shape.h.
Referenced by agxCollide::Line::getEntity(), agxCollide::Plane::getEntity(), and agxCollide::WireShape::getEntity().
|
protected |
|
protected |
|
protected |
|
protected |