17 #ifndef AGX_WIRE_CONTACT_SOLVER_H
18 #define AGX_WIRE_CONTACT_SOLVER_H
27 #define NUM_CONTACTS_AT_END 2
33 : m_position(position),
35 m_edgeStart(edgeStart),
39 m_normalForce(normalForce),
41 m_frictionCoeff(frictionCoeff)
43 m_edge = m_edgeEnd-m_edgeStart;
68 m_position = m_position + m_edge*velocity*timestep;
73 m_velocity = m_velocity + m_externalForce*timestep*m_invMass;
78 m_externalForce = externalForce*m_edge;
101 Real m_externalForce;
102 Real m_frictionCoeff;
113 :m_youngsModulus(youngsModulus),m_compliance(compliance),m_restlength(restlength),m_density(density),m_radius(radius),m_tension(tension)
128 Real m_youngsModulus;
217 m_rhs = -4*gamma*violation*invTimestep + gamma*GV;
238 size_t particleIndex = i + indexOffset;
260 if ( globalIndex < m_firstParticleGlobalIndex || globalIndex - m_firstParticleGlobalIndex >=
m_jacobianVector.
size() )
269 m_lowerBounds = bounds.
lower();
270 m_upperBounds = bounds.
upper();
305 bool m_reachedBounds;
318 m_beginParticle(nullptr),
319 m_endParticle(nullptr),
320 m_beginParticleVelocity( beginVelocity ),
321 m_endParticleVelocity( endVelocity ),
322 m_restlength(restlength)
341 Vec3 m_beginParticleVelocity;
342 Vec3 m_endParticleVelocity;
353 m_beginParticle(bwp),
354 m_middleParticle(mwp),
468 m_createSpringConstraints(false),
469 m_timestep(agx::
Real(1E-2)),
470 m_outsideTimestep(outsideTimestep),
472 m_beginMass(beginMass),
480 void createWire(
const Real radius,
const Real density,
const Real restlength,
const Real youngsModulus,
const Real compliance,
const Real tension,
bool useBend);
482 void createConstraints(
bool distanceBounds =
false );
484 bool iterateConstraints(
bool onlyOneStep =
false,
bool updatePositionsAndVelocities =
true );
486 void updateParticleForces(
Real timestep );
507 m_constraints.clear();
520 void setTimestep(
Real timestep ) { m_timestep = timestep; }
529 bool m_createSpringConstraints;
531 Real m_outsideTimestep;
ref_ptr< WireParticle > WireParticleRef
void setPosition(Vec3 pos)
ref_ptr< WireContactSpringConstraint > WireContactSpringConstraintRef
void push_back(const T &value)
Real getExternalForce() const
Vec3T< T > max(const Vec3T< T > &lhs, const Vec3T< T > &rhs)
ref_ptr< WireContactFrictionConstraint > WireContactFrictionConstraintRef
void addToTotalForce(Real constraintForce)
ref_ptr< WireContactSolver > WireContactSolverRef
void setExternalForce(Vec3 externalForce)
#define AGXPHYSICS_EXPORT
Real getYoungsModulus() const
Real getCompliance() const
GLenum GLuint GLenum GLsizei length
Real getNormalForce() const
Real getRestlength() const
Base class providing referencing counted objects.
Real length() const
Length of the vector = sqrt( vec .
void setNormalForce(Real normalForce)
void updatePosition(Real timestep, Real maxVelocity=agx::Infinity)
agx::Vector< WireParticleRef > WireParticleRefVector
ref_ptr< WireContactDistanceConstraint > WireContactDistanceConstraintRef
void applyVelocityDamping()
AGXCORE_EXPORT const Real Infinity
ref_ptr< WireContactConstraint > WireContactConstraintRef
virtual ~ParticleContactWire()
Real getFrictionCoefficient()
void setVelocity(Real velocity)
void setFrictionCoefficient(Real frictionCoeff)
Real normalize()
Normalize the vector so that it has length unity.
agx::Vector< WireContactConstraintRef > WireContactConstraintRefVector
T1 clamp(T1 v, T2 minimum, T3 maximum)
ref_ptr< ParticleContactWire > ParticleContactWireRef
ref_ptr< WireContactBendConstraint > WireContactBendConstraintRef
void push_back(const T2 &value)
Real distance(const Vec3T &v2) const
Distance to another vector.
ParticleContactWire(Real restlength, Real density, Real youngsModulus, Real compliance, Real radius, Real tension, bool)
void integrateExternalForce(Real timestep)