public abstract class DeformableBody extends RigidBody implements PropertyChangeListener
RigidBody.DistanceSurfaceRendering, RigidBody.InertiaMethodCollidable.Collidability, Collidable.Group| Modifier and Type | Field and Description | 
|---|---|
| static PropertyList | myProps | 
dynamicVelInWorldCoords, myRenderFrameenforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNamesAll, AllBodies, Deformable, Rigid, SelfCOPY_REFERENCESTG_ARTICULATED, TG_DRAGGER, TG_PRESERVE_ORIENTATION, TG_SIMULATINGTRANSPARENT, TWO_DIMENSIONAL| Modifier and Type | Method and Description | 
|---|---|
| void | addEffectivePointMass(double m,
                     Vector3d loc)Adds a point mass to the effective spatial inertia for this Frame. | 
| void | addElasticForce(VectorNd f) | 
| void | addExternalElasticForce(VectorNd f) | 
| void | addPointForce(Point3d loc,
             Vector3d f)Adds to this body's forces the wrench arising from applying a force
  fon a pointloc. | 
| void | addPointForce(Wrench wr,
             VectorNd fe,
             Point3d loc,
             Vector3d f)Adds to  wrandfethe wrench and elastic forces
 arising from applying a forcefon a pointloc. | 
| void | addPointMass(Matrix M,
            double m,
            Vector3d pos)Adds a point mass to a matrix that contains the spatial
 inertia for this Frame. | 
| void | addPosImpulse(double[] xbuf,
             int xidx,
             double h,
             double[] vbuf,
             int vidx) | 
| void | addPosJacobian(SparseNumberedBlockMatrix S,
              double s)Scales the components of the position Jacobian associated with this force
 effector and adds it to the supplied solve matrix M. | 
| void | addScaledExternalElasticForce(double s,
                             VectorNd f) | 
| void | addSolveBlock(SparseNumberedBlockMatrix S) | 
| void | addToPointVelocity(Vector3d vel,
                  double w,
                  ContactPoint cpnt)Computes the velocity imparted to a contact point by this component's
 current velocity, multiples it by a weighting factor  w,
 and add it tovel. | 
| void | addVelJacobian(SparseNumberedBlockMatrix S,
              double s)Scales the components of the velocity Jacobian associated with this force
 effector and adds it to the supplied solve matrix M. | 
| void | applyExternalForces() | 
| void | applyForces(double t)Adds forces to the components affected by this force effector at a
 particular time. | 
| void | computeDeformationGradient(Matrix3d F,
                          Vector3d x0) | 
| void | computeDeformedFrame(RigidTransform3d A,
                    PolarDecomposition3d polarDecomp,
                    RigidTransform3d A0) | 
| void | computeDeformedFrame(RigidTransform3d A,
                    RigidTransform3d A0) | 
| void | computeDeformedFrameVel(Twist vel,
                       PolarDecomposition3d polarDecomp,
                       RigidTransform3d A0)Computes the spatial velocity of an attached frame A, as represented
 in the coordinates of A. | 
| void | computeDeformedPos(Vector3d pos,
                  Vector3d pos0)Computes the deformed position in body coordinates | 
| void | computeDeformedVel(Vector3d vel,
                  Vector3d pos0)Computes the deformed velocity in body coordinates | 
| void | computeElasticJacobian(MatrixNd Pi,
                      PolarDecomposition3d polarDecomp,
                      RigidTransform3d A0,
                      boolean worldCoords)Compute the transform that maps elastic velocities onto the spatial
 velocity of an attached frame A. | 
| void | computeLocalPointForceJacobian(MatrixBlock GT,
                              Vector3d loc,
                              RotationMatrix3d R)Computes a force Jacobian for a point attached to this frame, and then
 optionally rotates its columns using a rotation matrix R. | 
| void | computePointCoriolis(Vector3d cor,
                    Vector3d loc)Computes the velocity derivative of a point attached to this frame
 that is due to the current velocity of the frame. | 
| void | computePointLocation(Vector3d loc,
                    Vector3d pos)Computes the location, in body coordinates, of a point whose position
 is given in world coordinates. | 
| void | computePointPosition(Vector3d pos,
                    Point3d loc)Computes the position, in world coordinates, of a point attached to this
 frame. | 
| void | computePointVelocity(Vector3d vel,
                    Point3d loc,
                    Twist frameVel)Computes the velocity, in world coordinates, of a point attached to this
 frame. | 
| void | computeUndeformedFrame(RigidTransform3d A0,
                      PolarDecomposition3d polarDecomp,
                      RigidTransform3d A) | 
| double | computeUndeformedPos(Vector3d pos0,
                    Vector3d pos,
                    double tol)Computes the undeformed position of a given position in body coordinates | 
| void | computeWorldPointForceJacobian(MatrixBlock GT,
                              Point3d loc)Computes the force Jacobian, in world coordinates, for a point attached
 to this frame. | 
| static FemMaterial | createDefaultMaterial() | 
| MatrixBlock | createMassBlock()Create a matrix block for representing the mass of this component,
 initialized to the component's effective mass (instrinsic mass
 plus the mass due to all attachmented components). | 
| PropertyList | getAllPropertyInfo()Returns a list giving static information about all properties exported by
 this object. | 
| DistanceGrid | getDistanceGrid()Returns a signed distance grid that can be used with a
 SignedDistanceCollider, or  nullif a grid is not available
 (i.e., ifRigidBody.hasDistanceGrid()returnsfalse). | 
| abstract void | getDShape(Matrix3d Dshp,
         int i,
         Vector3d pos0) | 
| void | getEffectiveMass(Matrix M,
                double t)Gets the effective mass of this component at a particular time. | 
| int | getEffectiveMassForces(VectorNd f,
                      double t,
                      int idx)Gets the mass forces for this component at a particular time. | 
| VectorNd | getElasticForce() | 
| VectorNd | getElasticPos() | 
| double | getElasticPos(int idx) | 
| void | getElasticPos(VectorNd pos) | 
| VectorNd | getElasticVel() | 
| double | getElasticVel(int idx) | 
| void | getElasticVel(VectorNd vel) | 
| VectorNd | getExternalElasticForce() | 
| int | getForce(double[] f,
        int idx) | 
| void | getInverseMass(Matrix Minv,
              Matrix M)Inverts a mass for this component. | 
| void | getMass(Matrix M,
       double t)Gets the mass of this component at a particular time. | 
| double | getMassDamping() | 
| FemMaterial | getMaterial() | 
| int | getPosDerivative(double[] dxdt,
                int idx) | 
| int | getPosState(double[] buf,
           int idx) | 
| int | getPosStateSize() | 
| abstract void | getShape(Vector3d shp,
        int i,
        Vector3d pos0) | 
| double | getStiffnessDamping() | 
| int | getVelState(double[] buf,
           int idx) | 
| int | getVelStateSize() | 
| boolean | hasDistanceGrid()Returns  trueif this RigidBody supports a signed
 distance grid that can be used with a SignedDistanceCollider. | 
| void | invalidateStiffness() | 
| boolean | isDeformable()Returns  trueif this collidable is deformable. | 
| int | mulInverseEffectiveMass(Matrix M,
                       double[] a,
                       double[] f,
                       int idx) | 
| abstract int | numElasticCoords() | 
| void | propertyChanged(PropertyChangeEvent e) | 
| void | setContactConstraint(double[] buf,
                    double w,
                    Vector3d dir,
                    ContactPoint cpnt)Computes the values for the block matrix which defines this component's
 contribution to a contact constraint matrix. | 
| void | setElasticForce(VectorNd f) | 
| void | setElasticPos(int idx,
             double value) | 
| void | setElasticPos(VectorNd pos) | 
| void | setElasticVel(int idx,
             double value) | 
| void | setElasticVel(VectorNd vel) | 
| void | setExternalElasticForce(VectorNd f) | 
| int | setForce(double[] f,
        int idx) | 
| void | setMassDamping(double d) | 
| void | setMaterial(FemMaterial mat) | 
| int | setPosState(double[] buf,
           int idx) | 
| void | setStiffnessDamping(double d) | 
| int | setVelState(double[] buf,
           int idx) | 
| abstract void | updateStiffnessMatrix() | 
| void | zeroExternalForces() | 
| void | zeroForces() | 
addConnector, addEffectiveInertia, allowCollision, applyGravity, centerPoseOnCenterOfMass, computeVolume, containsContactMaster, copy, createBox, createBox, createCylinder, createEllipsoid, createFromMesh, createFromMesh, createFromMesh, createFromMesh, createIcosahedralSphere, createRenderProps, createSphere, extrapolatePose, getCenterOfMass, getCenterOfMass, getCollidable, getCollidableAncestor, getCollidableIndex, getCollisionMesh, getConnectors, getCopyReferences, getDensity, getDensityRange, getDistanceGridMaxRes, getDistanceGridOBB, getDistanceGridRenderRanges, getDistanceGridRenderRangesRange, getDistanceGridRes, getDistanceSurfaceIso, getEffectiveInertia, getEffectiveMassForces, getFileTransform, getFrameMarkers, getInertia, getInertiaMethod, getMass, getMass, getMassRange, getMesh, getMeshFileName, getMeshFileTransform, getRenderDistanceGrid, getRenderDistanceSurface, getRotationalInertia, getRotationalInertia, getSurfaceMesh, getSurfaceMeshes, getVertexMasters, isCompound, isDuplicatable, isFileTransformRigid, isFreeBody, isMassConstant, isMeshModfied, mulInverseEffectiveMass, numSurfaceMeshes, prerender, removeConnector, render, resetEffectiveMass, scaleDistance, scaleMass, scaleMesh, scaleMesh, scan, setCenterOfMass, setCollidable, setCollidableIndex, setDensity, setDistanceGridMaxRes, setDistanceGridOBB, setDistanceGridRenderRanges, setDistanceGridRes, setDistanceSurfaceIso, setDynamic, setInertia, setInertia, setInertia, setInertia, setInertiaFromDensity, setInertiaFromMass, setInertiaMethod, setMass, setMesh, setMesh, setMesh, setMeshFileName, setPose, setRenderDistanceGrid, setRenderDistanceSurface, setRotationalInertia, setSurfaceMesh, setSurfaceMesh, transformGeometry, updateAttachmentPosStates, updateBounds, writeaddExternalForce, addForce, addPointForce, addScaledExternalForce, addSolveBlocks, addTargetJacobian, addTransformableDependencies, computeAppliedWrench, computePointVelocity, computePointVelocity, createFrameAttachment, createPointAttachment, getAxisLength, getBodyForce, getBodyVelocity, getBodyVelState, getExternalForce, getForce, getForce, getFrameDamping, getFrameDampingMode, getJacobianType, getMoment, getOrientation, getOrientation, getPose, getPose, getPosition, getRotaryDamping, getRotaryDampingMode, getRotation, getSelection, getTargetActivity, getTargetOrientation, getTargetPos, getTargetPose, getTargetPosition, getTargetVel, getTargetVelocity, getTraceablePositionProperty, getTraceables, getTransForce, getVelocity, getVelocity, getWorldVelState, resetTargets, setAxisLength, setBodyVelocity, setExternalForce, setForce, setFrameDamping, setFrameDampingMode, setOrientation, setPose, setPosition, setRotaryDamping, setRotaryDampingMode, setRotation, setState, setTargetActivity, setTargetOrientation, setTargetPos, setTargetPose, setTargetPosition, setTargetVel, setTargetVelocity, setVelocity, setVelocity, subPointForce, subPointForce, transformPose, velocityLimitExceededaddConstrainer, addMasterAttachment, getAttachment, getConstrainers, getMasterAttachments, getSolveIndex, hasState, isActive, isAttached, isControllable, isDynamic, isParametric, removeConstrainer, removeMasterAttachment, setAttached, setSolveIndex, transformGeometrygetRenderHints, getRenderProps, isSelectable, numSelectionQueriesNeeded, setRenderProps, updateRenderPropscheckFlag, checkName, checkNameUniqueness, clearFlag, clone, connectToHierarchy, createTempFlag, disconnectFromHierarchy, getChildren, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasChildren, isConnectedToHierarchy, isFixed, isMarked, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, postscan, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setSelected, updateReferencesequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittransformPosecreateFrameAttachmentcreatePointAttachmentaddConstrainer, addMasterAttachment, checkFlag, clearFlag, getAttachment, getConstrainers, getMasterAttachments, getSolveIndex, isActive, isAttached, isControllable, isDynamic, isParametric, removeConstrainer, removeMasterAttachment, setAttached, setFlag, setSolveIndextransformGeometrypublic static PropertyList myProps
public void invalidateStiffness()
public PropertyList getAllPropertyInfo()
HasPropertiesgetAllPropertyInfo in interface HasPropertiesgetAllPropertyInfo in class RigidBodypublic abstract int numElasticCoords()
public boolean isDeformable()
Collidabletrue if this collidable is deformable. Whether or
 not a collidable is deformable determines how it responds to default
 collision behaviors involving deformable and rigid collidables. Also,
 self-collisions among sub-collidables of a collidable A are permitted
 only if A is deformable.isDeformable in interface CollidableisDeformable in interface ConnectableBodyisDeformable in class RigidBodytrue if this collidable is deformablepublic boolean hasDistanceGrid()
