public class MultiPointMuscle extends MultiPointSpring implements MuscleComponent
MultiPointSpring.Segment, MultiPointSpring.SegmentSpec, MultiPointSpring.SubSegment, MultiPointSpring.WrapKnot, MultiPointSpring.WrapSegmentExcitationComponent.CombinationRuleModelComponent.FilePathSaveType, ModelComponent.NavpanelVisibility| Modifier and Type | Field and Description |
|---|---|
static PropertyList |
myProps |
maxForceNorm, maxLengthErr, myDebug, myDrawWrapPoints, sumForceNorm, sumLengthErr, totalCalls, totalFails, totalFalseStuck, totalStuckmyIgnoreCoriolisInJacobian, useMaterialenforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNamesTRANSPARENT, TWO_DIMENSIONALTG_ARTICULATED, TG_DRAGGER, TG_PRESERVE_ORIENTATION, TG_SIMULATINGCOPY_REFERENCES, REST_POSITION| Constructor and Description |
|---|
MultiPointMuscle() |
MultiPointMuscle(java.lang.String name) |
MultiPointMuscle(java.lang.String name,
double k,
double d,
double maxf,
double l) |
| Modifier and Type | Method and Description |
|---|---|
void |
addExcitationSource(ExcitationComponent ex,
double gain)
Adds a new excitation source to this Excitable with a specified gain.
|
double |
computeDFdl(double l,
double ldot)
Computes the derivative of spring force magnitude (acting along the unit
vector from the first to the second particle) with respect to spring
length.
|
double |
computeDFdldot(double l,
double ldot)
Computes the derivative of spring force magnitude (acting along the unit
vector from the first to the second particle)with respect to the time
derivative of spring length.
|
double |
computeF(double l,
double ldot)
Computes the force magnitude acting along the unit vector from the first
to the second particle.
|
double |
computePassiveF(double l,
double ldot)
Computes the force magnitude acting along the unit vector from the first
to the second particle with zero excitation.
|
static MultiPointMuscle |
createConstant() |
static MultiPointMuscle |
createConstant(double maxForce) |
static MultiPointMuscle |
createLinear() |
static MultiPointMuscle |
createLinear(double maxForce,
double maxLen) |
static MultiPointMuscle |
createPai() |
static MultiPointMuscle |
createPai(double maxForce,
double optLen,
double maxLen,
double ratio) |
static MultiPointMuscle |
createPeck() |
static MultiPointMuscle |
createPeck(double maxForce,
double optLen,
double maxLen,
double ratio) |
static MultiPointMuscle |
createPeck(java.lang.String name,
double maxForce,
double optLen,
double maxLen,
double ratio) |
PropertyList |
getAllPropertyInfo()
Returns a list giving static information about all properties exported by
this object.
|
ExcitationComponent.CombinationRule |
getCombinationRule()
Return the combination rule for excitations.
|
double |
getExcitation()
Returns the primary excitation for this component.
|
java.awt.Color |
getExcitationColor() |
PropertyMode |
getExcitationColorMode() |
double |
getExcitationGain(ExcitationComponent ex)
Gets the gain for an excitation source in this component.
|
double |
getForceNorm() |
int |
getJacobianType()
Returns a code indicating the matrix type that results when the Jacobian
terms of this force effector are added to the solve matrix.
|
double |
getMaxColoredExcitation() |
PropertyMode |
getMaxColoredExcitationMode() |
double |
getNetExcitation()
Returns the net excitation for this Excitable.
|
double |
getPassiveForceNorm() |
float[] |
getRenderColor() |
void |
getSoftReferences(java.util.List<ModelComponent> refs)
Appends all soft references for this component to a list.
|
void |
getState(DataBuffer data)
Saves state information for this component by adding data to the
supplied DataBuffer.
|
boolean |
hasState()
Queries if this component has state.
|
boolean |
isEnabled() |
void |
prerender(RenderList list)
Called prior to rendering to allow this object to update the internal
state required for rendering (such as by caching rendering coordinates).
|
boolean |
removeExcitationSource(ExcitationComponent ex)
Removes an excitation source from this Excitable.
|
void |
resetLengthProps()
sets the opt length to current muscle length and max length with the
original ratio of opt to max length
|
void |
scaleDistance(double s)
Scales all distance coordinates.
|
void |
scaleMass(double s)
Scales all mass units.
|
void |
setCombinationRule(ExcitationComponent.CombinationRule rule)
Sets the rule for combining excitations.
|
void |
setEnabled(boolean enabled) |
void |
setExcitation(double a)
SetsJust reiterating the primary excitation for this component.
|
void |
setExcitationColor(java.awt.Color color) |
void |
setExcitationColorMode(PropertyMode mode) |
boolean |
setExcitationGain(ExcitationComponent ex,
double gain)
Sets the gain for an excitation source in this component.
|
void |
setMaxColoredExcitation(double excitation) |
void |
setMaxColoredExcitationMode(PropertyMode mode) |
void |
setState(DataBuffer data)
Restores the state for this component by reading from the supplied
data buffer, starting at the current buffer offsets.
|
void |
updateReferences(boolean undo,
java.util.Deque<java.lang.Object> undoInfo)
May be called by the system if any of the soft references for
this component are removed from the the component hierarchy.
|
addPoint, addPoint, addPosJacobian, addPosJacobianOld, addSegmentPosBlocks, addSegmentVelBlocks, addSolveBlocks, addTransformableDependencies, addVelJacobian, addVelJacobianOld, addWrappable, addWrappable, applyForces, clearPoints, clearWrappables, clearWrappableSegment, containsWrappable, containsWrappable, copy, getABPointColor, getActiveLength, getActiveLengthDot, getAllABPoints, getContactCount, getContactDamping, getContactingKnotsColor, getContactStiffness, getConvergedCount, getConvergenceTol, getCopyReferences, getDebugLevel, getDrawABPoints, getDrawDisplacements, getDrawKnots, getHardReferences, getInitializingPoints, getIterationCount, getKnot, getLength, getLengthDot, getLineSearch, getMaxWrapDisplacement, getMaxWrapIterations, getNumKnots, getPoint, getPrintProfiling, getProfileCount, getProfileTimeUsec, getProfiling, getSegment, getSegments, getSegmentSpec, getSor, getStateVersion, getUpdateContactsCount, getWrapDamping, getWrapKnotDensity, getWrapKnotDensityMode, getWrappable, getWrappableRange, getWrappables, getWrapStiffness, hasConditionalPoints, hasMovingMarkers, hasWrappableSegments, indexOfPoint, indexOfWrappable, indexOfWrappable, initializeSegment, isDuplicatable, isSegmentPassive, isSegmentWrappable, main, numKnots, numPassiveSegments, numPoints, numSegments, numSegmentSpecs, numWrappables, pathWrapString, postadvance, postscan, preadvance, printSegments, printSegmentSpecs, removePoint, removeWrappable, removeWrappable, render, scan, setABPointColor, setAllSegmentsWrappable, setContactDamping, setContactingKnotsColor, setContactStiffness, setConvergenceTol, setDebugLevel, setDrawABPoints, setDrawDisplacements, setDrawKnots, setInitializingPoints, setKnotPositions, setLineSearch, setMaxWrapDisplacement, setMaxWrapIterations, setNumKnots, setPoint, setPrintProfiling, setProfiling, setRestLengthFromPoints, setSegmentPassive, setSegmentPassive, setSegmentWrappable, setSegmentWrappable, setSegmentWrappable, setSor, setWrapDamping, setWrapKnotDensity, setWrapKnotDensityMode, setWrapStiffness, transformGeometry, transformGeometry, updateBounds, updateSlavePos, updateSlaveVel, updateStructure, updateWrapSegments, updateWrapSegmentsadvanceState, computeDFdl, computeDFdldot, computeF, containsPoint, createDefaultMaterial, createRenderProps, getAuxVarDerivative, getAuxVarState, getEffectiveMaterial, getForceScaling, getMaterial, getMaxForce, getRenderHints, getRenderProps, getRestLength, getSelection, isSelectable, normalizeForceScaling, numAuxVars, numSelectionQueriesNeeded, requiresAdvance, setAuxVarState, setDamping, setLinearMaterial, setMaterial, setMaxForce, setRenderProps, setRestLength, setStiffnesscheckFlag, checkName, checkNameUniqueness, clearFlag, clone, connectToHierarchy, createTempFlag, disconnectFromHierarchy, getChildren, getGrandParent, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, hasChildren, isFixed, isMarked, isScanning, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setScanning, setSelected, setWritable, writeequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetLength, getLengthDot, getMaterial, getPoint, getRestLength, numPoints, setMaterial, setRestLengthaddPosJacobian, addSolveBlocks, addVelJacobian, applyForcesconnectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, isFixed, isMarked, isSelected, notifyParentOfChange, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, setWritablegetPropertygetChildren, hasChildrenpostscanisWritable, writegetSelection, isSelectable, numSelectionQueriesNeededgetRenderHints, render, updateBoundscreateRenderProps, getRenderProps, setRenderPropstransformPrioritypublic static PropertyList myProps
public MultiPointMuscle()
public MultiPointMuscle(java.lang.String name)
public MultiPointMuscle(java.lang.String name,
double k,
double d,
double maxf,
double l)
public static MultiPointMuscle createConstant(double maxForce)
public static MultiPointMuscle createConstant()
public static MultiPointMuscle createLinear(double maxForce, double maxLen)
public static MultiPointMuscle createLinear()
public static MultiPointMuscle createPai(double maxForce, double optLen, double maxLen, double ratio)
public static MultiPointMuscle createPai()
public static MultiPointMuscle createPeck(double maxForce, double optLen, double maxLen, double ratio)
public static MultiPointMuscle createPeck(java.lang.String name, double maxForce, double optLen, double maxLen, double ratio)
public static MultiPointMuscle createPeck()
public java.awt.Color getExcitationColor()
getExcitationColor in interface MuscleComponentpublic void setExcitationColor(java.awt.Color color)
setExcitationColor in interface MuscleComponentpublic PropertyMode getExcitationColorMode()
public void setExcitationColorMode(PropertyMode mode)
public double getMaxColoredExcitation()
public void setMaxColoredExcitation(double excitation)
public PropertyMode getMaxColoredExcitationMode()
public void setMaxColoredExcitationMode(PropertyMode mode)
public PropertyList getAllPropertyInfo()
MultiPointSpringgetAllPropertyInfo in interface HasPropertiesgetAllPropertyInfo in class MultiPointSpringpublic double getExcitation()
getExcitation in interface ExcitationComponentpublic void setExcitation(double a)
setExcitation in interface ExcitationComponenta - excitation valuepublic void setCombinationRule(ExcitationComponent.CombinationRule rule)
setCombinationRule in interface ExcitationComponentrule - rule for combining excitationspublic ExcitationComponent.CombinationRule getCombinationRule()
getCombinationRule in interface ExcitationComponentpublic void addExcitationSource(ExcitationComponent ex, double gain)
addExcitationSource in interface ExcitationComponentex - excitatation source to be addedgain - gain for the sourcepublic boolean removeExcitationSource(ExcitationComponent ex)
removeExcitationSource in interface ExcitationComponentex - excitatation source to be removedpublic double getExcitationGain(ExcitationComponent ex)
getExcitationGain in interface ExcitationComponentex - excitatation source whose gain is to be queriedpublic boolean setExcitationGain(ExcitationComponent ex, double gain)
setExcitationGain in interface ExcitationComponentex - excitatation source whose gain is to be modifiedgain - new gain for the sourcepublic float[] getRenderColor()
getRenderColor in class PointSpringBasepublic void prerender(RenderList list)
MultiPointSpringlist.addIfVisible (obj);
for each of the objects in question.prerender in interface IsRenderableprerender in class MultiPointSpringlist - list of objects to be renderedpublic double getNetExcitation()
getNetExcitation in interface ExcitationComponentpublic double computeF(double l,
double ldot)
computeF in class PointSpringBasel - spring lengthldot - spring length derivativepublic double computePassiveF(double l,
double ldot)
public double computeDFdl(double l,
double ldot)
computeDFdl in class PointSpringBasel - spring lengthldot - spring length derivativepublic double computeDFdldot(double l,
double ldot)
computeDFdldot in class PointSpringBasel - spring lengthldot - spring length derivativepublic void resetLengthProps()
public double getForceNorm()
public double getPassiveForceNorm()
public void scaleDistance(double s)
MultiPointSpringscaleDistance in interface ScalableUnitsscaleDistance in class MultiPointSprings - scaling factorpublic void scaleMass(double s)
MultiPointSpringscaleMass in interface ScalableUnitsscaleMass in class MultiPointSprings - scaling factorpublic int getJacobianType()
MultiPointSpringMatrix.SYMMETRIC or Matrix.POSITIVE_DEFINITE. The former should be set if adding the Jacobian
terms preserves symmetry, and the latter should be set if positive
definiteness if preserved. Both should be set if there is no Jacobian for
this effector (i.e., the Jacobian methods are not implemented). Matrix
types from all the force effectors are logically and-ed together to
determine the type for the entire solve matrix.getJacobianType in interface ForceEffectorgetJacobianType in class MultiPointSpringpublic boolean isEnabled()
public void setEnabled(boolean enabled)
public void getSoftReferences(java.util.List<ModelComponent> refs)
updateReferences() method will
be called to update its internal reference information.
Soft references for MultiPointSpring include intermediate points between
the two end points, and the wrappables.getSoftReferences in interface ModelComponentgetSoftReferences in class MultiPointSpringrefs - list to which soft references are appendedpublic void updateReferences(boolean undo,
java.util.Deque<java.lang.Object> undoInfo)
undo equal to false,
this component should then examine its soft references and
use ComponentUtils.areConnected()
to determine which of them have been disconnected from the hierarchy.
Disconnected references should be removed, and sufficient information
should be appended to undoInfo to allow this update
to be undone if this method is called later with undo
equal to true. When undoing an update, the undo
information should be removed from the front of undoInfo.updateReferences in interface ModelComponentupdateReferences in class MultiPointSpringundo - if true, indicates that the most
recent reference update should be undone, using the supplied
undo information.undoInfo - if undo is false, should be used
to store information allowing the reference update to be undone.
Otherwise, if undo is true, then this
supplied information to undo the most recent update.public void getState(DataBuffer data)
MultiPointSpringgetState in interface HasNumericStategetState in class MultiPointSpringdata - buffer for storing the state values.public void setState(DataBuffer data)
MultiPointSpringsetState in interface HasNumericStatesetState in class MultiPointSpringdata - buffer containing the state informationpublic boolean hasState()
PointSpringBasehasState in interface HasNumericStatehasState in interface ModelComponenthasState in class MultiPointSpringtrue if this component has state