public class MechModel extends MechSystemBase implements TransformableGeometry, ScalableUnits
MechSystemBase.ConstraintForceStateSaverModelComponent.FilePathSaveType, ModelComponent.NavpanelVisibilityMechSystem.ConstraintInfoCompositeComponent.NavpanelDisplay| Modifier and Type | Field and Description |
|---|---|
static PropertyList |
myProps |
DEFAULT_STABILIZATION, DEFAULT_USE_IMPLICIT_FRICTION, myParametricsInSystemMatrix, mySaveForcesAsState, useAllDynamicCompsDEFAULT_MAX_STEP_SIZEDEFAULT_NAVPANEL_DISPLAYenforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNamesTG_ARTICULATED, TG_DRAGGER, TG_PRESERVE_ORIENTATION, TG_SIMULATINGSTATE_IS_VOLATILECOMPUTE_CONTACTS, UPDATE_CONTACTSTRANSPARENT, TWO_DIMENSIONAL| Constructor and Description |
|---|
MechModel() |
MechModel(java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAttachment(DynamicAttachmentComp ax) |
void |
addAxialSpring(AxialSpring s) |
void |
addBodyConnector(BodyConnector c) |
void |
addConstrainer(ConstrainerBase c) |
void |
addField(FieldComponent fcomp) |
void |
addForceEffector(ForceComponent fe) |
void |
addFrame(Frame rb) |
void |
addFrameMarker(FrameMarker mkr) |
void |
addFrameMarker(FrameMarker mkr,
Frame frame,
Point3d loc) |
FrameMarker |
addFrameMarker(Frame frame,
Point3d loc)
Creates and add a frame marker to a particular frame, with a location
specified relative to the frame's coordinate frame
|
FrameMarker |
addFrameMarkerWorld(Frame frame,
Point3d pos)
Creates and add a frame marker to a particular frame, with a location
specified in world coordinates
|
void |
addFrameSpring(FrameSpring s) |
void |
addGeneralMassBlocks(SparseNumberedBlockMatrix M) |
void |
addMeshBody(MeshComponent mcomp)
Adds a mesh component to the
meshBodies list of this model. |
void |
addModel(MechSystemModel m) |
void |
addMultiPointSpring(MultiPointSpring s) |
void |
addMuscleExciter(MuscleExciter mex) |
void |
addParticle(Particle p) |
void |
addPoint(Point p) |
void |
addRenderable(RenderableComponent rb) |
void |
addRigidBody(RigidBody rb) |
void |
addTransformableDependencies(TransformGeometryContext context,
int flags)
Adds to
context any transformable components which should be
transformed as the same time as this component. |
void |
attachAxialSpring(Point pnt0,
Point pnt1,
AxialSpring s) |
void |
attachFrame(Frame frame,
FrameAttachable comp)
Attaches a frame to a FrameAttachable component, using each
component's current position state.
|
void |
attachFrame(Frame frame,
FrameAttachable comp,
RigidTransform3d TFW)
Attaches a frame to a FrameAttachable component, with the
initial pose of the frame described by
TFWusin
component's current position state. |
void |
attachFrameSpring(Frame frameA,
Frame frameB,
FrameSpring s) |
ComponentList<DynamicAttachmentComp> |
attachments() |
void |
attachPoint(Point p1,
PointAttachable comp)
Attaches a particle to a PointAttachable component, using both
component's current position state.
|
void |
attachPoint(Point p1,
RigidBody body,
Point3d loc) |
RenderableComponentList<AxialSpring> |
axialSprings() |
RenderableComponentList<BodyConnector> |
bodyConnectors() |
DynamicComponent |
checkVelocityStability()
Checks the velocity stability of this system.
|
void |
clear() |
void |
clearAxialSprings() |
void |
clearBodyConnectors() |
boolean |
clearCollisionBehavior(Collidable c0,
Collidable c1)
Clears the collision behavior that was previously set using one of the
setCollisionBehavior methods. |
void |
clearCollisionBehaviors()
Clears any collision behaviors that have been set using the
setCollisionBehavior methods. |
boolean |
clearCollisionResponse(Collidable c0,
Collidable c1)
Clears the collision response that was previously set using one of the
setCollisionResponse methods. |
void |
clearCollisionResponses()
Clears any collision responses that have been set using the
setCollisionResponse() methods. |
void |
clearConstrainers() |
void |
clearFields() |
void |
clearForceEffectors() |
void |
clearFrameMarkers() |
void |
clearFrames() |
void |
clearFrameSprings() |
void |
clearMeshBodies()
Removes all mesh components from the
meshBodies list of this model. |
void |
clearModels() |
void |
clearMultiPointSprings() |
void |
clearMuscleExciters() |
void |
clearParticles() |
void |
clearPoints() |
void |
clearRenderables() |
void |
clearRigidBodies() |
int |
combineMatrixTypes(int type1,
int type2) |
void |
componentChanged(ComponentChangeEvent e)
Notifies this composite component that a change has occured within one or
more of its descendants.
|
double |
computeDefaultPenetrationTol()
Computes a default value for the penetration tolerance based
on the radius of this MechModel.
|
double |
computeDefaultWrapKnotDensity()
Computes a default value for the wrap knot density, based on the
radius of this MechModel.
|
ComponentListView<ConstrainerBase> |
constrainers() |
boolean |
detachFrame(Frame frame) |
boolean |
detachPoint(Point p1) |
void |
dispose()
Called when the model is discarded.
|
ComponentListView<ForceComponent> |
forceEffectors() |
PointList<FrameMarker> |
frameMarkers() |
RenderableComponentList<Frame> |
frames() |
RenderableComponentList<FrameSpring> |
frameSprings() |
CollisionBehavior |
getActingCollisionBehavior(Collidable c0,
Collidable c1)
Returns the behavior that controls collisions for a pair of specific
collidables
c0 and c1. |
SparseBlockMatrix |
getActiveStiffnessMatrix() |
boolean |
getAddConstraintForces() |
boolean |
getAddFrameMarkerStiffness()
Queries whether frame marker rotational effects are added to
the stiffness matrix.
|
PropertyList |
getAllPropertyInfo()
Returns a list giving static information about all properties exported by
this object.
|
void |
getAttachments(java.util.List<DynamicAttachment> list,
int level) |
void |
getAuxStateComponents(java.util.List<HasNumericState> list,
int level) |
void |
getCollidables(java.util.List<Collidable> list,
int level) |
CollisionBehavior |
getCollisionBehavior(Collidable c0,
Collidable c1)
Returns the collision behavior that was previously set using one of the
setCollisionBehavior methods. |
CollisionManager |
getCollisionManager() |
CollisionResponse |
getCollisionResponse(Collidable c0,
Collidable c1)
Returns the collision response that was previously set using one of the
setCollisionResponse methods. |
void |
getConstrainers(java.util.List<Constrainer> list,
int level) |
CollisionBehavior |
getDefaultCollisionBehavior(Collidable.Group group0,
Collidable.Group group1)
Gets the default collision behavior for a specified pair of primary
collidable groups.
|
void |
getDynamicComponents(java.util.List<DynamicComponent> comps) |
void |
getDynamicComponents(java.util.List<DynamicComponent> active,
java.util.List<DynamicComponent> attached,
java.util.List<DynamicComponent> parametric) |
java.awt.Color |
getExcitationColor() |
PropertyMode |
getExcitationColorMode() |
ComponentList<FieldComponent> |
getFields() |
void |
getForceEffectors(java.util.List<ForceEffector> list,
int level) |
double |
getFrameDamping() |
PropertyMode |
getFrameDampingMode() |
double |
getFriction()
Returns the global friction coefficient in the collision manager for this
MechModel.
|
Vector3d |
getGravity() |
PropertyMode |
getGravityMode() |
double |
getInertialDamping() |
PropertyMode |
getInertialDampingMode() |
MechSystemSolver.Integrator |
getIntegrator() |
void |
getMassMatrixValues(SparseNumberedBlockMatrix M,
VectorNd f,
double t) |
double |
getMaxColoredExcitation() |
PropertyMode |
getMaxColoredExcitationMode() |
ComponentList<MuscleExciter> |
getMuscleExciters() |
double |
getPenetrationTol()
Returns the default distance by which collidable bodies are allowed to
interpenetrate each other in order to preserve contact stability.
|
PropertyMode |
getPenetrationTolMode() |
double |
getPointDamping() |
PropertyMode |
getPointDampingMode() |
double |
getRadius()
Returns an estimate of the radius of components of this MechModel.
|
double |
getRotaryDamping() |
PropertyMode |
getRotaryDampingMode() |
double |
getRotaryLimitTol()
Queries the rotary limit tolerance for this MechModel.
|
PropertyMode |
getRotaryLimitTolMode() |
void |
getSlaveObjectComponents(java.util.List<HasSlaveObjects> list,
int level)
Should be overridden in subclasses to return all the HasSlaveObjects
components within this model.
|
int |
getStaticIncrements() |
double |
getStaticTikhonovFactor() |
SparseBlockMatrix |
getStiffnessMatrix(java.util.List<SolveMatrixModifier> modifiers)
Returns the regular active stiffness matrix used by the
ArtiSynth solver.
|
SparseBlockMatrix |
getTrueStiffnessMatrix() |
double |
getWrapKnotDensity()
Returns the default knot density for wrapping strands in
MultiPointSpring and MultiPointSpring. |
PropertyMode |
getWrapKnotDensityMode() |
SparseBlockMatrix |
getYPRStiffnessMatrix(java.util.List<SolveMatrixModifier> modifiers)
Returns the true active stiffness matrix with frame orientation
expressed using yaw-pitch-roll coordinates.
|
boolean |
hasState()
Queries if this component has state.
|
static boolean |
isActive(DynamicComponent c) |
boolean |
isBilateralStructureConstant()
Queries whether or not the matrix structure of the bilateral constraints
returned by this system is constant for a given structure version.
|
static MechModel |
lowestCommonModel(ModelComponent comp1,
ModelComponent comp2) |
RenderableComponentList<MeshComponent> |
meshBodies()
Returns the list used to store mesh component in this model.
|
ComponentListView<MechSystemModel> |
models() |
void |
mulInverseMass(SparseBlockMatrix M,
VectorNd a,
VectorNd f) |
RenderableComponentList<MultiPointSpring> |
multiPointSprings() |
static MechModel |
nearestMechModel(ModelComponent c)
Returns the nearest MechModel, if any, that is an ancestor of a specific
component.
|
void |
notifyParentOfChange(ComponentChangeEvent e)
Notifies the parent of this component (if any) of changes within in its
descendants.
|
PointList<Particle> |
particles() |
PointList<Point> |
points() |
StepAdjustment |
preadvance(double t0,
double t1,
int flags)
Prepares this model for advance from time t0 to time t1.
|
void |
projectRigidBodyPositionConstraints() |
void |
recursivelyFinalizeAdvance(StepAdjustment stepAdjust,
double t0,
double t1,
int flags,
int level) |
void |
recursivelyInitialize(double t,
int level) |
void |
recursivelyPrepareAdvance(double t0,
double t1,
int flags,
int level) |
void |
removeAxialSpring(AxialSpring s) |
void |
removeBodyConnector(BodyConnector c) |
void |
removeConstrainer(ConstrainerBase c) |
boolean |
removeField(FieldComponent fcomp) |
void |
removeForceEffector(ForceEffector fe) |
void |
removeFrame(Frame rb) |
void |
removeFrameMarker(FrameMarker mkr) |
void |
removeFrameSpring(FrameSpring s) |
boolean |
removeMeshBody(MeshComponent mcomp)
Removes a mesh component from the
meshBodies list of this model. |
boolean |
removeModel(MechSystemModel m) |
void |
removeMultiPointSpring(MultiPointSpring s) |
boolean |
removeMuscleExciter(MuscleExciter mex) |
void |
removeParticle(Particle p) |
void |
removePoint(Point p) |
boolean |
removeRenderable(RenderableComponent rb) |
void |
removeRigidBody(RigidBody rb) |
void |
render(Renderer renderer,
int flags)
Render this object using the functionality of the supplied
Renderer. |
ComponentList<RenderableComponent> |
renderables() |
RenderableComponentList<RigidBody> |
rigidBodies() |
void |
scaleDistance(double s)
Scales all distance coordinates.
|
void |
scaleMass(double s)
Scales all mass units.
|
void |
scan(ReaderTokenizer rtok,
java.lang.Object ref)
Scans this element from a ReaderTokenizer.
|
void |
setAddConstraintForces(boolean enable) |
void |
setAddFrameMarkerStiffness(boolean enable)
Sets whether frame marker rotational effects are added to the stiffness
matrix.
|
void |
setBounds(double xmin,
double ymin,
double zmin,
double xmax,
double ymax,
double zmax) |
void |
setBounds(Point3d pmin,
Point3d pmax) |
CollisionBehavior |
setCollisionBehavior(Collidable c0,
Collidable c1,
boolean enabled)
Enables or disables collisions for a specified pair of collidables
c0 and c1, overriding the default behavior or
any behavior specified for the pair with previous
setBehavior calls. |
CollisionBehavior |
setCollisionBehavior(Collidable c0,
Collidable c1,
boolean enabled,
double mu)
Sets the collision behavior for a specified pair of collidables
c0 and c1, overriding the default behavior and
any behavior specified for the pair with previous
setBehavior calls. |
void |
setCollisionBehavior(Collidable c0,
Collidable c1,
CollisionBehavior behavior)
Sets the collision behavior for a specified pair of collidables
c0 and c1, overriding the default behavior and
any behavior specified for the pair with previous
setBehavior calls. |
CollisionResponse |
setCollisionResponse(Collidable c0,
Collidable c1)
Sets and returns a collision response for a specified pair of collidables
c0 and c1, removing any response that has been
previoulsy specified for the same pair. |
void |
setCollisionResponse(Collidable c0,
Collidable c1,
CollisionResponse response)
Sets the collision response for a specified pair of collidables
c0 and c1, removing any response that has been
previoulsy specified for the same pair. |
void |
setCompliantContact()
Sets the default behavior for collisions to be compliant, using estimated
values for the compliance, damping, and stiction creep.
|
void |
setCompliantContact(double c,
double d,
double sc)
Sets the default behavior for collisions to be compliant, with a
specified compliance, damping, and stiction creep.
|
void |
setDefaultCollisionBehavior(boolean enabled,
double mu)
Specifies the default collision behavior for all primary collidable group
pairs (Rigid-Rigid, Rigid-Deformable, Deformable-Deformable,
Deformable-Self) associated with this MechModel.
|
void |
setDefaultCollisionBehavior(Collidable.Group group0,
Collidable.Group group1,
boolean enabled,
double mu)
Sets the default collision behavior, for this MechModel, for a specified
pair of generic collidable groups.
|
void |
setDefaultCollisionBehavior(Collidable.Group group0,
Collidable.Group group1,
CollisionBehavior behavior)
Sets the default collision behavior, for this MechModel, for a specified
pair of collidable groups.
|
void |
setDefaultCollisionBehavior(CollisionBehavior behavior)
Specifies a default collision behavior for all primary collidable group
pairs (Rigid-Rigid, Rigid-Deformable, Deformable-Deformable,
Deformable-Self) associated with this MechModel.
|
void |
setExcitationColor(java.awt.Color color) |
void |
setExcitationColorMode(PropertyMode mode) |
void |
setFrameDamping(double d) |
void |
setFrameDampingMode(PropertyMode mode) |
void |
setFriction(double mu)
Sets the global friction coefficient in the collision manager for this
MechModel.
|
void |
setGravity(double gx,
double gy,
double gz) |
void |
setGravity(Vector3d g) |
void |
setGravityMode(PropertyMode mode) |
void |
setInertialDamping(double d) |
void |
setInertialDampingMode(PropertyMode mode) |
void |
setMaxColoredExcitation(double excitation) |
void |
setMaxColoredExcitationMode(PropertyMode mode) |
void |
setPenetrationTol(double tol)
Sets the default distance by which collidable bodies are allowed to
interpenetrate each other in order to preserve contact stability.
|
void |
setPenetrationTolIfNecessary() |
void |
setPenetrationTolMode(PropertyMode mode) |
void |
setPointDamping(double d) |
void |
setPointDampingMode(PropertyMode mode) |
void |
setRotaryDamping(double d) |
void |
setRotaryDampingMode(PropertyMode mode) |
void |
setRotaryLimitTol(double tol)
Sets the rotary limit tolerance for this MechModel.
|
void |
setRotaryLimitTolMode(PropertyMode mode) |
void |
setStaticIncrements(int n) |
void |
setStaticTikhonovFactor(double eps) |
void |
setWrapKnotDensity(double p)
Sets the default knot density for wrapping strands in
MultiPointSpring and MultiPointSpring. |
void |
setWrapKnotDensityMode(PropertyMode mode) |
static MechModel |
topMechModel(ModelComponent comp)
Returns the topmost MechModel, if any, that is associated with
a specific component.
|
void |
transformGeometry(AffineTransform3dBase X)
Applies an affine transformation to the geometry of this component.
|
void |
transformGeometry(GeometryTransformer gtr,
TransformGeometryContext context,
int flags)
Transforms the geometry of this component, using the geometry transformer
gtr to transform its individual attributes. |
void |
updateBounds(Vector3d pmin,
Vector3d pmax)
Update the minimum and maximum points for this object.
|
void |
updateWrapSegments()
Updates the wrapping segments for all MultiPointSprings in this model.
|
addActivePosImpulse, addAttachmentJacobian, addAttachmentSolveBlocks, addGeneralSolveBlocks, addPosJacobian, addVelJacobian, advance, advanceAuxState, applyAttachmentForces, buildMassMatrix, buildSolveMatrix, closePrintStateFile, collectInitialForces, copy, createState, createVelocityJacobian, getActiveDampingMatrix, getActiveDynamicComponents, getActiveForces, getActiveMass, getActiveMassMatrix, getActivePosDerivative, getActivePosState, getActivePosStateSize, getActiveVelState, getActiveVelState, getActiveVelStateSize, getAttachmentConstraints, getAttachmentDerivatives, getAuxAdvanceState, getAuxVarDerivative, getAuxVarState, getAuxVarStateSize, getBilateralConstraints, getBilateralConstraintSizes, getBilateralForces, getBilateralForces, getBilateralInfo, getDefaultMatrixSolver, getDefaultStabilization, getDefaultUseImplicitFriction, getDynamicComponents, getDynamicDOFs, getDynamicsEnabled, getForceEffectors, getForces, getFrictionConstraints, getFrictionForces, getFrictionForces, getFrictionState, getFrictionState, getInitialState, getInverseMassMatrix, getMassMatrix, getMatrixSolver, getMatrixSolverRange, getNumBilateralForces, getNumUnilateralForces, getParametricForces, getParametricPosState, getParametricPosStateSize, getParametricPosTarget, getParametricVelState, getParametricVelStateSize, getParametricVelTarget, getPenetrationLimit, getPrintState, getProfiling, getSolveMatrixType, getSolver, getStabilization, getState, getStructureVersion, getUnilateralConstraints, getUnilateralConstraintSizes, getUnilateralForces, getUnilateralForces, getUnilateralInfo, getUnilateralState, getUnilateralState, getUpdateForcesAtStepEnd, getUpdateForcesAtStepEndMode, getUseImplicitFriction, initialize, maxFrictionConstraintSets, numActiveComponents, numAttachedComponents, numParametricComponents, openPrintStateFile, placeDynamicComponent, printActiveMass, printActiveMass, printActiveStiffness, printActiveStiffness, reduceVelocityJacobian, reopenPrintStateFile, setActiveForces, setActivePosState, setActiveVelState, setAuxAdvanceState, setAuxVarState, setBilateralForces, setBilateralForces, setDefaultMatrixSolver, setDefaultStabilization, setDefaultUseImplicitFriction, setDynamicsEnabled, setForces, setFrictionForces, setFrictionForces, setFrictionState, setFrictionState, setIntegrator, setMatrixSolver, setParametricForces, setParametricPosState, setParametricVelState, setPenetrationLimit, setPrintState, setPrintState, setProfiling, setStabilization, setState, setUnilateralForces, setUnilateralForces, setUnilateralState, setUnilateralState, setUpdateForcesAtStepEnd, setUpdateForcesAtStepEndMode, setUseImplicitFriction, topMechSystem, updateAttachmentPos, updateAttachmentVel, updateConstraints, updateDynamicComponentLists, updateForceComponentList, updateForces, updatePosState, updateVelState, writeBilateralConstraintMatrix, writeBilateralConstraintMatrix, writeMassMatrix, writeMassMatrix, writePrintStateHeader, writeStiffnessMatrix, writeStiffnessMatrixcreateRenderProps, getRenderHints, getRenderProps, getSelection, isSelectable, numSelectionQueriesNeeded, prerender, setRenderPropsactionPerformed, copy, getDefaultMaxStepSize, getMaxStepSize, getMenuItems, hasParameterizedType, hierarchyContainsReferences, setDefaultMaxStepSize, setMaxStepSizeadd, add, addAll, addComponents, addFixed, addNumbered, clone, contains, contains, containsAll, ensureCapacity, findComponent, get, get, getByNumber, getChildren, getMinNumber, getNavpanelDisplay, getNumberLimit, getOneBasedNumbering, getParameterType, getShortName, hasChildren, incrementNumbering, indexOf, invalidateNumbers, isEditable, isEmpty, iterator, nextComponentNumber, numComponents, postscan, remove, remove, removeAll, removeAll, removeComponents, resetNumbersToIndices, retainAll, set, setEditable, setNavpanelDisplay, setNumbered, setOneBasedNumbering, setShortName, size, toArray, toArray, updateNameMapcheckFlag, checkName, checkNameUniqueness, clearFlag, connectToHierarchy, createTempFlag, disconnectFromHierarchy, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, isFixed, isMarked, isScanning, isSelected, isWritable, makeValidName, makeValidName, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setScanning, setSelected, setWritable, updateReferences, writeequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittransformPrioritygetMaxStepSizeconnectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, isFixed, isMarked, isSelected, setFixed, setMarked, setName, setNumber, setParent, setSelected, setWritable, updateReferencesgetPropertygetChildren, hasChildrenpostscanisWritable, writegetNameequals, hashCode, parallelStream, removeIf, spliterator, streamrecursivelyFindpublic static PropertyList myProps
public PropertyList getAllPropertyInfo()
HasPropertiesgetAllPropertyInfo in interface HasPropertiesgetAllPropertyInfo in class RenderableModelBasepublic void clear()
clear in interface java.util.Collection<ModelComponent>clear in class ComponentList<ModelComponent>public boolean getAddFrameMarkerStiffness()
true if frame marker rotational are added to
the stiffness matrix.public void setAddFrameMarkerStiffness(boolean enable)
false by default. If enabled, it will cause the
stiffness matrix to be asymmetric.enable - if true, causes frame marker rotational to
be added to the stiffness matrix.public double getRadius()
public void setPenetrationTol(double tol)
MechModel.tol - desired penetration tolerancepublic double getPenetrationTol()
public PropertyMode getPenetrationTolMode()
public void setPenetrationTolMode(PropertyMode mode)
public void setPenetrationTolIfNecessary()
public double computeDefaultPenetrationTol()
public void setWrapKnotDensity(double p)
MultiPointSpring and MultiPointSpring. This is the number of
knots used per unit distance. When a wrapping strand is initialized, and
the number of knots is not explicitly specified, this number is
multiplied by the strand's initial length to determine the number of
knots.
If specified as a negative number, the knot density will be set to a
default value based on the overall size of this MechModel.
p - desired knot densitypublic double getWrapKnotDensity()
MultiPointSpring and MultiPointSpring. See setWrapKnotDensity(double) for details.public PropertyMode getWrapKnotDensityMode()
public void setWrapKnotDensityMode(PropertyMode mode)
public double computeDefaultWrapKnotDensity()
public void setRotaryLimitTol(double tol)
tol - new rotary limit tolerancepublic double getRotaryLimitTol()
public PropertyMode getRotaryLimitTolMode()
public void setRotaryLimitTolMode(PropertyMode mode)
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 void setFriction(double mu)
mu - global friction coefficientpublic double getFriction()
public void setDefaultCollisionBehavior(boolean enabled,
double mu)
setDefaultCollisionBehavior(behavior).enabled - if true, enables collisionsmu - friction coefficient (ignored if enabled is false). If less
than zero, the value is undefined and will be inherited from the global
setting in this MechModel's collision manager.setFriction(double),
getFriction()public void setDefaultCollisionBehavior(CollisionBehavior behavior)
This method is equivalent to calling
setDefaultCollisionBehavior (Collidable.All, Collidable.All, behavior)
behavior - desired collision behaviorpublic CollisionBehavior getDefaultCollisionBehavior(Collidable.Group group0, Collidable.Group group1)
Collidable.Rigid
and Collidable.Deformable. In addition, the group Collidable.Self can be paired with Collidable.Deformable to
obtain the default behavior for deformable self collisions; Collidable.Self cannot be paired with other groups.group0 - first generic collidable groupgroup1 - second generic collidable grouppublic void setDefaultCollisionBehavior(Collidable.Group group0, Collidable.Group group1, CollisionBehavior behavior)
Collidable.Rigid and Collidable.Deformable, as
well as the composite groups Collidable.AllBodies (rigid and
deformable) and Collidable.All (all bodies plus self collision).
In addition, the group Collidable.Self can be paired with Collidable.Deformable, Collidable.AllBodies or Collidable.All to set the default self-collision behavior for deformable
compound bodies. Collidable.Self cannot be paired with Collidable.Self or Collidable.Rigid.
This method works by setting the behaviors for the appropriate primary collidable group pairs (Rigid-Rigid, Rigid-Deformable, Deformable-Deformable, Deformable-Self) implied by the specified groups.
group0 - first generic collidable groupgroup1 - second generic collidable groupbehavior - desired collision behaviorpublic void setDefaultCollisionBehavior(Collidable.Group group0, Collidable.Group group1, boolean enabled, double mu)
setDefaultCollisionBehavior(group0,group1,behavior), where a default
CollisionBehavior object is created and set to reflect the
specified enabled and friction settings.group0 - first generic collidable groupgroup1 - second generic collidable groupenabled - if true, enables collisionsmu - friction coefficient (ignored if enabled is false). If
less than zero, the value is undefined and will be inherited from the global
setting in this MechModel's collision manager.setFriction(double),
getFriction()public CollisionBehavior setCollisionBehavior(Collidable c0, Collidable c1, boolean enabled)
c0 and c1, overriding the default behavior or
any behavior specified for the pair with previous
setBehavior calls. This is a convenience wrapper for setCollisionBehavior(c0,c1,behavior), where a default
CollisionBehavior object is created with the specified
enabled setting and a friction coefficient of 0.c0 - first collidablec1 - second collidableenabled - if true, enables collisionspublic CollisionBehavior setCollisionBehavior(Collidable c0, Collidable c1, boolean enabled, double mu)
c0 and c1, overriding the default behavior and
any behavior specified for the pair with previous
setBehavior calls. This is a convenience wrapper for setCollisionBehavior(c0,c1,behavior), where a default
CollisionBehavior object is created and set to reflect the
specified enabled and friction settings.c0 - first collidablec1 - second collidableenabled - if true, enables collisionsmu - friction coefficient (ignored if enabled is false). If less
than zero, the value is undefined and will be inherited from the global
setting in this MechModel's collision manager.
setting for this MechModel.CollisionBehavior object describing the collision
behaviorsetFriction(double),
getFriction()public void setCollisionBehavior(Collidable c0, Collidable c1, CollisionBehavior behavior)
c0 and c1, overriding the default behavior and
any behavior specified for the pair with previous
setBehavior calls. The behavior specified by this method
will be applied only among collidables for which this
MechModel is the lowest common model.
Since behaviors are added to the collision manager as subcomponents,
the specified behavior cannot be currently set and in particular can not
be reused in other setCollisionBehavior calls. If reuse
is desired, the behavior should be copied:
CollisionBehavior behav = new CollisionBehavior();
behav.setDrawIntersectionContours (true);
mesh.setCollisionBehavior (col0, col1, behav);
behav = new CollisionBehavior(behav);
mesh.setCollisionBehavior (col2, col3, behav); // OK
There are restrictions on what pair of collidables can be
specified. The first collidable must be a specific collidable object. The
second may be a collidable group, such as Collidable.Rigid Collidable.All, or Collidable.Self. Self-collision is specified
either using the group Collidable.Self or by specifying c0
== c1. If self-collision is specified, then c0 must
be deformable and must also be a compound collidable (since
self-intersection is currently only supported among the sub-collidables
of a compound collidable).
If c0 and/or c1 are specific collidables, then
they must both be contained within the component hierarchy of this
MechModel. In addition, if both c0 and
c1 are specific collidables, then one cannot be a
sub-collidable of the other, and this MechModel must be the
lowest common model containing both of them.
If c0 or c1 are compound collidables, then
the behavior is applied to all appropriate pairs of their
sub-collidables. If self-collision is specified, then the behavior is
applied among all sub-collidables whose getCollidable() method returns Colidability.ALL or
Colidability.INTERNAL.
This method works by adding the indicated behavior to the collision
manager as a subcomponent. If a behavior has been previously set for the
specified pair, the previous behavior is removed. The behavior can be
queried later using getCollisionBehavior(c0,c1) and removed using clearCollisionBehavior(c0,c1).
c0 - first collidablec1 - second collidablebehavior - desired collision behaviorpublic CollisionBehavior getCollisionBehavior(Collidable c0, Collidable c1)
setCollisionBehavior methods. If no behavior for the
indicated pair was set, null is returned.c0 - first collidablec1 - second collidablepublic boolean clearCollisionBehavior(Collidable c0, Collidable c1)
setCollisionBehavior methods. If no behavior for the
indicated pair was set, the method returns false.c0 - first collidablec1 - second collidabletrue if the specific behavior had been set
and was removedpublic void clearCollisionBehaviors()
setCollisionBehavior methods.public CollisionResponse setCollisionResponse(Collidable c0, Collidable c1)
c0 and c1, removing any response that has been
previoulsy specified for the same pair. This is a convenience wrapper for
setCollisionResponse(c0,c1,response), which creates and returns
the required CollisionResponse object.c0 - first collidablec1 - second collidablepublic void setCollisionResponse(Collidable c0, Collidable c1, CollisionResponse response)
c0 and c1, removing any response that has been
previoulsy specified for the same pair. At every subsequent integration
step, the response object will be updated to contain the current
collision information for the collidable pair. Since responses are added
to the collision manager as subcomponents, the specified response cannot
be currently set.
There are restrictions on what pair of collidables can be
specified. The first collidable must be a specific collidable object. The
second may be a collidable group, such as Collidable.Rigid Collidable.All, or Collidable.Self. Self-collision is specified
either using the group Collidable.Self or by specifying c0
== c1. If self-collision is specified, then c0 must
be deformable and must also be a compound collidable (since
self-intersection is currently only supported among the sub-collidables
of a compound collidable).
If c0 and/or c1 are specific collidables, then
they must both be contained within the component hierarchy of this
MechModel.
If c0 or c1 are compound collidables, then
the response is collected for all appropriate pairs of their
sub-collidables. If self-collision is specified, then the response is
collected for all sub-collidables whose getCollidable() method returns Colidability.ALL or
Colidability.INTERNAL.
This method works by adding the indicated response to the collision
manager as a subcomponent. If a response has been previously set for the
specified pair, the previous response is removed. The response can be
queried later using getCollisionResponse(c0,c1) and removed using clearCollisionResponse(c0,c1).
c0 - first collidablec1 - second collidableresponse - desired collision responsepublic CollisionResponse getCollisionResponse(Collidable c0, Collidable c1)
setCollisionResponse methods. If no response for the
indicated pair was set, null is returned.c0 - first collidablec1 - second collidablepublic boolean clearCollisionResponse(Collidable c0, Collidable c1)
setCollisionResponse methods. If no response for the
indicated pair was set, the method returns false.c0 - first collidablec1 - second collidabletrue if the specific response had been set
and was removedpublic void clearCollisionResponses()
setCollisionResponse() methods.public CollisionBehavior getActingCollisionBehavior(Collidable c0, Collidable c1)
c0 and c1. This will be determined
by the lowest MechModel which contains both c0
and c1, and be either a default behavior, or an override
behavior specified will a setBehavior call. In some cases,
if c0 and/or c1 are not collidable, or if one
or both are compound collidables with different behaviors for their
sub-collidables (see below), no unique controlling behavior will exist
and this method will return null.
Both c0 and c1 must be specific collidables;
collidable groups (such as Collidable.Rigid or Collidable.Group) are not allowed.
If c0 or c1 are compound collidables, then
if the same acting behavior is found among all pairs of sub-collidables
for which collisions are permitted, that behavior is returned; otherwise,
null is returned. In particular, if c0 equals
c1, then this method searches for the same collision
behavior among all sub-collidables of c0 for which
self-intersection is permitted (i.e., those whose getCollidable() method returns
Colidability.ALL or Colidability.INTERNAL).
c0 - first collidablec1 - second collidablenull if such behavior exists.public void getCollidables(java.util.List<Collidable> list, int level)
getCollidables in interface MechSystemModelpublic void setCompliantContact()
r of the model's current bounding sphere, the average mass
m of the model's collidables, and the current magnitude g
for the acceleration of gravity. In order for the estimated values to
make sense, it is important to call this method after the model
has been assembled. If gravity is set to 0, 9.8 is used instead. If there
are no collidable bodies, m is set to 1.
(0.001 r)/(m g), which allows contact
penetrations of 0.001 r under a force of m g.2 sqrt(m/c), where c is the
compliance. This enables critical damping.1e-5 r, so that stiction contacts
can be expected to move by about 0.001 r in 100 seconds. This
allows the creep to be small while still providing a large enough value
to regularize the static friction constraints.This method works by setting the compliance, damping, and stiction
creep properties for the collision manager of this model and all other
MechModels contained within it.
public void setCompliantContact(double c,
double d,
double sc)
> 0, then the contact computations will be
regularized.
This method works by setting the compliance, damping, and stiction
creep properties for the collision manager of this model and all other
MechModels contained within it.
c - complianced - dampingsc - stiction creeppublic CollisionManager getCollisionManager()
public MechSystemSolver.Integrator getIntegrator()
getIntegrator in class MechSystemBasepublic void setStaticTikhonovFactor(double eps)
public double getStaticTikhonovFactor()
public void setStaticIncrements(int n)
public int getStaticIncrements()
public void addParticle(Particle p)
public void removeParticle(Particle p)
public void clearParticles()
public void addPoint(Point p)
public void removePoint(Point p)
public void clearPoints()
public RenderableComponentList<AxialSpring> axialSprings()
public RenderableComponentList<MultiPointSpring> multiPointSprings()
public RenderableComponentList<FrameSpring> frameSprings()
public ComponentListView<ForceComponent> forceEffectors()
public double getPointDamping()
public void setPointDamping(double d)
public PropertyMode getPointDampingMode()
public void setPointDampingMode(PropertyMode mode)
public double getFrameDamping()
public void setFrameDamping(double d)
public PropertyMode getFrameDampingMode()
public void setFrameDampingMode(PropertyMode mode)
public double getRotaryDamping()
public void setRotaryDamping(double d)
public PropertyMode getRotaryDampingMode()
public void setRotaryDampingMode(PropertyMode mode)
public double getInertialDamping()
public void setInertialDamping(double d)
public PropertyMode getInertialDampingMode()
public void setInertialDampingMode(PropertyMode mode)
public Vector3d getGravity()
public void setGravity(Vector3d g)
public void setGravity(double gx,
double gy,
double gz)
public PropertyMode getGravityMode()
public void setGravityMode(PropertyMode mode)
public void addAxialSpring(AxialSpring s)
public void attachAxialSpring(Point pnt0, Point pnt1, AxialSpring s)
public void removeAxialSpring(AxialSpring s)
public void clearAxialSprings()
public void addMultiPointSpring(MultiPointSpring s)
public void removeMultiPointSpring(MultiPointSpring s)
public void clearMultiPointSprings()
public void updateWrapSegments()
public void addFrameSpring(FrameSpring s)
public void attachFrameSpring(Frame frameA, Frame frameB, FrameSpring s)
public void removeFrameSpring(FrameSpring s)
public void clearFrameSprings()
public void addForceEffector(ForceComponent fe)
public void removeForceEffector(ForceEffector fe)
public void clearForceEffectors()
public void addMuscleExciter(MuscleExciter mex)
public boolean removeMuscleExciter(MuscleExciter mex)
public ComponentList<MuscleExciter> getMuscleExciters()
public void clearMuscleExciters()
public void addField(FieldComponent fcomp)
public boolean removeField(FieldComponent fcomp)
public void clearFields()
public ComponentList<FieldComponent> getFields()
public RenderableComponentList<RigidBody> rigidBodies()
public void addRigidBody(RigidBody rb)
public void removeRigidBody(RigidBody rb)
public void clearRigidBodies()
public RenderableComponentList<Frame> frames()
public void addFrame(Frame rb)
public void removeFrame(Frame rb)
public void clearFrames()
public RenderableComponentList<MeshComponent> meshBodies()
public void addMeshBody(MeshComponent mcomp)
meshBodies list of this model.mcomp - mesh component to be addedpublic boolean removeMeshBody(MeshComponent mcomp)
meshBodies list of this model.mcomp - mesh component to be removedtrue if the component was present and actually removedpublic void clearMeshBodies()
meshBodies list of this model.public void addFrameMarker(FrameMarker mkr, Frame frame, Point3d loc)
public FrameMarker addFrameMarker(Frame frame, Point3d loc)
frame - frame object to add a marker toloc - marker location in frame coordinatespublic FrameMarker addFrameMarkerWorld(Frame frame, Point3d pos)
frame - frame object to add a marker topos - marker position in world coordinatespublic void addFrameMarker(FrameMarker mkr)
public void removeFrameMarker(FrameMarker mkr)
public void clearFrameMarkers()
public PointList<FrameMarker> frameMarkers()
public RenderableComponentList<BodyConnector> bodyConnectors()
public void addBodyConnector(BodyConnector c)
public void removeBodyConnector(BodyConnector c)
public void clearBodyConnectors()
public ComponentListView<ConstrainerBase> constrainers()
public void addConstrainer(ConstrainerBase c)
public void removeConstrainer(ConstrainerBase c)
public void clearConstrainers()
public ComponentList<RenderableComponent> renderables()
public void addRenderable(RenderableComponent rb)
public boolean removeRenderable(RenderableComponent rb)
public void clearRenderables()
public ComponentListView<MechSystemModel> models()
public void addModel(MechSystemModel m)
public boolean removeModel(MechSystemModel m)
public void clearModels()
public void attachPoint(Point p1, PointAttachable comp)
p1 - Point to connect. Must currently be a particle.comp - Component to attach the particle to.public boolean detachPoint(Point p1)
public void attachFrame(Frame frame, FrameAttachable comp, RigidTransform3d TFW)
TFWusin
component's current position state. The frame may be relocated
if this is necessary to create an attachment.frame - Frame to connect.comp - component to attach the frame to.TFW - initial desired pose of the frame, in world coordinatespublic void attachFrame(Frame frame, FrameAttachable comp)
frame - Frame to connect.comp - component to attach the frame to.public boolean detachFrame(Frame frame)
public ComponentList<DynamicAttachmentComp> attachments()
public void addAttachment(DynamicAttachmentComp ax)
public void getAttachments(java.util.List<DynamicAttachment> list, int level)
getAttachments in interface MechSystemModelpublic boolean getAddConstraintForces()
public void setAddConstraintForces(boolean enable)
public static boolean isActive(DynamicComponent c)
public void getDynamicComponents(java.util.List<DynamicComponent> active, java.util.List<DynamicComponent> attached, java.util.List<DynamicComponent> parametric)
getDynamicComponents in interface MechSystemModelpublic void getDynamicComponents(java.util.List<DynamicComponent> comps)
getDynamicComponents in interface MechSystemModelpublic boolean isBilateralStructureConstant()
isBilateralStructureConstant in interface MechSystemisBilateralStructureConstant in class MechSystemBasetrue if bilateral constraints have a constant structurepublic void getConstrainers(java.util.List<Constrainer> list, int level)
getConstrainers in interface MechSystemModelpublic void getForceEffectors(java.util.List<ForceEffector> list, int level)
getForceEffectors in interface MechSystemModelpublic void addGeneralMassBlocks(SparseNumberedBlockMatrix M)
addGeneralMassBlocks in interface MechSystemModeladdGeneralMassBlocks in class MechSystemBasepublic void getMassMatrixValues(SparseNumberedBlockMatrix M, VectorNd f, double t)
getMassMatrixValues in interface MechSystemModelpublic void mulInverseMass(SparseBlockMatrix M, VectorNd a, VectorNd f)
mulInverseMass in interface MechSystemmulInverseMass in interface MechSystemModelpublic void getAuxStateComponents(java.util.List<HasNumericState> list, int level)
getAuxStateComponents in interface MechSystemModelpublic void getSlaveObjectComponents(java.util.List<HasSlaveObjects> list, int level)
getSlaveObjectComponents in interface MechSystemModelgetSlaveObjectComponents in class MechSystemBaselist - HasSlaveObjects components should be added to this listpublic void projectRigidBodyPositionConstraints()
public int combineMatrixTypes(int type1,
int type2)
public StepAdjustment preadvance(double t0, double t1, int flags)
ModelBaseIf the method determines that the step size should be
reduced, it can return a StepAdjustment object indicating
the recommended reduction. Otherwise, the method may return
null
The flags argument gives additional information that may
be relevant when advancing the model. Currently implemented
flags include Model.STATE_IS_VOLATILE.
preadvance in interface Modelpreadvance in class MechSystemBaset0 - current time (seconds)t1 - new time to advance to (seconds)flags - additional information relevant to the advancepublic void recursivelyPrepareAdvance(double t0,
double t1,
int flags,
int level)
recursivelyPrepareAdvance in interface MechSystemModelrecursivelyPrepareAdvance in class MechSystemBasepublic void recursivelyFinalizeAdvance(StepAdjustment stepAdjust, double t0, double t1, int flags, int level)
recursivelyFinalizeAdvance in interface MechSystemModelrecursivelyFinalizeAdvance in class MechSystemBasepublic void recursivelyInitialize(double t,
int level)
recursivelyInitialize in interface MechSystemModelrecursivelyInitialize in class MechSystemBasepublic void setBounds(double xmin,
double ymin,
double zmin,
double xmax,
double ymax,
double zmax)
public void scan(ReaderTokenizer rtok, java.lang.Object ref) throws java.io.IOException
ModelComponentBasewrite.scan in interface ModelComponentscan in interface Scannablescan in class ComponentList<ModelComponent>rtok - Tokenizer from which to scan the elementref - optional reference object which can be used for resolving references to
other objectsjava.io.IOException - if an I/O or formatting error occuredpublic void updateBounds(Vector3d pmin, Vector3d pmax)
IsRenderableupdateBounds in interface IsRenderableupdateBounds in class RenderableModelBasepmin - minimum pointpmax - maximum pointpublic void render(Renderer renderer, int flags)
IsRenderableRenderer.render in interface IsRenderablerender in class RenderableModelBaserenderer - provides the functionality used to perform the rendering.flags - flags that may be used to control different
aspects of the rendering. Flags are defined in Renderer
and currently include
Renderer.HIGHLIGHT and
Renderer.SORT_FACES.public void transformGeometry(AffineTransform3dBase X)
TransformGeometryContext.transform (this, X, 0);
transformGeometry in interface TransformableGeometryX - affine transformation to apply to the componentpublic void transformGeometry(GeometryTransformer gtr, TransformGeometryContext context, int flags)
gtr to transform its individual attributes. The
context argument supplies information about what other
components are currently being transformed, and also allows the
requesting of update actions to be performed after all transform called
have completed. The context is also the usual entity that calls
this method, from within its TransformGeometryContext.apply(maspack.geometry.GeometryTransformer, int)
method. The argument flags provides flags to specify
various conditions associated with the the transformation.
At present, the available flags are TransformableGeometry.TG_SIMULATING and
TransformableGeometry.TG_ARTICULATED.
This method is not usually called directly by applications.
Instead, it is typically called from within the
TransformGeometryContext.apply(maspack.geometry.GeometryTransformer, int) method of the context,
which takes care of the various operations needed for a
complete transform operation, including calling
TransformableGeometry.addTransformableDependencies(artisynth.core.modelbase.TransformGeometryContext, int) to collect other
components that should be transformed, calling
TransformableGeometry.transformGeometry(maspack.matrix.AffineTransform3dBase) for each component, notifying
component parents that the geometry has changed, and calling
any requested TransformGeometryActions. More details
are given in the documentation for
TransformGeometryContext.apply(maspack.geometry.GeometryTransformer, int).
TransformGeometryContext provides a number of
static convenience transform methods
which take care of building the context and calling
apply() for a specified set of components.
This method should not
generally call transformGeometry() for its descendant
components. Instead, descendants needing transformation should be
specified by adding them to the context in the method TransformableGeometry.addTransformableDependencies(artisynth.core.modelbase.TransformGeometryContext, int).
transformGeometry in interface TransformableGeometrygtr - transformer implementing the transformcontext - context information, including what other components
are being transformedflags - specifies conditions associated with the transformationpublic void addTransformableDependencies(TransformGeometryContext context, int flags)
context any transformable components which should be
transformed as the same time as this component. This will generally
include descendant components, and may also include other components to
which this component is connected in some way.
This method is generally called from with the
TransformGeometryContext.apply(maspack.geometry.GeometryTransformer, int) method of a
TransformGeometryContext.
addTransformableDependencies in interface TransformableGeometrycontext - context information, to which the dependent components
are added.flags - specifies conditions associated with the transformationpublic void scaleDistance(double s)
ScalableUnitsscaleDistance in interface ScalableUnitss - scaling factorpublic void scaleMass(double s)
ScalableUnitsscaleMass in interface ScalableUnitss - scaling factorpublic boolean hasState()
hasState in interface ModelComponenthasState in class ModelComponentBasetrue if this component has statepublic static MechModel lowestCommonModel(ModelComponent comp1, ModelComponent comp2)
public static MechModel topMechModel(ModelComponent comp)
comp - component to start withcomp, or
null if there is none.public static MechModel nearestMechModel(ModelComponent c)
MechModel, the
component itself returned.c - component to start withcomp, or
null if there is none.public void componentChanged(ComponentChangeEvent e)
ComponentList
This method should propagate the notification up the component hierarchy
by calling notifyParentOfChange.
componentChanged in interface ComponentChangeListenercomponentChanged in interface CompositeComponentcomponentChanged in class ComponentList<ModelComponent>e - optional argument giving specific information about the changepublic void notifyParentOfChange(ComponentChangeEvent e)
componentChanged method.notifyParentOfChange in interface ModelComponentnotifyParentOfChange in class ModelComponentBasee - optional argument giving specific information about the changepublic DynamicComponent checkVelocityStability()
checkVelocityStability in interface MechSystemModelnull if there is no instabilitypublic void dispose()
ModelBasepublic SparseBlockMatrix getActiveStiffnessMatrix()
getActiveStiffnessMatrix in class MechSystemBasepublic SparseBlockMatrix getTrueStiffnessMatrix()
public SparseBlockMatrix getYPRStiffnessMatrix(java.util.List<SolveMatrixModifier> modifiers)
modifiers - if not null, specifies a list
of modifiers to apply to the true stiffness matrix before
converting it to yaw-pitch-roll coordinates.public SparseBlockMatrix getStiffnessMatrix(java.util.List<SolveMatrixModifier> modifiers)
modifiers - if not null, specifies a list
of modifiers to apply to the stiffness matrix.