RigidBodytrue if this RigidBody supports a signed
 distance grid that can be used with a SignedDistanceCollider.
 A grid is available if either the property
 distanceGridMaxRes is positive, or
 the property distanceGridRes contains all positive values.hasDistanceGrid in interface CollidableBodyhasDistanceGrid in interface HasDistanceGridhasDistanceGrid in class RigidBodytrue if a signed distance grid is available
 for this RigidBodyRigidBody.getDistanceGridMaxRes(), 
RigidBody.getDistanceGridRes()public DistanceGrid getDistanceGrid()
RigidBodynull if a grid is not available
 (i.e., if RigidBody.hasDistanceGrid() returns false).
 The number of divisons in the grid is controlled explicitly by the
 property distanceGridRes, or, that is 0, by the property
 distanceGridMaxRes. If both properties are 0, no grid is
 available and null will be returned.getDistanceGrid in interface CollidableBodygetDistanceGrid in interface HasDistanceGridgetDistanceGrid in class RigidBodynull if a grid is
 not available this RigidBodyRigidBody.getDistanceGridMaxRes(), 
RigidBody.getDistanceGridRes()public void setMassDamping(double d)
public double getMassDamping()
public void setStiffnessDamping(double d)
public double getStiffnessDamping()
public static FemMaterial createDefaultMaterial()
public FemMaterial getMaterial()
public void setMaterial(FemMaterial mat)
public void propertyChanged(PropertyChangeEvent e)
propertyChanged in interface PropertyChangeListenerpublic VectorNd getElasticPos()
public VectorNd getElasticVel()
public void getElasticPos(VectorNd pos)
public void getElasticVel(VectorNd vel)
public VectorNd getElasticForce()
public void setElasticForce(VectorNd f)
public void addElasticForce(VectorNd f)
public VectorNd getExternalElasticForce()
public void setExternalElasticForce(VectorNd f)
public void addExternalElasticForce(VectorNd f)
public void addScaledExternalElasticForce(double s,
                                          VectorNd f)
public void setElasticPos(VectorNd pos)
public void setElasticVel(VectorNd vel)
public MatrixBlock createMassBlock()
DynamicComponentcreateMassBlock in interface DynamicComponentcreateMassBlock in class Framepublic void getMass(Matrix M, double t)
DynamicComponentgetMass in interface DynamicComponentgetMass in class RigidBodyM - matrix to return the mass int - current timepublic int getEffectiveMassForces(VectorNd f, double t, int idx)
DynamicComponentf, starting at the location
 specified by idx. Upon return, this method should
 return the value of idx incremented by the dimension
 of the mass forces.getEffectiveMassForces in interface DynamicComponentgetEffectiveMassForces in class RigidBodyf - vector to return the forces int - current timeidx - starting location within f
 where forces should be storedidxpublic void getEffectiveMass(Matrix M, double t)
DynamicComponentgetEffectiveMass in interface DynamicComponentgetEffectiveMass in class RigidBodyM - matrix to return the mass int - current timepublic int mulInverseEffectiveMass(Matrix M, double[] a, double[] f, int idx)
mulInverseEffectiveMass in interface DynamicComponentmulInverseEffectiveMass in class RigidBodypublic void addEffectivePointMass(double m,
                                  Vector3d loc)
addEffectivePointMass in class RigidBodym - mass of the pointloc - location of the point (in local frame coordinates)public void getInverseMass(Matrix Minv, Matrix M)
DynamicComponentgetInverseMass in interface DynamicComponentgetInverseMass in class RigidBodyMinv - matrix to return the inverse mass inM - matrix containing the mass to be invertedpublic void addSolveBlock(SparseNumberedBlockMatrix S)
addSolveBlock in interface DynamicComponentaddSolveBlock in class Framepublic void addPosImpulse(double[] xbuf,
                          int xidx,
                          double h,
                          double[] vbuf,
                          int vidx)
addPosImpulse in interface DynamicComponentaddPosImpulse in class Framepublic int getPosDerivative(double[] dxdt,
                            int idx)
getPosDerivative in interface DynamicComponentgetPosDerivative in class Framepublic int getPosState(double[] buf,
                       int idx)
getPosState in interface DynamicComponentgetPosState in class Framepublic int setPosState(double[] buf,
                       int idx)
setPosState in interface DynamicComponentsetPosState in class Framepublic int getVelState(double[] buf,
                       int idx)
getVelState in interface DynamicComponentgetVelState in class Framepublic int setVelState(double[] buf,
                       int idx)
setVelState in interface DynamicComponentsetVelState in class Framepublic int setForce(double[] f,
                    int idx)
setForce in interface DynamicComponentsetForce in class Framepublic int getForce(double[] f,
                    int idx)
getForce in interface DynamicComponentgetForce in class Framepublic int getPosStateSize()
getPosStateSize in interface DynamicComponentgetPosStateSize in interface MotionTargetComponentgetPosStateSize in class Framepublic int getVelStateSize()
getVelStateSize in interface DynamicComponentgetVelStateSize in interface MotionTargetComponentgetVelStateSize in class Framepublic void zeroForces()
zeroForces in interface DynamicComponentzeroForces in class Framepublic void zeroExternalForces()
zeroExternalForces in interface DynamicComponentzeroExternalForces in class Framepublic void applyExternalForces()
applyExternalForces in interface DynamicComponentapplyExternalForces in class Framepublic abstract void updateStiffnessMatrix()
public void applyForces(double t)
ForceEffectorapplyForces in interface ForceEffectorapplyForces in class Framet - time (seconds)public void addVelJacobian(SparseNumberedBlockMatrix S, double s)
ForceEffector
 M is guaranteed to be the same matrix supplied in the most recent call to
 addSolveBlocks, and so implementations may choose
 to cache the relevant matrix blocks from that call, instead of retrieving
 them directly from M.
addVelJacobian in interface ForceEffectoraddVelJacobian in class FrameS - solve matrix to which scaled velocity Jacobian is to be addeds - scaling factor for velocity Jacobianpublic void addPosJacobian(SparseNumberedBlockMatrix S, double s)
ForceEffector
 M is guaranteed to be the same matrix supplied in the most recent call to
 addSolveBlocks, and so implementations may choose
 to cache the relevant matrix blocks from that call, instead of retrieving
 them directly from M.
addPosJacobian in interface ForceEffectoraddPosJacobian in class FrameS - solve matrix to which scaled position Jacobian is to be addeds - scaling factor for position Jacobianpublic void addPointMass(Matrix M, double m, Vector3d pos)
FrameaddPointMass in class FrameM - matrix containing existing spatial inertiam - mass of the pointpos - location of the point (in local frame coordinates)public void computePointPosition(Vector3d pos, Point3d loc)
FramecomputePointPosition in class Framepos - returns the point positionloc - position of the point, in body coordinatespublic void computePointLocation(Vector3d loc, Vector3d pos)
FrameFrame.computePointPosition(maspack.matrix.Vector3d, maspack.matrix.Point3d).computePointLocation in class Frameloc - returns the point locationpos - position of the point, in world coordinatespublic void computePointVelocity(Vector3d vel, Point3d loc, Twist frameVel)
FramecomputePointVelocity in class Framevel - returns the point velocityloc - position of the point, in body coordinatesframeVel - velocity of the frame, in rotated world coordinatespublic void computePointCoriolis(Vector3d cor, Vector3d loc)
FramecomputePointCoriolis in class Framecor - returns the point Coriolis term (in world coordinates)loc - position of the point, in body coordinatespublic void addPointForce(Wrench wr, VectorNd fe, Point3d loc, Vector3d f)
wr and fe the wrench and elastic forces
 arising from applying a force f on a point loc.wr - accumulates the wrench (world coordinates)fe - accumulates the elastic forcesloc - location of the point (undeformed body coordinates)f - force applied to the point (world coordinates)public void addPointForce(Point3d loc, Vector3d f)
