AGX Dynamics 2.41.1.2
Loading...
Searching...
No Matches
agxCollide::Geometry Class Reference

The geometry representation used by the collision detection engine. More...

#include <Geometry.h>

+ Inheritance diagram for agxCollide::Geometry:

Public Types

typedef CollisionGroupManager::GroupIdHash GroupSet
 Deprecated: Only for backward compatibility.
 
typedef agx::Event1< Geometry * > ShapeChangeEvent
 

Public Member Functions

 Geometry (const agx::Name &name="")
 Constructor.
 
 Geometry (Shape *shape)
 Constructor.
 
 Geometry (Shape *shape, const agx::AffineMatrix4x4 &localShapeTransform)
 Constructor.
 
bool add (Shape *shape, const agx::AffineMatrix4x4 &localTransform=agx::AffineMatrix4x4())
 Add a shape to the geometry.
 
void addGroup (agx::UInt32 id, bool forceContactUpdate=false)
 Add the specified id to a vector of group id, this will make a geometry part of the group id.
 
void addGroup (const agx::Name &name, bool forceContactUpdate=false)
 Add the specified name to a vector of named group id, this will make a geometry part of the group name.
 
 AGXSTREAM_DECLARE_SERIALIZABLE_BASE (agxCollide::Geometry)
 
agx::Vec3 calculateCenterOfMassOffset () const
 
agx::SPDMatrix3x3 calculateInertia (agx::Real mass) const
 
agx::Real calculateMass () const
 
virtual agx::Vec3f calculateSurfaceVelocity (const agxCollide::LocalContactPoint &point, size_t index) const
 Implement this method to get access to different surface velocities on the geometry:s surface.
 
agx::Real calculateVolume () const
 
bool canCollide (const Geometry *otherGeometry) const
 
Geometryclone (bool shallowCopyRenderData=false) const
 This method will make a deep copy of the geometry, excluding membership in any RigidBody.
 
void cloneShapeRenderData (agxCollide::Shape *target, bool shallowCopy) const
 Clone the shape render data from the geometry shape onto target shape.
 
agxCollide::GroupIdCollection findGroupIdCollection () const
 
virtual const BoundingAABBgetBoundingVolume () const
 The bounding volume for the geometry is made large enough to fit all shape bounds.
 
agx::ReferencedgetCustomData ()
 
const agx::ReferencedgetCustomData () const
 
bool getEnable () const
 Return whether the geometry should be used in intersection tests.
 
bool getEnableCollisions () const
 
bool getEnableCollisions (const Geometry *otherGeometry) const
 This method is only based on what is set using setEnableCollisions().
 
bool getEnableMassProperties () const
 
agx::Physics::GeometryPtr getEntity () const
 
agx::FramegetFrame ()
 
const agx::FramegetFrame () const
 
const GroupSetgetGroupIDs () const
 
const agx::Physics::CollisionGroupSetPtrgetGroupSet () const
 
agx::Int64 getId () const
 
agx::Vec3 getLocalPosition () const
 
agx::Quat getLocalRotation () const
 
const agx::AffineMatrix4x4getLocalTransform () const
 
agx::MaterialgetMaterial ()
 
const agx::MaterialgetMaterial () const
 
const agx::NamegetName () const
 Get the name.
 
agx::FramegetParentFrame ()
 
const agx::FramegetParentFrame () const
 
agx::Vec3 getPosition () const
 
agx::PropertyContainergetPropertyContainer ()
 
const agx::PropertyContainergetPropertyContainer () const
 
agx::RigidBodygetRigidBody ()
 
const agx::RigidBodygetRigidBody () const
 
agx::Quat getRotation () const
 
const ShapeRefVectorgetShapes () const
 
SpacegetSpace ()
 
const SpacegetSpace () const
 
const agx::Vec3fgetSurfaceVelocity () const
 
agx::UInt32 getSweepAndPruneIndex () const
 
agx::AffineMatrix4x4 getTransform () const
 
bool hasGroup (agx::UInt32 id) const
 This is performing a linear search among the collision group id for this Geometry.
 
