AGX Dynamics 2.41.2.0
Loading...
Searching...
No Matches
agxModel::SurfaceVelocityConveyorBelt Class Reference

This class models a conveyor belt using surface velocity. More...

#include <SurfaceVelocityConveyorBelt.h>

+ Inheritance diagram for agxModel::SurfaceVelocityConveyorBelt:

Public Types

typedef agx::Vector< SurfaceVelocityConveyorBelt * > SurfaceVelocityConveyorBeltPtrVector
 
- Public Types inherited from agxCollide::Geometry
typedef CollisionGroupManager::GroupIdHash GroupSet
 Deprecated: Only for backward compatibility.
 
typedef agx::Event1< Geometry * > ShapeChangeEvent
 

Public Member Functions

 SurfaceVelocityConveyorBelt (const agx::Vec3Vector &points)
 Constructor, based on list of points.
 
 AGXSTREAM_DECLARE_SERIALIZABLE_BASE (agxModel::SurfaceVelocityConveyorBelt)
 
virtual agx::Vec3f calculateSurfaceVelocity (const agxCollide::LocalContactPoint &point, size_t index) const override
 Calculates the surface velocity based on the location of the contact point.
 
bool disableDebugRendering ()
 Disables the debug rendering.
 
bool enableDebugRendering (agxSDK::Simulation *sim)
 Enables debug rendering of conveyor belt.
 
bool getEnableDebugRendering () const
 Is debug rendering enabled?
 
const agx::Vec3VectorgetPoints () const
 Returns the vector of points.
 
agx::Real getSpeed () const
 Gets the speed of the conveyor belt. Negative speed is allowed and understood as the opposite direction.
 
const agx::Vec3VectorgetUnitDirs () const
 Returns the vector of unit-length directions from point to point.
 
void setSpeed (agx::Real speed)
 Sets the speed of the conveyor belt. Negative speed is allowed and understood as the opposite direction.
 
- Public Member Functions inherited from agxCollide::Geometry
 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 SurfaceVelocityConveyorBeltfind (agxSDK::Simulation *simulation, const agx::Name &name)
 This method will do a linear search in Simulation and return a pointer to the specified SurfaceVelocityConveyorBelt.
 
static SurfaceVelocityConveyorBeltfind (agxSDK::Simulation *simulation, const agx::Uuid &uuid)
 This method will do a linear search in Simulation and return a pointer to the specified SurfaceVelocityConveyorBelt.
 
static SurfaceVelocityConveyorBeltPtrVector findAll (agxSDK::Simulation *simulation, const agx::Name &name)
 This method will do a linear search in Simulation and return a vector with pointers to all matching SurfaceVelocityConveyorBelt's.
 
- Static Public Member Functions inherited from agxCollide::Geometry
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.
 

Protected Member Functions

 SurfaceVelocityConveyorBelt ()
 
virtual ~SurfaceVelocityConveyorBelt ()
 
- Protected Member Functions inherited from agxCollide::Geometry
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

- Public Attributes inherited from agxCollide::Geometry
ShapeChangeEvent shapeChangeEvent
 
- 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

This class models a conveyor belt using surface velocity.

Only the surface behavior of an ideal conveyor belt is modeled here, not inner elasticity, motor torque, ... agxCollide::Geometry's surface velocity has the limitation that it is only defined in one direction (relative to the geometry). SurfaceVelocityConveyorBelt extends this behavior by taking a vector of points which are supposed to represent connected line segments or a closed loop along the conveyor belt (e.g. the mid line). Surface velocity is adapted after each point, pointing to the next one. The last point does not automatically point to the first one - in order to get a closed loop, the first point has to be added at the end again explicitly.

SurfaceVelocityConveyorBelt inherits from agxCollide::Geometry and can be used instead of one.

Definition at line 58 of file SurfaceVelocityConveyorBelt.h.

Member Typedef Documentation

◆ SurfaceVelocityConveyorBeltPtrVector

Constructor & Destructor Documentation

◆ SurfaceVelocityConveyorBelt() [1/2]

agxModel::SurfaceVelocityConveyorBelt::SurfaceVelocityConveyorBelt ( const agx::Vec3Vector points)

Constructor, based on list of points.

The points are supposed to represent connected line segments or a closed loop along the conveyor belt (e.g. the mid line).

◆ ~SurfaceVelocityConveyorBelt()

virtual agxModel::SurfaceVelocityConveyorBelt::~SurfaceVelocityConveyorBelt ( )
protectedvirtual

◆ SurfaceVelocityConveyorBelt() [2/2]