f on a point loc.addPointForce in class Frameloc - location of the point (body coordinates)f - force applied to the point (world coordinates)public void computeWorldPointForceJacobian(MatrixBlock GT, Point3d loc)
Frame[ I ] [ ] [ [ R loc ] ]where I is the 3x3 identity matrix, R is the frame orientation matrix, and [ x ] denotes the 3x3 skew-symmetric cross product matrix.
computeWorldPointForceJacobian in class FrameGT - returns the force Jacobianloc - position of the point, in body coordinatespublic void computeLocalPointForceJacobian(MatrixBlock GT, Vector3d loc, RotationMatrix3d R)
Framenull, then the Jacobian
 takes the following form for the 6x3 matrix case:
 [ I ] [ ] [ [ RF loc ] ]where RF is the frame orientation matrix, loc is the location of the point in frame coordinates, and [ x ] denotes the 3x3 skew-symmetric cross product matrix. If the rotation matrix R is not
null, then the
 6x3 case takes the following form:
 [ R ] [ ] [ [ RF loc ] R ]
computeLocalPointForceJacobian in class FrameGT - returns the force Jacobianloc - location of the point, relative to the frameR - optional rotation transformpublic void computeDeformedPos(Vector3d pos, Vector3d pos0)
public double computeUndeformedPos(Vector3d pos0, Vector3d pos, double tol)
public void computeDeformedVel(Vector3d vel, Vector3d pos0)
public void computeDeformedFrame(RigidTransform3d A, PolarDecomposition3d polarDecomp, RigidTransform3d A0)
public void computeUndeformedFrame(RigidTransform3d A0, PolarDecomposition3d polarDecomp, RigidTransform3d A)
public void computeDeformedFrame(RigidTransform3d A, RigidTransform3d A0)
public void computeDeformedFrameVel(Twist vel, PolarDecomposition3d polarDecomp, RigidTransform3d A0)
public void computeElasticJacobian(MatrixNd Pi, PolarDecomposition3d polarDecomp, RigidTransform3d A0, boolean worldCoords)
Pi - stores the elastic JacobianpolarDecomp - should be initialized to the polar decomposition
 of the deformation gradient at the origin of AA0 - rest pose of A (relative to the body frame)worldCoords - if true, the spatial velocity is rotated
 into world coordinates. Otherwise, it is returned in the coordinates of
 A.public void setElasticPos(int idx,
                          double value)
public double getElasticPos(int idx)
public void setElasticVel(int idx,
                          double value)
public double getElasticVel(int idx)
public void setContactConstraint(double[] buf,
                                 double w,
                                 Vector3d dir,
                                 ContactPoint cpnt)
CollidableDynamicComponentn is the component's velocity state size, and the contact is
 defined by a direction dir and a point cpnt.
 The computed values should be scaled by a weighting factor
 w.setContactConstraint in interface CollidableDynamicComponentsetContactConstraint in class Framebuf - returns the n values for the block matrixw - weighting factor by which the values should be scaleddir - contact direction (world coordinates)cpnt - contact pointpublic void addToPointVelocity(Vector3d vel, double w, ContactPoint cpnt)
CollidableDynamicComponentw,
 and add it to vel.addToPointVelocity in interface CollidableDynamicComponentaddToPointVelocity in class Framevel - accumulates contact point velocity (world coordinates)w - weighting factorcpnt - contact point