bool hasGroup (const agx::Name &name) const
 Searches for the named group name for this geometry and return true if it can be found.
 
bool hasPropertyContainer () const
 
bool isEnabled () const
 Alias for getEnable Return whether the geometry should be used in intersection tests.
 
bool isSensor () const
 Return true if geometry is a sensor.
 
bool isSensorGeneratingContactData () const
 
bool remove (Shape *shape)
 Remove a shape from the geometry.
 
bool remove (size_t index)
 Remove the i:th shape from the Geometry.
 
void removeAllGroups (bool forceContactUpdate=false)
 Remove all collision group ids.
 
void removeGroup (agx::UInt32 id, bool forceContactUpdate=false)
 Remove a collision group id from the vector of group ids.
 
void removeGroup (const agx::Name &name, bool forceContactUpdate=false)
 Remove a named collision group from the vector of named group ids.
 
void removeMaterial ()
 Remove the material from the geometry.
 
bool replace (Shape *oldShape, Shape *newShape, const agx::AffineMatrix4x4 &localTransform=agx::AffineMatrix4x4())
 
bool replace (size_t shapeIndex, Shape *newShape, const agx::AffineMatrix4x4 &localTransform=agx::AffineMatrix4x4())
 Replace a shape in the geometry.
 
bool replaceShapeTransform (Shape *shape, const agx::AffineMatrix4x4 &newTransform)
 Replace the shape transform for the specified shape.
 
bool replaceShapeTransform (size_t shapeIndex, const agx::AffineMatrix4x4 &newTransform)
 Replace the shape transform for the specified shapeIndex.
 
void setCustomData (agx::Referenced *data)
 Store a ref_ptr to a user custom data class, which must be inherited from Referenced.
 
void setEnable (bool flag)
 Enable/disable collision testing for geometry.
 
void setEnableCollisions (bool collide)
 Should this geometry collide with any other geometries.
 
void setEnableCollisions (const Geometry *otherGeometry, bool flag)
 Specify whether otherGeometry is allowed to collide with this geometry.
 
void setEnableMassProperties (bool enableMassProperties)
 If set to true, this geometry will be included in mass property computation when part of a rigid body.
 
void setGroupSet (agx::Physics::CollisionGroupSetPtr set)
 Set the collision group set of the geometry.
 
void setLocalPosition (agx::Real x, agx::Real y, agx::Real z)
 Set the position of the geometry relative to its frame's parent frame.
 
void setLocalPosition (const agx::Vec3 &p)
 Set the position of the geometry relative to its frame's parent frame.
 
void setLocalRotation (const agx::EulerAngles &e)
 Set the rotation of the geometry relative to its frame's parent frame.
 
void setLocalRotation (const agx::Quat &q)
 Set the rotation of the geometry relative to its frame's parent frame.
 
void setLocalTransform (const agx::AffineMatrix4x4 &matrix)
 Assign the local transformation matrix for this geometry, ignoring any eventual parent transformation.
 
void setMaterial (agx::Material *material)
 Set the material of the geometry.
 
void setName (const agx::Name &name)
 Set the name of this Geometry.
 
bool setParentFrame (agx::Frame *frame)
 Set the parent frame of this geometry's frame.
 
void setPosition (agx::Real x, agx::Real y, agx::Real z)
 Set the position of the frame in world coordinates.
 
void setPosition (const agx::Vec3 &p)
 Set the position of the frame in world coordinates.
 
void setPropertyContainer (agx::PropertyContainer *container)
 Give this a new PropertyContainer.
 
void setRotation (const agx::EulerAngles &e)
 Set the rotation of the geometry relative to world frame.
 
void setRotation (const agx::OrthoMatrix3x3 &m)
 Set the rotation of the geometry relative to world frame.
 
void setRotation (const agx::Quat &q)
 Set the rotation of the geometry relative to world frame.
 
void setSensor (bool flag, bool generateContactData=true)
 Sets if the geometry should be a sensor.
 