agxModel::SurfaceVelocityConveyorBelt::SurfaceVelocityConveyorBelt ( )
protected

Member Function Documentation

◆ AGXSTREAM_DECLARE_SERIALIZABLE_BASE()

agxModel::SurfaceVelocityConveyorBelt::AGXSTREAM_DECLARE_SERIALIZABLE_BASE ( agxModel::SurfaceVelocityConveyorBelt  )

◆ calculateSurfaceVelocity()

virtual agx::Vec3f agxModel::SurfaceVelocityConveyorBelt::calculateSurfaceVelocity ( const agxCollide::LocalContactPoint point,
size_t  index 
) const
overridevirtual

Calculates the surface velocity based on the location of the contact point.

Inherited from agxCollide::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 from agxCollide::Geometry.

◆ create()

static agxStream::Serializable * agxModel::SurfaceVelocityConveyorBelt::create ( agxStream::InputArchive )
inlinestatic

Definition at line 144 of file SurfaceVelocityConveyorBelt.h.

◆ disableDebugRendering()

bool agxModel::SurfaceVelocityConveyorBelt::disableDebugRendering ( )

Disables the debug rendering.

Returns
Was disabling the debug rendering successful?

◆ enableDebugRendering()

bool agxModel::SurfaceVelocityConveyorBelt::enableDebugRendering ( agxSDK::Simulation sim)

Enables debug rendering of conveyor belt.

Comes at a computational cost (mainly due to special case rendering), recommended only for debugging. Will be updated each simulation step (so moving the conveyor belt while having a paused simulation will not update graphics; only the simulation step will update the graphics).

Parameters
simThe simulation that will trigger the graphics updates.
Returns
Was enabling the debug rendering successful?

◆ find() [1/2]

static SurfaceVelocityConveyorBelt * agxModel::SurfaceVelocityConveyorBelt::find ( agxSDK::Simulation simulation,
const agx::Name name 
)
static

This method will do a linear search in Simulation and return a pointer to the specified SurfaceVelocityConveyorBelt.

Parameters
simulation- The instance of the simulation in which we are searching
name- name of the SurfaceVelocityConveyorBelt we are searching for
Returns
pointer to the found SurfaceVelocityConveyorBelt or null if not found.

◆ find() [2/2]

static SurfaceVelocityConveyorBelt * agxModel::SurfaceVelocityConveyorBelt::find ( agxSDK::Simulation simulation,
const agx::Uuid uuid 
)
static

This method will do a linear search in Simulation and return a pointer to the specified SurfaceVelocityConveyorBelt.

Parameters
simulation- The instance of the simulation in which we are searching
uuid- uuid of the SurfaceVelocityConveyorBelt we are searching for
Returns
pointer to the found SurfaceVelocityConveyorBelt or null if not found.

◆ findAll()

static SurfaceVelocityConveyorBeltPtrVector agxModel::SurfaceVelocityConveyorBelt::findAll ( agxSDK::Simulation simulation,
const agx::Name name 
)
static

This method will do a linear search in Simulation and return a vector with pointers to all matching SurfaceVelocityConveyorBelt's.

Parameters
simulation- The instance of the simulation in which we are searching
name- name of the SurfaceVelocityConveyorBelt's we are searching for
Returns
vector containing pointers to all matching SurfaceVelocityConveyorBelt's or null if not found.

◆ getEnableDebugRendering()

bool agxModel::SurfaceVelocityConveyorBelt::getEnableDebugRendering ( ) const

Is debug rendering enabled?

◆ getPoints()

const agx::Vec3Vector & agxModel::SurfaceVelocityConveyorBelt::getPoints ( ) const

Returns the vector of points.

Assumed to be connected line segments or a closed loop along the conveyor belt (e.g. the mid line). Will not change during conveyor belt life time.

◆ getSpeed()

agx::Real agxModel::SurfaceVelocityConveyorBelt::getSpeed ( ) const

Gets the speed of the conveyor belt. Negative speed is allowed and understood as the opposite direction.

◆ getUnitDirs()

const agx::Vec3Vector & agxModel::SurfaceVelocityConveyorBelt::getUnitDirs ( ) const

Returns the vector of unit-length directions from point to point.

Size will be one less than size of getPoints() or zero. Assumed to point within connected line segments or a closed loop along the conveyor belt (e.g. the mid line). Will not change during conveyor belt life time.

◆ setSpeed()

void agxModel::SurfaceVelocityConveyorBelt::setSpeed ( agx::Real  speed)

Sets the speed of the conveyor belt. Negative speed is allowed and understood as the opposite direction.


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