AGX Dynamics 2.41.3.0
Loading...
Searching...
No Matches
agxSDK::MergeSplitUtils Namespace Reference

Classes

struct  ExternalForceSplitResult
 
class  WireSegmentMergedState
 Wire merged state segment along a wire. More...
 

Typedefs

template<typename T >
using CollectConnectingEdgesPtrContainer = agx::Vector< T * >
 
using WireSegmentMergedStateContainer = agx::VectorPOD< WireSegmentMergedState >
 

Functions

AGXPHYSICS_EXPORT agxSDK::MergedBodySolverData::ForceFrame calculateContactForceFrame (const agx::RigidBody *refRb, const agx::MergedBody::GeometryContactEdgeInteraction *contactEdge, const MergeSplitHandler *handler=nullptr)
 Calculates force frame (edge strength) given reference rigid body, contact edge and optionally an merge split handler (to use contact thresholds).
 
agx::Real calculateImpactSpeed (const agx::Vec3 &point, const agx::Vec3f &normal, const agx::Vec3 &cmPos, const agx::Vec3 &linVel, const agx::Vec3 &angVel)
 Calculates impact speed of one body given contact point and normal.
 
agx::Real calculateImpactSpeed (const agx::Vec3 &point, const agx::Vec3f &normal, const agx::Vec3 &relVel, const agx::Vec3 &cmPos1, const agx::Vec3 &angVel1, const agx::Vec3 &cmPos2, const agx::Vec3 &angVel2)
 Calculates impact speed of two rigid bodies given contact point and normal.
 
agx::Vec3 calculateRelativePointVelocity (const agx::Vec3 &point, const agx::Vec3 &cmPos, const agx::Vec3 &linVel, const agx::Vec3 &angVel)
 Calculates velocity at a given point given center of mass position, linear- and angular velocity.
 
agx::Vec3 calculateRelativePointVelocity (const agx::Vec3 &point, const agx::Vec3 &relVel, const agx::Vec3 &cmPos1, const agx::Vec3 &angVel1, const agx::Vec3 &cmPos2, const agx::Vec3 &angVel2)
 Calculates relative velocity at a point relative to two bodies.
 
template<typename T >
void collectConnectingEdges (const T &referenceEdge, agx::MergedBody::EdgeInteraction::InteractionTag edgeTag, agx::Bool bounceAtNonSplittableBodies, const agx::MergedBody &mergedBody, const MergeSplitHandler &handler, CollectConnectingEdgesPtrContainer< T > &result)
 Collects edges of given type/tag that are connected within a merged body.
 
AGXPHYSICS_EXPORT ExternalForceSplitResult shouldSplitGivenExternalForce (agxSDK::MergedBodySolverData::ForceFrame edgeStrength, const agx::RigidBody *rb, const agx::RigidBody *otherRb, const agx::Vec3 &externalForces, const agx::Vec3 &externalTorques, const agx::Vec3 &gravity, const agxSDK::MergeSplitHandler &handler)
 Checks if two bodies should split given edge strength force frame and external forces.
 

Typedef Documentation

◆ CollectConnectingEdgesPtrContainer

Definition at line 181 of file MergeSplitUtils.h.

◆ WireSegmentMergedStateContainer

Function Documentation

◆ calculateContactForceFrame()

AGXPHYSICS_EXPORT agxSDK::MergedBodySolverData::ForceFrame agxSDK::MergeSplitUtils::calculateContactForceFrame ( const agx::RigidBody refRb,
const agx::MergedBody::GeometryContactEdgeInteraction contactEdge,
const MergeSplitHandler handler = nullptr 
)

Calculates force frame (edge strength) given reference rigid body, contact edge and optionally an merge split handler (to use contact thresholds).

Parameters
refRb- reference rigid body
contactEdge- geometry contact edge
handler- if given, any suitable contact threshold will be used, otherwise default
Returns
edge strength force frame

◆ calculateImpactSpeed() [1/2]

agx::Real agxSDK::MergeSplitUtils::calculateImpactSpeed ( const agx::Vec3 point,
const agx::Vec3f normal,
const agx::Vec3 cmPos,
const agx::Vec3 linVel,
const agx::Vec3 angVel 
)

Calculates impact speed of one body given contact point and normal.

Parameters
point- contact point in world
normal- contact normal in world
cmPos- center of mass position of the body
linVel- linear velocity of the body
angVel- angular velocity of the body
Returns
impact speed, > 0 if approaching

Definition at line 89 of file MergeSplitUtils.h.

References calculateRelativePointVelocity().

◆ calculateImpactSpeed() [2/2]

agx::Real agxSDK::MergeSplitUtils::calculateImpactSpeed ( const agx::Vec3 point,
const agx::Vec3f normal,
const agx::Vec3 relVel,
const agx::Vec3 cmPos1,
const agx::Vec3 angVel1,
const agx::Vec3 cmPos2,
const agx::Vec3 angVel2 
)

Calculates impact speed of two rigid bodies given contact point and normal.

Parameters
point- contact point in world
normal- contact normal in world
relVel- relative velocity, rb1.velocity - rb2.velocity
cmPos1- center of mass position of the body 1
angVel1- angular velocity of the body 1
cmPos2- center of mass position of the body 2
angVel2- angular velocity of the body 2
Returns
impact speed, > 0 if approaching

Definition at line 129 of file MergeSplitUtils.h.

References calculateRelativePointVelocity().

◆ calculateRelativePointVelocity() [1/2]

agx::Vec3 agxSDK::MergeSplitUtils::calculateRelativePointVelocity ( const agx::Vec3 point,
const agx::Vec3 cmPos,
const agx::Vec3 linVel,
const agx::Vec3 angVel 
)

Calculates velocity at a given point given center of mass position, linear- and angular velocity.

Parameters
point- point in world
cmPos- center of mass position
linVel- linear velocity
angVel- angular velocity
Returns
velocity at given point

Definition at line 71 of file MergeSplitUtils.h.

Referenced by calculateImpactSpeed().

◆ calculateRelativePointVelocity() [2/2]

agx::Vec3 agxSDK::MergeSplitUtils::calculateRelativePointVelocity ( const agx::Vec3 point,
const agx::Vec3 relVel,
const agx::Vec3 cmPos1,
const agx::Vec3 angVel1,
const agx::Vec3 cmPos2,
const agx::Vec3 angVel2 
)

Calculates relative velocity at a point relative to two bodies.

Parameters
point- point in world
relVel- relative velocity, rb1.velocity - rb2.velocity
cmPos1- center of mass position of the body 1
angVel1- angular velocity of the body 1
cmPos2- center of mass position of the body 2
angVel2- angular velocity of the body 2
Returns
the relative velcoty at the given point

Definition at line 108 of file MergeSplitUtils.h.

◆ collectConnectingEdges()

template<typename T >
void agxSDK::MergeSplitUtils::collectConnectingEdges ( const T &  referenceEdge,
agx::MergedBody::EdgeInteraction::InteractionTag  edgeTag,
agx::Bool  bounceAtNonSplittableBodies,
const agx::MergedBody mergedBody,
const MergeSplitHandler handler,
CollectConnectingEdgesPtrContainer< T > &  result 
)

Collects edges of given type/tag that are connected within a merged body.

Parameters
referenceEdge- reference edge (starting point is referenceEdge.getRigidBody1())
edgeTag- edge tag matching T
bounceAtNonSplittableBodies- stop search at bodies that can't split? Example: 10 cranes on a non-splittable ship parent where referenceEdge is a prismatic in one of the cranes. With bounceAtNonSplittableBodies = true, the result will only contain edges from the crane with the prismatic, but with bounceAtNonSplittableBodies = false all 10 cranes will be included.
mergedBody- merged body with the referenceEdge
handler- the merge split handler
[out]result- result with connected edges of the given type/tag

Definition at line 198 of file MergeSplitUtils.h.

References agxAssert, agx::Vector< T, Allocator >::contains(), agx::MergedBody::getEdges(), agx::MergedBody::getNeighbors(), agxSDK::MergeSplitHandler::maySplit(), and agx::Vector< T, Allocator >::push_back().

◆ shouldSplitGivenExternalForce()

AGXPHYSICS_EXPORT ExternalForceSplitResult agxSDK::MergeSplitUtils::shouldSplitGivenExternalForce ( agxSDK::MergedBodySolverData::ForceFrame  edgeStrength,
const agx::RigidBody rb,
const agx::RigidBody otherRb,
const agx::Vec3 externalForces,
const agx::Vec3 externalTorques,
const agx::Vec3 gravity,
const agxSDK::MergeSplitHandler handler 
)

Checks if two bodies should split given edge strength force frame and external forces.

Parameters
edgeStrength- force frame describing the strength of the connection between rb and otherRb
rb- first rigid body
otherRb- other rigid body
externalForces- external forces (which could result in the split) - any gravity force should be included here
externalTorques- external torques (not used)
gravity- gravity acceleration used to estimate rbTop and rbBottom
handler- merge split handler with thresholds
Returns
split result