void setSurfaceVelocity (const agx::Vec3f &surfaceVelocity)
 Set the velocity of this geometry's surface in the geometry's local coordinate frame.
 
void setTransform (const agx::AffineMatrix4x4 &matrix)
 Set the transform of the geometry.
 
virtual void shapeUpdated ()
 
virtual void updateBoundingVolume ()
 
- 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.
 
Referencedoperator= (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 agxStream::Serializablecreate (agxStream::InputArchive &)
 
- 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.
 

Public Attributes

ShapeChangeEvent shapeChangeEvent
 

Protected Member Functions

virtual ~Geometry ()
 Destructor.
 
- 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 ()
 

Additional Inherited Members

- Static Protected Member Functions inherited from agx::Referenced
static DeleteHandlergetDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Detailed Description

The geometry representation used by the collision detection engine.

A geometry may be a composite of multiple shapes with local transformations.

Internal to the physics engine, the only geometry considered is that used for interference detection. Because of the namespace, there should be no collision with any other name.

Definition at line 91 of file Geometry.h.

Member Typedef Documentation

◆ GroupSet

Deprecated: Only for backward compatibility.

Definition at line 333 of file Geometry.h.

◆ ShapeChangeEvent

Constructor & Destructor Documentation

◆ Geometry() [1/3]

agxCollide::Geometry::Geometry ( const agx::Name name = "")

Constructor.

Parameters
name- name of the geometry

◆ Geometry() [2/3]

agxCollide::Geometry::Geometry ( Shape shape)

Constructor.

Parameters
shape- pointer to a shape that will be part of this Geometry

◆ Geometry() [3/3]

agxCollide::Geometry::Geometry ( Shape shape,
const agx::AffineMatrix4x4 localShapeTransform 
)

Constructor.

Parameters
shape- pointer to a shape that will be part of this Geometry
localShapeTransform- Transformation of the shape relative to the Geometry

◆ ~Geometry()

virtual agxCollide::Geometry::~Geometry ( )
protectedvirtual

Destructor.

Member Function Documentation

◆ add()

bool agxCollide::Geometry::add ( Shape shape,
const agx::AffineMatrix4x4 localTransform = agx::AffineMatrix4x4() 
)

Add a shape to the geometry.

Will create an implicit shape group if needed.

Parameters
shapeThe shape to add.
localTransformThe shape transformation in local geometry coordinates.
Returns
true if the shape was added. False if shape==null.

◆ addGroup() [1/2]

void agxCollide::Geometry::addGroup ( agx::UInt32  id,
bool  forceContactUpdate = false 
)

Add the specified id to a vector of group id, this will make a geometry part of the group id.

By default a geometry is not part of any group.

This can be used to partition the simulation where some groups cannot collide with other groups. Which groups can collide or not is determined by Space and can be set using the method agxCollide::Space::setEnablePair(id1,id2);

This does not remove current contacts. To do this, forceContactUpdate should be set to true. This can be an expensive operation, so if repeated many times and issues might occur, it could be better to do this manually using Space::enableForContacts and Space::disableForContacts.

◆ addGroup() [2/2]

void agxCollide::Geometry::addGroup ( const agx::Name name,
bool  forceContactUpdate = false 
)

Add the specified name to a vector of named group id, this will make a geometry part of the group name.

By default a geometry is not part of any group.

This can be used to partition the simulation where some groups cannot collide with other groups. Which groups can collide or not is determined by Space and can be set using the method agxCollide::Space::setEnablePair(name1,name2);

This does not remove current contacts. To do this, forceContactUpdate should be set to true. This can be an expensive operation, so if repeated many times and issues might occur, it could be better to do this manually using Space::enableForContacts and Space::disableForContacts.

◆ AGXSTREAM_DECLARE_SERIALIZABLE_BASE()

agxCollide::Geometry::AGXSTREAM_DECLARE_SERIALIZABLE_BASE ( agxCollide::Geometry  )

◆ calculateCenterOfMassOffset()

agx::Vec3 agxCollide::Geometry::calculateCenterOfMassOffset ( ) const
Note
: This will give wrong results if the geometry contains overlapping shapes.
Returns
The center of mass offset

◆ calculateInertia()

agx::SPDMatrix3x3 agxCollide::Geometry::calculateInertia ( agx::Real  mass) const
Note
: This will give wrong results if the geometry contains overlapping shapes.
Returns
The inertia tensor locally in center of mass.

◆ calculateMass()

agx::Real agxCollide::Geometry::calculateMass ( ) const
Note
: This will give wrong results if the geometry contains overlapping shapes.
Returns
The mass of the geometry.

◆ calculateSurfaceVelocity()

agx::Vec3f agxCollide::Geometry::calculateSurfaceVelocity ( const agxCollide::LocalContactPoint point,
size_t  index 
) const
virtual

Implement this method to get access to different surface velocities on the geometry:s surface.

One example would be to have a texture specifying a velocity field of the geometry

Parameters
point- ContactPoint in world coordinates that can be used to calculate the surface velocity.
index- Which geometry in the contact is this one? Valid values: 0 or 1. The normal in 'point' points in the direction that 0 has to move to leave the contact with 0.
Returns
the calculated velocity.

Reimplemented in agxModel::SurfaceVelocityConveyorBelt.

Definition at line 921 of file Geometry.h.

◆ calculateVolume()

agx::Real agxCollide::Geometry::calculateVolume ( ) const
Note
: This will give wrong results if the geometry contains overlapping shapes.
Returns
The volume of the geometry.

◆ canCollide()

bool agxCollide::Geometry::canCollide ( const Geometry otherGeometry) const
Returns
true if this geometry CAN collide with otherGeometry.

Following has to be true to make this method return true.

if they belong to a group pair that is not disabled g1 != g2. collisions for g1 is not disabled against g2 (g1->setEnableCollisions(g2, false) if they both have a body, that it is not the same body.

◆ clone()

Geometry * agxCollide::Geometry::clone ( bool  shallowCopyRenderData = false) const

This method will make a deep copy of the geometry, excluding membership in any RigidBody.

Returns
a deep copy of the geometry

◆ cloneShapeRenderData()

void agxCollide::Geometry::cloneShapeRenderData ( agxCollide::Shape target,
bool  shallowCopy 
) const

Clone the shape render data from the geometry shape onto target shape.

Note
- Used internally in the clone() method.

◆ create()

static agxStream::Serializable * agxCollide::Geometry::create ( agxStream::InputArchive )
inlinestatic

Definition at line 417 of file Geometry.h.

◆ findGroupIdCollection()

agxCollide::GroupIdCollection agxCollide::Geometry::findGroupIdCollection ( ) const
Returns
collection of group names and id's that has been added to this geometry

◆ getBoundingVolume()

const BoundingAABB * agxCollide::Geometry::getBoundingVolume ( ) const
virtual

The bounding volume for the geometry is made large enough to fit all shape bounds.

Definition at line 895 of file Geometry.h.

◆ getCustomData() [1/2]

agx::Referenced * agxCollide::Geometry::getCustomData ( )
Returns
a pointer to a user defined data inherited from agx::Referenced class

◆ getCustomData() [2/2]

const agx::Referenced * agxCollide::Geometry::getCustomData ( ) const
Returns
a const pointer to a user defined data inherited from agx::Referenced class

◆ getEnable()

bool agxCollide::Geometry::getEnable ( ) const

Return whether the geometry should be used in intersection tests.

This can be set using the setEnable() method.

Returns
true if the geometry is used in intersection tests, false if not.

Definition at line 871 of file Geometry.h.

◆ getEnableCollisions() [1/2]

bool agxCollide::Geometry::getEnableCollisions ( ) const
Returns
true if this geometry is allowed to collide with any other geometry

◆ getEnableCollisions() [2/2]

bool agxCollide::Geometry::getEnableCollisions ( const Geometry otherGeometry) const

This method is only based on what is set using setEnableCollisions().

Any collision settings set by collision groups will not be taken into account. If you want to know if two geometries can collide at all, use canCollide().

Returns
true if this geometry is allowed to collide with geometry according to geometry pairs.

◆ getEnableMassProperties()

bool agxCollide::Geometry::getEnableMassProperties ( ) const
Returns
true if this geometry should contribute to the massproperties of a rigidbody.

Definition at line 815 of file Geometry.h.

◆ getEntity()

agx::Physics::GeometryPtr agxCollide::Geometry::getEntity ( ) const
inline

Definition at line 786 of file Geometry.h.

◆ getFrame() [1/2]

agx::Frame * agxCollide::Geometry::getFrame ( )
Returns
the frame of the geometry.

Definition at line 885 of file Geometry.h.

◆ getFrame() [2/2]

const agx::Frame * agxCollide::Geometry::getFrame ( ) const
Returns
the frame of the geometry.

Definition at line 890 of file Geometry.h.

◆ getGroupIDs()

const GroupSet & agxCollide::Geometry::getGroupIDs ( ) const

◆ getGroupSet()

const agx::Physics::CollisionGroupSetPtr & agxCollide::Geometry::getGroupSet ( ) const
Returns
The current group set.

Definition at line 841 of file Geometry.h.

◆ getId()

agx::Int64 agxCollide::Geometry::getId ( ) const
Returns
The geometry id.

Definition at line 800 of file Geometry.h.

◆ getLocalPosition()

agx::Vec3 agxCollide::Geometry::getLocalPosition ( ) const
Returns
- the relative translate to the parent frame of the geometry's frame.

◆ getLocalRotation()

agx::Quat agxCollide::Geometry::getLocalRotation ( ) const
Returns
- the geometry's rotation relative to its frame's parent frame.

◆ getLocalTransform()

const agx::AffineMatrix4x4 & agxCollide::Geometry::getLocalTransform ( ) const
Returns
- the local transformation matrix of the geometry's frame, relative to the parent's frame.

◆ getMaterial() [1/2]

agx::Material * agxCollide::Geometry::getMaterial ( )
Returns
the material of the geometry.

Definition at line 856 of file Geometry.h.

◆ getMaterial() [2/2]

const agx::Material * agxCollide::Geometry::getMaterial ( ) const
Returns
the material of the geometry.

Definition at line 851 of file Geometry.h.

◆ getName()

const agx::Name & agxCollide::Geometry::getName ( ) const

Get the name.

Returns
the name string of this Geometry.

◆ getParentFrame() [1/2]

agx::Frame * agxCollide::Geometry::getParentFrame ( )
Returns
- the parent frame of the geometry's frame, or 0 if this frame has no parent

◆ getParentFrame() [2/2]

const agx::Frame * agxCollide::Geometry::getParentFrame ( ) const
Returns
- the parent frame of the geometry's frame, or 0 if this frame has no parent

◆ getPosition()

agx::Vec3 agxCollide::Geometry::getPosition ( ) const
Returns
the current position/translation of the geometry in world coordinate space

Definition at line 935 of file Geometry.h.

◆ getPropertyContainer() [1/2]

agx::PropertyContainer * agxCollide::Geometry::getPropertyContainer ( )
Returns
a pointer to the PropertyContainer

Definition at line 901 of file Geometry.h.

Referenced by agxSDK::PropertyFilter::match().

◆ getPropertyContainer() [2/2]

const agx::PropertyContainer * agxCollide::Geometry::getPropertyContainer ( ) const
Returns
a pointer to the PropertyContainer

Definition at line 913 of file Geometry.h.

◆ getRigidBody() [1/2]

◆ getRigidBody() [2/2]

const agx::RigidBody * agxCollide::Geometry::getRigidBody ( ) const
Returns
The body which the geometry is part of.

Definition at line 795 of file Geometry.h.

◆ getRotation()

agx::Quat agxCollide::Geometry::getRotation ( ) const
Returns
the current rotation of the geometry in world coordinate space

Definition at line 943 of file Geometry.h.

References agx::QuatT< T >::getRotate().

◆ getShapes()

const ShapeRefVector & agxCollide::Geometry::getShapes ( ) const

◆ getSpace() [1/2]

Space * agxCollide::Geometry::getSpace ( )
Returns
The space where the geometry is placed.

Definition at line 876 of file Geometry.h.

◆ getSpace() [2/2]

const Space * agxCollide::Geometry::getSpace ( ) const
Returns
The space where the geometry is placed.

Definition at line 880 of file Geometry.h.

◆ getSurfaceVelocity()

const agx::Vec3f & agxCollide::Geometry::getSurfaceVelocity ( ) const
Returns
the surface velocity of this geometry in geometry's local coordinate frame as stored by the method setSurfaceVelocity()

Definition at line 866 of file Geometry.h.

◆ getSweepAndPruneIndex()

agx::UInt32 agxCollide::Geometry::getSweepAndPruneIndex ( ) const

Definition at line 826 of file Geometry.h.

◆ getTransform()

agx::AffineMatrix4x4 agxCollide::Geometry::getTransform ( ) const
Returns
the current transformation of the geometry in world coordinate space

Definition at line 926 of file Geometry.h.

◆ hasGroup() [1/2]

bool agxCollide::Geometry::hasGroup ( agx::UInt32  id) const

This is performing a linear search among the collision group id for this Geometry.

Parameters
id- The group id we are looking for.
Returns
true if the Geometry is part of the group id

Definition at line 831 of file Geometry.h.

Referenced by agxSDK::CollisionGroupFilter::hasMemberGroup().

◆ hasGroup() [2/2]

bool agxCollide::Geometry::hasGroup ( const agx::Name name) const

Searches for the named group name for this geometry and return true if it can be found.

Parameters
name- The group id we are looking for.
Returns
true if the Geometry is part of the named group name

Definition at line 836 of file Geometry.h.

◆ hasPropertyContainer()

bool agxCollide::Geometry::hasPropertyContainer ( ) const
Returns
true if it has an initialized PropertyContainer

Definition at line 908 of file Geometry.h.

Referenced by agxSDK::PropertyFilter::match().

◆ isEnabled()

bool agxCollide::Geometry::isEnabled ( ) const

Alias for getEnable Return whether the geometry should be used in intersection tests.

This can be set using the setEnable() method.

Returns
true if the geometry is used in intersection tests, false if not.

Definition at line 805 of file Geometry.h.

Referenced by agxCollide::Space::reportOverlap().

◆ isSensor()

bool agxCollide::Geometry::isSensor ( ) const

Return true if geometry is a sensor.

Definition at line 810 of file Geometry.h.

◆ isSensorGeneratingContactData()

bool agxCollide::Geometry::isSensorGeneratingContactData ( ) const
inline
Returns
True if collision data will be omitted from contacts while this geometry is a sensor.
See also
setSensor

Definition at line 821 of file Geometry.h.

◆ remove() [1/2]

bool agxCollide::Geometry::remove ( Shape shape)

Remove a shape from the geometry.

Returns
true if shape was removed. False if shape == null or Geometry does not contain the shape

◆ remove() [2/2]

bool agxCollide::Geometry::remove ( size_t  index)

Remove the i:th shape from the Geometry.

Returns
true if shape was removed. False if shape == null or Geometry does not contain the shape

◆ removeAllGroups()

void agxCollide::Geometry::removeAllGroups ( bool  forceContactUpdate = false)

Remove all collision group ids.

Parameters
forceContactUpdate- Should current overlaps between disabled groups be found and create impacts.

◆ removeGroup() [1/2]

void agxCollide::Geometry::removeGroup ( agx::UInt32  id,
bool  forceContactUpdate = false 
)

Remove a collision group id from the vector of group ids.

Parameters
id- The group id to be removed
forceContactUpdate- Should current overlaps between disabled groups be found and create impacts.

◆ removeGroup() [2/2]

void agxCollide::Geometry::removeGroup ( const agx::Name name,
bool  forceContactUpdate = false 
)

Remove a named collision group from the vector of named group ids.

Parameters
name- The group id to be removed
forceContactUpdate- Should current overlaps between disabled groups be found and create impacts.

◆ removeMaterial()

void agxCollide::Geometry::removeMaterial ( )

Remove the material from the geometry.

◆ replace() [1/2]

bool agxCollide::Geometry::replace ( Shape oldShape,
Shape newShape,
const agx::AffineMatrix4x4 localTransform = agx::AffineMatrix4x4() 
)

◆ replace() [2/2]

bool agxCollide::Geometry::replace ( size_t  shapeIndex,
Shape newShape,
const agx::AffineMatrix4x4 localTransform = agx::AffineMatrix4x4() 
)

Replace a shape in the geometry.

◆ replaceShapeTransform() [1/2]

bool agxCollide::Geometry::replaceShapeTransform ( Shape shape,
const agx::AffineMatrix4x4 newTransform 
)

Replace the shape transform for the specified shape.

Parameters
shape- The shape for which the transform should be replaced.
newTransform- The new transform
Returns
true if shape is valid.

◆ replaceShapeTransform() [2/2]

bool agxCollide::Geometry::replaceShapeTransform ( size_t  shapeIndex,
const agx::AffineMatrix4x4 newTransform 
)

Replace the shape transform for the specified shapeIndex.

Parameters
shapeIndex- Index of the transform that should be replaced. Valid values are 0..numShapes-1
newTransform- The new transform
Returns
true if shapeIndex is valid.

◆ setCustomData()

void agxCollide::Geometry::setCustomData ( agx::Referenced data)

Store a ref_ptr to a user custom data class, which must be inherited from Referenced.

◆ setEnable()

void agxCollide::Geometry::setEnable ( bool  flag)

Enable/disable collision testing for geometry.

A disabled geometry does not render in debug rendering or osg.

◆ setEnableCollisions() [1/2]

void agxCollide::Geometry::setEnableCollisions ( bool  collide)

Should this geometry collide with any other geometries.

Disabling this still means that it will be part of MassProperty calculations if it belongs to a rigid body.

Parameters
collide- If false this geometry will not generate any contacts with any other geometry

◆ setEnableCollisions() [2/2]

void agxCollide::Geometry::setEnableCollisions ( const Geometry otherGeometry,
bool  flag 
)

Specify whether otherGeometry is allowed to collide with this geometry.

◆ setEnableMassProperties()

void agxCollide::Geometry::setEnableMassProperties ( bool  enableMassProperties)

If set to true, this geometry will be included in mass property computation when part of a rigid body.

(default==true)

Note
This does not affect the returned data from calculateInertia, calculateMass etc.
Parameters
enableMassProperties- If true this geometry will contribute to mass properties for a rigid body

◆ setGroupSet()

void agxCollide::Geometry::setGroupSet ( agx::Physics::CollisionGroupSetPtr  set)

Set the collision group set of the geometry.

Parameters
set- the collision group set to set on the geometry.

Definition at line 846 of file Geometry.h.

◆ setLocalPosition() [1/2]

void agxCollide::Geometry::setLocalPosition ( agx::Real  x,
agx::Real  y,
agx::Real  z 
)

Set the position of the geometry relative to its frame's parent frame.

Parameters
x- local x translate
y- local y translate
z- local z translate

◆ setLocalPosition() [2/2]

void agxCollide::Geometry::setLocalPosition ( const agx::Vec3 p)

Set the position of the geometry relative to its frame's parent frame.

Parameters
p- local translate of geometry as a 3D vector

◆ setLocalRotation() [1/2]

void agxCollide::Geometry::setLocalRotation ( const agx::EulerAngles e)

Set the rotation of the geometry relative to its frame's parent frame.

Parameters
e- rotation given as Euler angles

◆ setLocalRotation() [2/2]

void agxCollide::Geometry::setLocalRotation ( const agx::Quat q)

Set the rotation of the geometry relative to its frame's parent frame.

Parameters
q- rotation given as a quaternion

◆ setLocalTransform()

void agxCollide::Geometry::setLocalTransform ( const agx::AffineMatrix4x4 matrix)

Assign the local transformation matrix for this geometry, ignoring any eventual parent transformation.

Parameters
matrix- transformation matrix relative to parent transform for the geometry's frame

◆ setMaterial()

void agxCollide::Geometry::setMaterial ( agx::Material material)

Set the material of the geometry.

◆ setName()

void agxCollide::Geometry::setName ( const agx::Name name)

Set the name of this Geometry.

◆ setParentFrame()

bool agxCollide::Geometry::setParentFrame ( agx::Frame frame)

Set the parent frame of this geometry's frame.

This means that getLocalTranslate, getLocalRotate, getLocalTransform will be given in the parents coordinate frame. I.e., this frame's transformation will be concatenated with the parents.

Parameters
frame- new parent frame, 0 to remove parent
Returns
true if parent is changed (not the same as before) - otherwise false

◆ setPosition() [1/2]

void agxCollide::Geometry::setPosition ( agx::Real  x,
agx::Real  y,
agx::Real  z 
)

Set the position of the frame in world coordinates.

Parameters
x- desired x-coordinate in world frame
y- desired y-coordinate in world frame
z- desired z-coordinate in world frame

◆ setPosition() [2/2]

void agxCollide::Geometry::setPosition ( const agx::Vec3 p)

Set the position of the frame in world coordinates.

Parameters
p- desired position in world coordinates.

◆ setPropertyContainer()

void agxCollide::Geometry::setPropertyContainer ( agx::PropertyContainer container)

Give this a new PropertyContainer.

Parameters
container- The new PropertyContainer of this instance.

◆ setRotation() [1/3]

void agxCollide::Geometry::setRotation ( const agx::EulerAngles e)

Set the rotation of the geometry relative to world frame.

Parameters
e- rotation given as Euler angles

◆ setRotation() [2/3]

void agxCollide::Geometry::setRotation ( const agx::OrthoMatrix3x3 m)

Set the rotation of the geometry relative to world frame.

Parameters
m- rotation given as an orthogonal transformation matrix

◆ setRotation() [3/3]

void agxCollide::Geometry::setRotation ( const agx::Quat q)

Set the rotation of the geometry relative to world frame.

Parameters
q- rotation given as a quaternion

◆ setSensor()

void agxCollide::Geometry::setSensor ( bool  flag,
bool  generateContactData = true 
)

Sets if the geometry should be a sensor.

Sensors are included in collision detection but the resulting contacts are not passed to the solver.

Contact data generation for sensors is disabled by passing false into generateContactData. GeometryContacts are still created, but they will contain no contact points. This flag has no effect while isSensor returns false. Support for disabling contact data generation is currently only supported for some shape type pairs. Other shape type pairs will continue to get full contact data.

Parameters
flag- True to make this Geometry a sensor.
generateContactData- True if contact data is to be generated, false otherwise. False only supported for some shape type pairs.

◆ setSurfaceVelocity()

void agxCollide::Geometry::setSurfaceVelocity ( const agx::Vec3f surfaceVelocity)

Set the velocity of this geometry's surface in the geometry's local coordinate frame.

If this velocity is non-zero the constraints will try to achieve the relative velocity between the objects (in the friction plane) to be the wanted surface velocity.

Parameters
surfaceVelocity- velocity given in geometry's local coordinate frame

Definition at line 861 of file Geometry.h.

◆ setTransform()

void agxCollide::Geometry::setTransform ( const agx::AffineMatrix4x4 matrix)

Set the transform of the geometry.

Its frame will move to the specified transform, which is given in world coordintaes.

Parameters
matrix- desired transform for the frame in world coordinates.

◆ shapeUpdated()

virtual void agxCollide::Geometry::shapeUpdated ( )
virtual

◆ updateBoundingVolume()

virtual void agxCollide::Geometry::updateBoundingVolume ( )
virtual

Member Data Documentation

◆ shapeChangeEvent

ShapeChangeEvent agxCollide::Geometry::shapeChangeEvent

Definition at line 95 of file Geometry.h.


The documentation for this class was generated from the following file: