AGX Dynamics  2.37.2.0
agxCollide::ElasticRestLengthCalculator Namespace Reference

Functions

agx::Real AGXPHYSICS_EXPORT calculateElasticRestLength (const agxCollide::Shape *shape, const agx::Vec3 &point, const agx::Vec3 &normal, const agx::Real depth)
 Computes elastic rest length for this shape, point and normal. More...
 
agx::Real AGXPHYSICS_EXPORT calculateElasticRestLength (const agxCollide::Sphere *sphere, const agx::Vec3 &point, const agx::Vec3 &normal, const agx::Real depth)
 Computes elastic rest length for this shape, point and normal. More...
 
agx::Real AGXPHYSICS_EXPORT calculateElasticRestLength (const agxCollide::Box *box, const agx::Vec3 &point, const agx::Vec3 &normal, const agx::Real depth)
 Computes elastic rest length for this shape, point and normal. More...
 
agx::Real AGXPHYSICS_EXPORT calculateElasticRestLength (const agxCollide::Capsule *capsule, const agx::Vec3 &point, const agx::Vec3 &normal, const agx::Real depth)
 Computes elastic rest length for this shape, point and normal. More...
 
agx::Real AGXPHYSICS_EXPORT calculateElasticRestLength (const agxCollide::Cylinder *cylinder, const agx::Vec3 &point, const agx::Vec3 &normal, const agx::Real depth)
 Computes elastic rest length for this shape, point and normal. More...
 
agx::Real AGXPHYSICS_EXPORT calculateElasticRestLength (const agxCollide::Mesh *mesh, const agx::Vec3 &point, const agx::Vec3 &normal, const agx::Real depth)
 Computes elastic rest length for this shape, point and normal. More...
 

Function Documentation

◆ calculateElasticRestLength() [1/6]

agx::Real AGXPHYSICS_EXPORT agxCollide::ElasticRestLengthCalculator::calculateElasticRestLength ( const agxCollide::Shape *  shape,
const agx::Vec3 &  point,
const agx::Vec3 &  normal,
const agx::Real  depth 
)

Computes elastic rest length for this shape, point and normal.

It is defined as the intersection length of a line (defined by the point and the normal) with the shape. Note that the intersection can be on the line's positive side, negative side, or both.

Parameters
shapeThe shape. Can have transformation. Should be a 'concrete' shape, not an agxCollide::Group.
pointA point in world coordinates. Used for anchoring the line. Assumed to have come from collision detection code.
normalA normal in world coordinates. Expected to have length 1. Used for giving direction to the line. Assumed to have come from collision detection code.
depthThe depth of the contact point. Only used for approximative calculations in mesh case.
Return values
Theelastic rest length, defined as the intersection length between line and shape.

◆ calculateElasticRestLength() [2/6]

agx::Real AGXPHYSICS_EXPORT agxCollide::ElasticRestLengthCalculator::calculateElasticRestLength ( const agxCollide::Sphere *  sphere,
const agx::Vec3 &  point,
const agx::Vec3 &  normal,
const agx::Real  depth 
)

Computes elastic rest length for this shape, point and normal.

It is defined as the intersection length of a line (defined by the point and the normal) with the shape. Note that the intersection can be on the line's positive side, negative side, or both. Note that for the sphere case, we will assume that the line of point and normal goes through the sphere's mid point, since all colliders involving spheres give us contact points like that.

Parameters
sphereThe shape. Can have transformation.
pointA point in world coordinates. Used for anchoring the line. Assumed to have come from collision detection code.
normalA normal in world coordinates. Expected to have length 1.
depthThe depth of the contact point. Only used for approximative calculations in mesh case. Used for giving direction to the line. Assumed to have come from collision detection code.
Return values
Theelastic rest length, defined as the intersection length between line and shape.

◆ calculateElasticRestLength() [3/6]

agx::Real AGXPHYSICS_EXPORT agxCollide::ElasticRestLengthCalculator::calculateElasticRestLength ( const agxCollide::Box *  box,
const agx::Vec3 &  point,
const agx::Vec3 &  normal,
const agx::Real  depth 
)

Computes elastic rest length for this shape, point and normal.

It is defined as the intersection length of a line (defined by the point and the normal) with the shape. Note that the intersection can be on the line's positive side, negative side, or both. Note that for the sphere case, we will assume that the line of point and normal goes through the sphere's mid point, since all colliders involving spheres give us contact points like that.

Parameters
boxThe shape. Can have transformation.
pointA point in world coordinates. Used for anchoring the line. Assumed to have come from collision detection code.
normalA normal in world coordinates. Expected to have length 1.
depthThe depth of the contact point. Only used for approximative calculations in mesh case. Used for giving direction to the line. Assumed to have come from collision detection code.
Return values
Theelastic rest length, defined as the intersection length between line and shape.

◆ calculateElasticRestLength() [4/6]

agx::Real AGXPHYSICS_EXPORT agxCollide::ElasticRestLengthCalculator::calculateElasticRestLength ( const agxCollide::Capsule *  capsule,
const agx::Vec3 &  point,
const agx::Vec3 &  normal,
const agx::Real  depth 
)

Computes elastic rest length for this shape, point and normal.

It is defined as the intersection length of a line (defined by the point and the normal) with the shape. Note that the intersection can be on the line's positive side, negative side, or both. Note that for the sphere case, we will assume that the line of point and normal goes through the sphere's mid point, since all colliders involving spheres give us contact points like that.

Parameters
capsuleThe shape. Can have transformation.
pointA point in world coordinates. Used for anchoring the line. Assumed to have come from collision detection code.
normalA normal in world coordinates. Expected to have length 1.
depthThe depth of the contact point. Only used for approximative calculations in mesh case. Used for giving direction to the line. Assumed to have come from collision detection code.
Return values
Theelastic rest length, defined as the intersection length between line and shape.

◆ calculateElasticRestLength() [5/6]

agx::Real AGXPHYSICS_EXPORT agxCollide::ElasticRestLengthCalculator::calculateElasticRestLength ( const agxCollide::Cylinder *  cylinder,
const agx::Vec3 &  point,
const agx::Vec3 &  normal,
const agx::Real  depth 
)

Computes elastic rest length for this shape, point and normal.

It is defined as the intersection length of a line (defined by the point and the normal) with the shape. Note that the intersection can be on the line's positive side, negative side, or both. Note that for the sphere case, we will assume that the line of point and normal goes through the sphere's mid point, since all colliders involving spheres give us contact points like that.

Parameters
cylinderThe shape. Can have transformation.
pointA point in world coordinates. Used for anchoring the line. Assumed to have come from collision detection code.
normalA normal in world coordinates. Expected to have length 1.
depthThe depth of the contact point. Only used for approximative calculations in mesh case. Used for giving direction to the line. Assumed to have come from collision detection code.
Return values
Theelastic rest length, defined as the intersection length between line and shape.

◆ calculateElasticRestLength() [6/6]

agx::Real AGXPHYSICS_EXPORT agxCollide::ElasticRestLengthCalculator::calculateElasticRestLength ( const agxCollide::Mesh *  mesh,
const agx::Vec3 &  point,
const agx::Vec3 &  normal,
const agx::Real  depth 
)

Computes elastic rest length for this shape, point and normal.

It is defined as the intersection length of a line (defined by the point and the normal) with the shape. Note that the intersection can be on the line's positive side, negative side, or both. Note that for the sphere case, we will assume that the line of point and normal goes through the sphere's mid point, since all colliders involving spheres give us contact points like that.

Parameters
meshThe shape. Can have transformation.
pointA point in world coordinates. Used for anchoring the line. Assumed to have come from collision detection code.
normalA normal in world coordinates. Expected to have length 1.
depthThe depth of the contact point. Only used for approximative calculations in mesh case. Used for giving direction to the line. Assumed to have come from collision detection code.
Return values
Theelastic rest length, defined as the intersection length between line and shape.