public class MechModel extends MechSystemBase implements TransformableGeometry, ScalableUnits, MechSystemModel
ModelComponent.NavpanelVisibility
MechSystem.ConstraintInfo, MechSystem.FrictionInfo
CompositeComponent.NavpanelDisplay
Modifier and Type | Field and Description |
---|---|
static PropertyList |
myProps |
myParametricsInSystemMatrix
DEFAULT_NAVPANEL_DISPLAY
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
TG_ARTICULATED, TG_SIMULATING
COMPUTE_CONTACTS, UPDATE_CONTACTS
TRANSPARENT, TWO_DIMENSIONAL
Constructor and Description |
---|
MechModel() |
MechModel(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
void |
addAttachment(DynamicAttachment ax) |
void |
addAxialSpring(AxialSpring s) |
void |
addBodyConnector(BodyConnector c) |
void |
addConstrainer(ConstrainerBase c) |
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)
Adds a frame marker to a particular frame, with the location
specified relative to the frame's coordinate frame
|
void |
addFrameSpring(FrameSpring s) |
void |
addGeneralMassBlocks(SparseBlockMatrix M) |
void |
addMeshBody(MeshComponent rb) |
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
TFW usin
component's current position state. |
void |
attachFrameSpring(Frame frameA,
Frame frameB,
FrameSpring s) |
ComponentList<DynamicAttachment> |
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() |
ComponentListView<BodyConnector> |
bodyConnectors() |
DynamicComponent |
checkVelocityStability()
Checks the velocity stability of this system.
|
void |
clear() |
void |
clearAxialSprings() |
void |
clearBodyConnectors() |
boolean |
clearCollisionBehavior(Collidable a,
Collidable b)
Clears any collision behavior that has been defined for
a and b (using the
setCollisionBehavior() methods)
to override the primary behavior. |
void |
clearCollisionBehaviors()
Clears any collision behaviors that have been defined (using the
setCollisionBehavior() methods) to override the default
collision behaviors betweem pairs of Collidables. |
void |
clearConstrainers() |
void |
clearForceEffectors() |
void |
clearFrameMarkers() |
void |
clearFrames() |
void |
clearFrameSprings() |
void |
clearMeshBodies() |
void |
clearModels() |
void |
clearMultiPointSprings() |
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.
|
ComponentListView<ConstrainerBase> |
constrainers() |
boolean |
detachFrame(Frame frame) |
boolean |
detachPoint(Point p1) |
void |
dispose()
Called when the model is discarded.
|
ComponentListView<ForceComponent> |
forceEffectors() |
RenderableComponentList<FrameMarker> |
frameMarkers() |
ComponentListView<Frame> |
frames() |
ComponentListView<FrameSpring> |
frameSprings() |
boolean |
getAddConstraintForces() |
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<HasAuxState> list,
int level) |
void |
getCollidables(java.util.List<Collidable> list,
int level) |
CollisionBehavior |
getCollisionBehavior(Collidable a,
Collidable b)
Returns the collision behavior for a specified pair of collidables
a and b . |
CollisionManager |
getCollisionManager() |
void |
getConstrainers(java.util.List<Constrainer> list,
int level) |
CollisionBehavior |
getDefaultCollisionBehavior(Collidable typeA,
Collidable typeB)
Gets the default collision behavior
for a specified pair of generic collidable types.
|
void |
getDynamicComponents(java.util.List<DynamicComponent> active,
java.util.List<DynamicComponent> attached,
java.util.List<DynamicComponent> parametric) |
java.awt.Color |
getExcitationColor() |
PropertyMode |
getExcitationColorMode() |
void |
getForceEffectors(java.util.List<ForceEffector> list,
int level) |
double |
getFrameDamping() |
PropertyMode |
getFrameDampingMode() |
Vector3d |
getGravity() |
PropertyMode |
getGravityMode() |
MechSystemSolver.Integrator |
getIntegrator() |
void |
getMassMatrixValues(SparseBlockMatrix M,
VectorNd f,
double t) |
MechSystemSolver.MatrixSolver |
getMatrixSolver() |
double |
getMaxColoredExcitation() |
PropertyMode |
getMaxColoredExcitationMode() |
ComponentList<MuscleExciter> |
getMuscleExciters() |
double |
getPenetrationTol() |
PropertyMode |
getPenetrationTolMode() |
double |
getPointDamping() |
PropertyMode |
getPointDampingMode() |
double |
getRadius()
Returns an estimate of the radius of components of this MechModel.
|
double |
getRotaryDamping() |
PropertyMode |
getRotaryDampingMode() |
void |
getSlaveObjectComponents(java.util.List<HasSlaveObjects> list,
int level)
Should be overridden in subclasses to return all the HasSlaveObjects '
components within this model.
|
boolean |
hasState()
Returns true if this component has state.
|
static boolean |
isActive(DynamicComponent c) |
static MechModel |
lowestCommonModel(ModelComponent comp1,
ModelComponent comp2) |
ComponentListView<MeshComponent> |
meshBodies() |
ComponentListView<MechSystemModel> |
models() |
void |
mulInverseMass(SparseBlockMatrix M,
VectorNd a,
VectorNd f) |
RenderableComponentList<MultiPointSpring> |
multiPointSprings() |
PointList<Particle> |
particles() |
PointList<Point> |
points() |
StepAdjustment |
preadvance(double t0,
double t1,
int flags)
Prepares this object 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 |
removeAxialSpring(AxialSpring s) |
void |
removeBodyConnector(BodyConnector c) |
void |
removeConstrainer(ConstrainerBase c) |
void |
removeForceEffector(ForceEffector fe) |
void |
removeFrame(Frame rb) |
void |
removeFrameMarker(FrameMarker mkr) |
void |
removeFrameSpring(FrameSpring s) |
void |
removeMeshBody(MeshComponent rb) |
boolean |
removeModel(MechSystemModel m) |
void |
removeMultiPointSpring(MultiPointSpring s) |
boolean |
removeMuscleExciter(MuscleExciter mex) |
void |
removeParticle(Particle p) |
void |
removePoint(Point p) |
void |
removeRenderable(RenderableComponent rb) |
void |
removeRigidBody(RigidBody rb) |
void |
render(Renderer renderer,
int flags)
Render this object using the functionality of the supplied
Renderer . |
ComponentListView<RenderableComponent> |
renderables() |
ComponentListView<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 |
setBounds(double xmin,
double ymin,
double zmin,
double xmax,
double ymax,
double zmax) |
void |
setBounds(Point3d pmin,
Point3d pmax) |
void |
setCollisionBehavior(Collidable a,
Collidable b,
boolean enabled)
Enables or disables collisions for a specified pair of collidables,
overriding, if necessary, the primary collision behavior.
|
void |
setCollisionBehavior(Collidable a,
Collidable b,
boolean enabled,
double mu)
Sets collision behavior for a specified pair of collidables, overriding,
if necessary, the primary behavior.
|
void |
setCollisionBehavior(Collidable a,
Collidable b,
CollisionBehavior behavior)
Sets collision behavior for a specified pair of collidables
a and b , overriding, if necessary, the primary
behavior. |
void |
setDefaultCollisionBehavior(boolean enabled,
double mu)
Specifies the default collision behavior for all default pairs
(RigidBody-RigidBody, RigidBody-Deformable, Deformable-Deformable,
Deformable-Self) associated with this MechModel.
|
void |
setDefaultCollisionBehavior(Collidable typeA,
Collidable typeB,
boolean enabled,
double mu)
Sets the default collision behavior, for this MechModel, for a specified
pair of generic collidable types.
|
void |
setDefaultCollisionBehavior(Collidable typeA,
Collidable typeB,
CollisionBehavior behavior)
Sets the default collision behavior, for this MechModel, for a specified
pair of generic collidable types.
|
void |
setDefaultCollisionBehavior(CollisionBehavior behavior)
Specifies a default collision behavior for all default pairs
(RigidBody-RigidBody, RigidBody-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) |
void |
setGravity(double gx,
double gy,
double gz) |
void |
setGravity(Vector3d g) |
void |
setGravityMode(PropertyMode mode) |
void |
setIntegrator(MechSystemSolver.Integrator integrator) |
void |
setMatrixSolver(MechSystemSolver.MatrixSolver method) |
void |
setMaxColoredExcitation(double excitation) |
void |
setMaxColoredExcitationMode(PropertyMode mode) |
void |
setPenetrationTol(double tol) |
void |
setPenetrationTolIfNecessary() |
void |
setPenetrationTolMode(PropertyMode mode) |
void |
setPointDamping(double d) |
void |
setPointDampingMode(PropertyMode mode) |
void |
setRotaryDamping(double d) |
void |
setRotaryDampingMode(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.
|
java.lang.Object |
validateMatrixSolver(MechSystemSolver.MatrixSolver method,
StringHolder errMsg) |
addActivePosImpulse, addAttachmentJacobian, addAttachmentSolveBlocks, addGeneralSolveBlocks, addPosJacobian, addVelJacobian, advance, applyAttachmentForces, buildMassMatrix, buildSolveMatrix, closePrintStateFile, collectInitialForces, copy, createState, createVelocityJacobian, getActiveForces, getActiveMass, getActivePosDerivative, getActivePosState, getActivePosStateSize, getActiveStiffness, getActiveVelState, getActiveVelState, getActiveVelStateSize, getAttachmentConstraints, getAttachmentDerivatives, getAuxState, getBilateralConstraints, getBilateralConstraintSizes, getBilateralImpulses, getBilateralImpulses, getBilateralInfo, getDefaultStabilization, getDynamicsEnabled, getDynamicSizes, getForces, getFrictionConstraints, getInitialState, getInverseMassMatrix, getMassMatrix, getNumBilateralImpulses, getNumUnilateralImpulses, getParametricForces, getParametricPosState, getParametricPosStateSize, getParametricPosTarget, getParametricVelState, getParametricVelStateSize, getParametricVelTarget, getPenetrationLimit, getPrintState, getProfiling, getSolveMatrixType, getSolver, getStabilization, getState, getStructureVersion, getUnilateralConstraints, getUnilateralConstraintSizes, getUnilateralImpulses, getUnilateralImpulses, getUnilateralInfo, getUpdateForcesAtStepEnd, getUpdateForcesAtStepEndMode, hasParameterizedType, initialize, maxFrictionConstraintSets, numActiveComponents, numAttachedComponents, numParametricComponents, openPrintStateFile, printActiveStiffness, reduceVelocityJacobian, reopenPrintStateFile, setActiveForces, setActivePosState, setActiveVelState, setAuxState, setBilateralImpulses, setBilateralImpulses, setDefaultStabilization, setDynamicsEnabled, setForces, setParametricForces, setParametricPosState, setParametricVelState, setPenetrationLimit, setPrintState, setPrintState, setProfiling, setStabilization, setState, setUnilateralImpulses, setUnilateralImpulses, setUpdateForcesAtStepEnd, setUpdateForcesAtStepEndMode, topMechSystem, updateAttachmentPos, updateAttachmentVel, updateConstraints, updateForces, updatePosState, updateVelState, writeBilateralConstraintMatrix, writeBilateralConstraintMatrix, writeMassMatrix, writeMassMatrix, writeStiffnessMatrix, writeStiffnessMatrix
createRenderProps, getRenderHints, getRenderProps, getSelection, isSelectable, numSelectionQueriesNeeded, prerender, setRenderProps
actionPerformed, copy, getInitialState, getMaxStepSize, getMenuItems, hierarchyContainsReferences, setInitialState, setMaxStepSize
add, add, addAll, addComponents, addFixed, addNumbered, clone, contains, contains, containsAll, ensureCapacity, findComponent, get, get, getByNumber, getChildren, getNavpanelDisplay, getNumberLimit, getShortName, getTypeParameter, hasChildren, indexOf, isEmpty, iterator, nextComponentNumber, numComponents, postscan, remove, remove, removeAll, removeAll, removeComponents, retainAll, set, setNavpanelDisplay, setNumbered, setNumberingStartAtOne, setShortName, size, toArray, toArray, updateNameMap
checkFlag, checkName, checkNameUniqueness, clearFlag, connectToHierarchy, createTempFlag, disconnectFromHierarchy, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, isConnectedToHierarchy, isFixed, isMarked, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setSelected, updateReferences, write
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
advance, getMaxStepSize, initialize
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, isFixed, isMarked, isSelected, notifyParentOfChange, postscan, setFixed, setMarked, setName, setNumber, setParent, setSelected, updateReferences
getProperty
getChildren, hasChildren
isWritable, write
createState, getInitialState, getState, setState
addActivePosImpulse, addPosJacobian, addVelJacobian, buildMassMatrix, buildSolveMatrix, getActiveForces, getActivePosDerivative, getActivePosState, getActivePosStateSize, getActiveVelState, getActiveVelStateSize, getBilateralConstraints, getBilateralImpulses, getBilateralInfo, getFrictionConstraints, getInverseMassMatrix, getMassMatrix, getParametricForces, getParametricPosState, getParametricPosStateSize, getParametricPosTarget, getParametricVelState, getParametricVelStateSize, getParametricVelTarget, getSolveMatrixType, getStructureVersion, getUnilateralConstraints, getUnilateralImpulses, getUnilateralInfo, maxFrictionConstraintSets, numActiveComponents, numParametricComponents, setActiveForces, setActivePosState, setActiveVelState, setBilateralImpulses, setParametricForces, setParametricPosState, setParametricVelState, setUnilateralImpulses, updateConstraints, updateForces
getName
public static PropertyList myProps
public PropertyList getAllPropertyInfo()
HasProperties
getAllPropertyInfo
in interface HasProperties
getAllPropertyInfo
in class RenderableModelBase
public void clear()
clear
in interface java.util.Collection<ModelComponent>
clear
in class ComponentList<ModelComponent>
public double getRadius()
public void setPenetrationTol(double tol)
public double getPenetrationTol()
public PropertyMode getPenetrationTolMode()
public void setPenetrationTolMode(PropertyMode mode)
public void setPenetrationTolIfNecessary()
public double computeDefaultPenetrationTol()
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)
public void setDefaultCollisionBehavior(boolean enabled, double mu)
setDefaultCollisionBehavior(behavior)
.enabled
- if true, enables collisionsmu
- friction coefficient (ignored if enabled is false)public void setDefaultCollisionBehavior(CollisionBehavior behavior)
behavior
- desired collision behaviorpublic CollisionBehavior getDefaultCollisionBehavior(Collidable typeA, Collidable typeB)
Collidable.RigidBody
and
Collidable.Deformable
. In addition, the type
Collidable.Self
can be paired with Collidable.Deformable
to obtain the default behavior for deformable self collisions;
Collidable.Self
cannot be paired with other types.typeA
- first generic collidable typetypeB
- second generic collidable typepublic void setDefaultCollisionBehavior(Collidable typeA, Collidable typeB, CollisionBehavior behavior)
Collidable.RigidBody
and Collidable.Deformable
. In addition, the
type Collidable.Self
can be paired with Collidable.Deformable
to set the default behavior for deformable self
collisions; Collidable.Self
cannot be paired with other types.typeA
- first generic collidable typetypeB
- second generic collidable typebehavior
- specified collision behaviorpublic void setDefaultCollisionBehavior(Collidable typeA, Collidable typeB, boolean enabled, double mu)
setDefaultCollisionBehavior(typeA,typeB,behavior)
.typeA
- first generic collidable typetypeB
- second generic collidable typeenabled
- if true, enables collisionsmu
- friction coefficient (ignored if enabled is false)public void setCollisionBehavior(Collidable a, Collidable b, boolean enabled)
setCollisionBehavior(a,b,behavior)
.a
- first collidableb
- second collidableenabled
- if true, enables collisionspublic void setCollisionBehavior(Collidable a, Collidable b, boolean enabled, double mu)
setCollisionBehavior(a,b,behavior)
.a
- first collidableb
- second collidableenabled
- if true, enables collisionsmu
- friction coefficient (ignored if enabled is false)public void setCollisionBehavior(Collidable a, Collidable b, CollisionBehavior behavior)
a
and b
, overriding, if necessary, the primary
behavior. The primary behavior is the default collision behavior, unless
a
and b
both belong to a sub MechModel, in
which case it is the value of
getCollisionBehavior(a,b)
for that
MechModel.
Each collidable must be a particular
component instance. A deformable body may be paired with Collidable.Self
to indicate self-intersection; otherwise, generic
designations (such as Collidable.RigidBody
) are not allowed.
If a
or b
contain sub-collidables (i.e.,
descendants components which are also Collidable
),
then the behavior is applied to all pairs of these sub-collidables.
If a
and b
are the same, then the
behavior is applied to the self-collision among all sub-collidables
whose getCollidable()
method
returns Colidability.ALL
or
Colidability.INTERNAL
.
The behavior specified by this method can be removed
using clearCollisionBehavior(a,b)
.
a
- first collidableb
- second collidablebehavior
- specified collision behaviorpublic boolean clearCollisionBehavior(Collidable a, Collidable b)
a
and b
(using the
setCollisionBehavior()
methods)
to override the primary behavior. The collidables
that may be specified are described in the documentation for
setCollisionBehavior()
.a
- first collidableb
- second collidabletrue
if an override behavior was specified
and removed for the indicated collidables.public void clearCollisionBehaviors()
setCollisionBehavior()
methods) to override the default
collision behaviors betweem pairs of Collidables.public CollisionBehavior getCollisionBehavior(Collidable a, Collidable b)
a
and b
. Generic designations (such as Collidable.RigidBody
) are not allowed.
The returned behavior is the current effective behavior resulting from
the application of all default and explicit collision behavior
settings.
If a
or b
contain sub-collidables, then
if a consistent collision behavior is found amount all pairs of
sub-collidables, that behavior is returned; otherwise, null
is returned. If a
equals b
, then this method
searches for a consistent collision behavior among all sub-collidables of
a
whose getCollidable()
method returns Colidability.ALL
or
Colidability.INTERNAL
.
a
- first collidableb
- second collidablepublic void getCollidables(java.util.List<Collidable> list, int level)
getCollidables
in interface MechSystemModel
public CollisionManager getCollisionManager()
public void setMatrixSolver(MechSystemSolver.MatrixSolver method)
public java.lang.Object validateMatrixSolver(MechSystemSolver.MatrixSolver method, StringHolder errMsg)
public MechSystemSolver.MatrixSolver getMatrixSolver()
public void setIntegrator(MechSystemSolver.Integrator integrator)
public MechSystemSolver.Integrator getIntegrator()
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 ComponentListView<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 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 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 ComponentListView<RigidBody> rigidBodies()
public void addRigidBody(RigidBody rb)
public void removeRigidBody(RigidBody rb)
public void clearRigidBodies()
public ComponentListView<Frame> frames()
public void addFrame(Frame rb)
public void removeFrame(Frame rb)
public void clearFrames()
public ComponentListView<MeshComponent> meshBodies()
public void addMeshBody(MeshComponent rb)
public void removeMeshBody(MeshComponent rb)
public void clearMeshBodies()
public void addFrameMarker(FrameMarker mkr, Frame frame, Point3d loc)
public FrameMarker addFrameMarker(Frame frame, Point3d loc)
frame
- frame object to add a marker toloc
- location within the frame (according to its own coordinate system)public void addFrameMarker(FrameMarker mkr)
public void removeFrameMarker(FrameMarker mkr)
public void clearFrameMarkers()
public RenderableComponentList<FrameMarker> frameMarkers()
public ComponentListView<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 ComponentListView<RenderableComponent> renderables()
public void addRenderable(RenderableComponent rb)
public void 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)
TFW
usin
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<DynamicAttachment> attachments()
public void addAttachment(DynamicAttachment ax)
public void getAttachments(java.util.List<DynamicAttachment> list, int level)
getAttachments
in interface MechSystemModel
public 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 MechSystemModel
public void getConstrainers(java.util.List<Constrainer> list, int level)
getConstrainers
in interface MechSystemModel
public void getForceEffectors(java.util.List<ForceEffector> list, int level)
getForceEffectors
in interface MechSystemModel
public void addGeneralMassBlocks(SparseBlockMatrix M)
addGeneralMassBlocks
in interface MechSystemModel
addGeneralMassBlocks
in class MechSystemBase
public void getMassMatrixValues(SparseBlockMatrix M, VectorNd f, double t)
getMassMatrixValues
in interface MechSystemModel
public void mulInverseMass(SparseBlockMatrix M, VectorNd a, VectorNd f)
mulInverseMass
in interface MechSystem
mulInverseMass
in interface MechSystemModel
public void getAuxStateComponents(java.util.List<HasAuxState> list, int level)
getAuxStateComponents
in interface MechSystemModel
public void getSlaveObjectComponents(java.util.List<HasSlaveObjects> list, int level)
getSlaveObjectComponents
in interface MechSystemModel
getSlaveObjectComponents
in class MechSystemBase
list
- 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)
ModelBase
If 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
preadvance
in interface Model
preadvance
in class MechSystemBase
t0
- current time (seconds)t1
- new time to advance to (seconds)flags
- reserved for future usepublic void recursivelyFinalizeAdvance(StepAdjustment stepAdjust, double t0, double t1, int flags, int level)
recursivelyFinalizeAdvance
in interface MechSystemModel
recursivelyFinalizeAdvance
in class MechSystemBase
public void recursivelyInitialize(double t, int level)
recursivelyInitialize
in interface MechSystemModel
recursivelyInitialize
in class MechSystemBase
public 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
ModelComponentBase
write
.scan
in interface ModelComponent
scan
in interface Scannable
scan
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)
IsRenderable
updateBounds
in interface IsRenderable
updateBounds
in class RenderableModelBase
pmin
- minimum pointpmax
- maximum pointpublic void render(Renderer renderer, int flags)
IsRenderable
Renderer
.render
in interface IsRenderable
render
in class RenderableModelBase
renderer
- 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)
TransformableGeometry
TransformGeometryContext.transform (this, X, 0);
transformGeometry
in interface TransformableGeometry
X
- affine transformation to apply to the componentpublic void transformGeometry(GeometryTransformer gtr, TransformGeometryContext context, int flags)
TransformableGeometry
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 TransformGeometryAction
s. 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 TransformableGeometry
gtr
- 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)
TransformableGeometry
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 TransformableGeometry
context
- context information, to which the dependent components
are added.flags
- specifies conditions associated with the transformationpublic void scaleDistance(double s)
ScalableUnits
scaleDistance
in interface ScalableUnits
s
- scaling factorpublic void scaleMass(double s)
ScalableUnits
scaleMass
in interface ScalableUnits
s
- scaling factorpublic boolean hasState()
hasState
in interface ModelComponent
hasState
in class ModelComponentBase
public 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 void componentChanged(ComponentChangeEvent e)
ComponentList
This method should propagate the notification up the component hierarchy
by calling notifyParentOfChange
.
componentChanged
in interface ComponentChangeListener
componentChanged
in interface CompositeComponent
componentChanged
in class ComponentList<ModelComponent>
e
- optional argument giving specific information about the changepublic DynamicComponent checkVelocityStability()
checkVelocityStability
in interface MechSystemModel