Constraint data used with GenericElementaryConstraint containing data such as; constraint violation, constraint velocity and bounds.
More...
#include <GenericConstraintData.h>
Constraint data used with GenericElementaryConstraint containing data such as; constraint violation, constraint velocity and bounds.
Definition at line 69 of file GenericConstraintData.h.
◆ BoundsVector
◆ GenericConstraintData()
| agx::GenericConstraintData::GenericConstraintData |
( |
| ) |
|
Construct given number of rows in the elementary constraint.
◆ getBodyData()
Access body related data, such as the Jacobian, for a given body rb.
- Parameters
-
| rb | - rigid body to access data for, rb == nullptr will return valid but the data is ignored |
- Returns
- body data (such as the Jacobian) for the given instance
rb
◆ getBodyDataAt()
Access body related data, such as the Jacobian, for a given body index index.
For an ordinary binary constraint with a transformed attachment pair, it's then possible to do:
a1: agx.Attachment = self.getAttachmentPair().getAttachment1()
a2: agx.Attachment = self.getAttachmentPair().getAttachment2()
rb1_data: agx.GenericConstraintBodyData = constraintData.getBodyDataAt(0)
rb2_data: agx.GenericConstraintBodyData = constraintData.getBodyDataAt(1)
v1 = a1.get(agx.Attachment.N)
v2 = a2.get(agx.Attachment.N)
rb1_data.setJacobian(0, agx.Vec3(), v1)
rb2_data.setJacobian(0, agx.Vec3(), -v2)
- Parameters
-
| index | - rigid body index to access data for |
- Returns
- body data (such as the Jacobian) for the given index
index
◆ getBounds()
| const BoundsVector & agx::GenericConstraintData::getBounds |
( |
| ) |
const |
◆ getIsImpacting()
| Bool agx::GenericConstraintData::getIsImpacting |
( |
| ) |
const |
- Returns
- true if the elementary constraint is impacting, otherwise false
◆ getVelocity()
| const RealVector & agx::GenericConstraintData::getVelocity |
( |
| ) |
const |
◆ getViolation()
| const RealVector & agx::GenericConstraintData::getViolation |
( |
| ) |
const |
◆ prepare()
Resets all values to default.
◆ setBound()
| void agx::GenericConstraintData::setBound |
( |
UInt |
row, |
|
|
RangeReal |
range |
|
) |
| |
Assign bound for given row in the elementary constraint.
- Note
- The bound given by the user has already been assigned when the GenericElementaryConstraint receives its callback.
- Parameters
-
| row | - elementary constraint row |
| range | - elementary constraint bound |
◆ setIsImpacting()
| void agx::GenericConstraintData::setIsImpacting |
( |
Bool |
isImpacting | ) |
|
Assign impacting state of the elementary constraint.
Default: false.
- Parameters
-
| isImpacting | - true if the elementary constraint is impacting, otherwise false |
◆ setVelocity()
| void agx::GenericConstraintData::setVelocity |
( |
UInt |
row, |
|
|
Real |
velocity |
|
) |
| |
Assign velocity for given row in the elementary constraint.
- Parameters
-
| row | - elementary constraint row |
| velocity | - elementary constraint velocity |
◆ setViolation()
| void agx::GenericConstraintData::setViolation |
( |
UInt |
row, |
|
|
Real |
violation |
|
) |
| |
Assign violation for given row in the elementary constraint.
- Parameters
-
| row | - elementary constraint row |
| violation | - elementary constraint violation |
The documentation for this class was generated from the following file: