public class Muscle extends AxialSpring implements ExcitationComponent
ExcitationComponent.CombinationRule
ModelComponent.NavpanelVisibility
Modifier and Type | Field and Description |
---|---|
static PropertyList |
myProps |
myIgnoreCoriolisInJacobian, useMaterial
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
TRANSLUCENT, TWO_DIMENSIONAL
COPY_REFERENCES
Constructor and Description |
---|
Muscle() |
Muscle(Point p1,
Point p2) |
Muscle(java.lang.String name) |
Muscle(java.lang.String name,
double l0) |
Modifier and Type | Method and Description |
---|---|
void |
addExcitationSource(ExcitationComponent ex)
Adds a new excitation source to this Excitable, with an assumed gain of
1.
|
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.
|
void |
computePassiveForce(Vector3d f) |
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 |
getDefaultActivationWeight()
Returns the default weight that should be used when this excitation
component is being used for inverse actuation control.
|
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.
|
Vector3d |
getForce() |
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.
|
Vector3d |
getPassiveForce() |
double |
getPassiveForceNorm() |
float[] |
getRenderColor()
Returns the rgb components (in the range [0,1]) of a color that overrides
the default color indicated by the render props.
|
void |
getSoftReferences(java.util.List<ModelComponent> refs)
Appends all soft references for this component to a list.
|
void |
initialize(double t)
Called from within the model's
initialize() method. |
boolean |
isEnabled() |
void |
prerender(RenderList list)
Prepare for rendering, and potentially add itself to a list to be drawn
by a GLRenderer.
|
void |
printMuscleDirection() |
boolean |
removeExcitationSource(ExcitationComponent ex)
Removes an excitation source from this Excitable.
|
void |
render(GLRenderer renderer,
int flags)
Render this object using Open GL via the JOGL.
|
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 |
setConstantMuscleMaterial(double maxF) |
void |
setConstantMuscleMaterial(double maxF,
double forceScaling) |
void |
setEnabled(boolean enabled) |
void |
setExcitation(double a)
Sets 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 |
setLinearMuscleMaterial(double maxF,
double optL,
double maxL,
double pf) |
void |
setMaxColoredExcitation(double excitation) |
void |
setMaxColoredExcitationMode(PropertyMode mode) |
void |
setPeckMuscleMaterial(double maxF,
double optL,
double maxL,
double tendonRatio) |
void |
setPeckMuscleMaterial(double maxF,
double optL,
double maxL,
double tendonRatio,
double passiveFraction,
double damping) |
addPosJacobian, addSolveBlocks, addVelJacobian, applyForces, computeForce, computeForcePositionJacobian, computeForceVelocityJacobian, copy, getCopyReferences, getDir, getFirstPoint, getHardReferences, getLength, getLengthDot, getRenderCoords0, getRenderCoords1, getSecondPoint, isDuplicatable, printPointReferences, setFirstPoint, setPoints, setPoints, setRestLengthFromPoints, setSecondPoint, updateBounds, write
createDefaultMaterial, createRenderProps, getEffectiveMaterial, getMaterial, getMaxForce, getRenderHints, getRenderProps, getRestLength, getSelection, isSelectable, numSelectionQueriesNeeded, setDamping, setLinearMaterial, setMaterial, setMaxForce, setRenderProps, setRestLength, setStiffness
checkFlag, checkName, checkNameUniqueness, clearFlag, clone, connectToHierarchy, createTempFlag, disconnectFromHierarchy, getChildren, getGrandParent, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, hasChildren, hasState, isFixed, isMarked, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, postscan, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, scan, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setSelected, updateReferences
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, postscan, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, updateReferences
getProperty
getChildren, hasChildren
isWritable, write
isSelected
getSelection, isSelectable, numSelectionQueriesNeeded
getRenderHints
createRenderProps, getRenderProps, setRenderProps
public static PropertyList myProps
public Muscle()
public Muscle(java.lang.String name)
public Muscle(java.lang.String name, double l0)
public void setConstantMuscleMaterial(double maxF)
public void setConstantMuscleMaterial(double maxF, double forceScaling)
public void setLinearMuscleMaterial(double maxF, double optL, double maxL, double pf)
public void setPeckMuscleMaterial(double maxF, double optL, double maxL, double tendonRatio)
public void setPeckMuscleMaterial(double maxF, double optL, double maxL, double tendonRatio, double passiveFraction, double damping)
public java.awt.Color getExcitationColor()
public void setExcitationColor(java.awt.Color color)
public 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()
HasProperties
getAllPropertyInfo
in interface HasProperties
getAllPropertyInfo
in class AxialSpring
public double getExcitation()
getExcitation
in interface ExcitationComponent
public void initialize(double t)
initialize()
method.initialize
in interface RequiresInitialize
t
- initialization time (seconds)public void setExcitation(double a)
setExcitation
in interface ExcitationComponent
a
- excitation valuepublic void addExcitationSource(ExcitationComponent ex)
addExcitationSource
in interface ExcitationComponent
ex
- excitatation source to be addedpublic void addExcitationSource(ExcitationComponent ex, double gain)
addExcitationSource
in interface ExcitationComponent
ex
- excitatation source to be addedgain
- gain for the sourcepublic boolean removeExcitationSource(ExcitationComponent ex)
removeExcitationSource
in interface ExcitationComponent
ex
- excitatation source to be removedpublic double getExcitationGain(ExcitationComponent ex)
getExcitationGain
in interface ExcitationComponent
ex
- excitatation source whose gain is to be queriedpublic boolean setExcitationGain(ExcitationComponent ex, double gain)
setExcitationGain
in interface ExcitationComponent
ex
- excitatation source whose gain is to be modifiedgain
- new gain for the sourcepublic void setCombinationRule(ExcitationComponent.CombinationRule rule)
setCombinationRule
in interface ExcitationComponent
rule
- rule for combining excitationspublic ExcitationComponent.CombinationRule getCombinationRule()
getCombinationRule
in interface ExcitationComponent
public float[] getRenderColor()
RenderableLine
getRenderColor
in interface RenderableLine
getRenderColor
in class PointSpringBase
public void prerender(RenderList list)
GLRenderable
prerender
in interface GLRenderable
prerender
in class PointSpringBase
public void render(GLRenderer renderer, int flags)
GLRenderable
render
in interface GLRenderable
render
in class AxialSpring
renderer
- renderer object which is used to perform the rendering. Provides pointers
to GL and GLU, along with helper functions.flags
- supplies flags that may be used to control different
aspects of the rendering. Flags are defined in GLRenderer
and currently include
GLRenderer.SELECTED
,
GLRenderer.VERTEX_COLORING
,
GLRenderer.HSV_COLOR_INTERPOLATION
,
GLRenderer.SORT_FACES
, and
GLRenderer.CLEAR_MESH_DISPLAY_LISTS
.public double getNetExcitation()
getNetExcitation
in interface ExcitationComponent
public double computeF(double l, double ldot)
computeF
in class PointSpringBase
public double computePassiveF(double l, double ldot)
public double computeDFdl(double l, double ldot)
computeDFdl
in class PointSpringBase
public double computeDFdldot(double l, double ldot)
computeDFdldot
in class PointSpringBase
public void resetLengthProps()
public double getForceNorm()
public Vector3d getForce()
public void computePassiveForce(Vector3d f)
public double getPassiveForceNorm()
public Vector3d getPassiveForce()
public void scaleDistance(double s)
ScalableUnits
scaleDistance
in interface ScalableUnits
scaleDistance
in class AxialSpring
s
- scaling factorpublic void scaleMass(double s)
ScalableUnits
scaleMass
in interface ScalableUnits
scaleMass
in class AxialSpring
s
- scaling factorpublic void printMuscleDirection()
public int getJacobianType()
ForceEffector
Matrix.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 ForceEffector
getJacobianType
in class AxialSpring
public boolean isEnabled()
public void setEnabled(boolean enabled)
public double getDefaultActivationWeight()
ExcitationComponent
getDefaultActivationWeight
in interface ExcitationComponent
public void getSoftReferences(java.util.List<ModelComponent> refs)
ModelComponentBase
updateReferences()
method will
be called to update its internal reference information.getSoftReferences
in interface ModelComponent
getSoftReferences
in class ModelComponentBase
refs
- list to which soft references are appended