public class BackNode3d extends DynamicComponentBase implements MotionTargetComponent
ModelComponent.FilePathSaveType, ModelComponent.NavpanelVisibility| Modifier and Type | Field and Description |
|---|---|
static PropertyList |
myProps |
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNamesTG_ARTICULATED, TG_DRAGGER, TG_PRESERVE_ORIENTATION, TG_SIMULATINGTRANSPARENT, TWO_DIMENSIONAL| Constructor and Description |
|---|
BackNode3d(FemNode3d node) |
| Modifier and Type | Method and Description |
|---|---|
void |
addEffectiveMass(double m) |
int |
addForce(double[] buf,
int idx) |
void |
addForce(Vector3d f) |
void |
addPosImpulse(double[] xbuf,
int xidx,
double h,
double[] vbuf,
int vidx) |
void |
addPosJacobian(SparseNumberedBlockMatrix M,
double s)
Scales the components of the position Jacobian associated with this force
effector and adds it to the supplied solve matrix M.
|
void |
addScaledForce(double s,
Vector3d f) |
void |
addSolveBlock(SparseNumberedBlockMatrix S) |
void |
addSolveBlocks(SparseNumberedBlockMatrix M)
Adds any needed blocks to a solve matrix in order to accomodate the
Jacobian terms associated with this force effector.
|
int |
addTargetJacobian(SparseBlockMatrix J,
int bi)
Add a row to the motion target Jacobian for this motion target.
|
void |
addTransformableDependencies(TransformGeometryContext context,
int flags)
Adds to
context any transformable components which should be
transformed as the same time as this component. |
void |
addVelJacobian(SparseNumberedBlockMatrix M,
double s)
Scales the components of the velocity Jacobian associated with this force
effector and adds it to the supplied solve matrix M.
|
void |
applyExternalForces() |
void |
applyForces(double t)
Adds forces to the components affected by this force effector at a
particular time.
|
void |
applyGravity(Vector3d gacc)
Note: this method is required by the interface, but is not currently
used since gravity is applied directly to nodes within
FemModel3d.updateNodeForces(), and gravity action is lumped
together with the front node.
|
void |
clearPosition() |
void |
clearRestPosition() |
BackNode3d |
copy(int flags,
java.util.Map<ModelComponent,ModelComponent> copyMap) |
MatrixBlock |
createMassBlock()
Create a matrix block for representing the mass of this component,
initialized to the component's effective mass (instrinsic mass
plus the mass due to all attachmented components).
|
boolean |
defaultRenderPropsAreNull() |
PropertyList |
getAllPropertyInfo()
Returns a list giving static information about all properties exported by
this object.
|
double |
getEffectiveMass()
Gets the effective scalar mass of this component.
|
void |
getEffectiveMass(Matrix M,
double t)
Gets the effective mass of this component at a particular time.
|
int |
getEffectiveMassForces(VectorNd f,
double t,
int idx)
Gets the mass forces for this component at a particular time.
|
Vector3d |
getForce() |
int |
getForce(double[] buf,
int idx) |
Vector3d |
getInternalForce() |
void |
getInverseMass(Matrix Minv,
Matrix M)
Inverts a mass for this component.
|
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 |
getMass()
Returns the mass for this backnode.
|
double |
getMass(double t)
This method is required by the interface, but is not currently used.
|
void |
getMass(Matrix M,
double t)
This method is required by the interface, but is not currently used.
|
int |
getPosDerivative(double[] buf,
int idx) |
Point3d |
getPosition() |
int |
getPosState(double[] buf,
int idx) |
int |
getPosStateSize() |
float[] |
getRenderCoords() |
Point3d |
getRenderPosition() |
Point3d |
getRestPosition() |
void |
getState(DataBuffer data)
Saves state information for this component by adding data to the
supplied DataBuffer.
|
MotionTarget.TargetActivity |
getTargetActivity() |
int |
getTargetPos(double[] post,
double s,
double h,
int idx) |
int |
getTargetVel(double[] velt,
double s,
double h,
int idx) |
Vector3d |
getVelocity() |
int |
getVelState(double[] buf,
int idx) |
int |
getVelStateSize() |
boolean |
hasForce()
Queries whether or not this component actually exerts its own
state-dependent forces (typically associated with damping).
|
boolean |
isMassConstant() |
boolean |
isPositionValid() |
boolean |
isRestPositionExplicit() |
boolean |
isRestPositionValid() |
int |
mulInverseEffectiveMass(Matrix M,
double[] a,
double[] f,
int idx) |
void |
render(Renderer renderer,
int flags)
Render this object using the functionality of the supplied
Renderer. |
void |
resetEffectiveMass()
Resets the effective mass of this component to the nominal mass.
|
void |
resetTargets() |
void |
saveRenderCoords() |
void |
scalePosition(double s,
Point3d frontPos) |
void |
scaleRestPosition(double s,
Point3d frontRest) |
void |
scan(ReaderTokenizer rtok,
java.lang.Object ref)
Scans this element from a ReaderTokenizer.
|
void |
setDynamic(boolean enable) |
int |
setForce(double[] buf,
int idx) |
void |
setForce(Vector3d f) |
void |
setPosition(Point3d pos) |
void |
setPosition(Point3d frontPos,
Vector3d dir) |
void |
setPositionToRest() |
int |
setPosState(double[] buf,
int idx) |
void |
setRandomForce()
Sets the force of this component to a random value.
|
void |
setRandomPosState()
Sets the position state of this component to a random value.
|
void |
setRandomVelState()
Sets the velocity state of this component to a random value.
|
void |
setRestPosition(Point3d rest) |
void |
setRestPosition(Point3d frontRest,
Vector3d restDir) |
void |
setState(DataBuffer data)
Restores the state for this component by reading from the supplied
data buffer, starting at the current buffer offsets.
|
void |
setTargetActivity(MotionTarget.TargetActivity activity) |
void |
setVelocity(Vector3d vel) |
int |
setVelState(double[] buf,
int idx) |
void |
subForce(Vector3d f) |
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. |
boolean |
velocityLimitExceeded(double tlimit,
double rlimit)
Checks if the current component velocity exceeds specified limits.
|
void |
zeroExternalForces() |
void |
zeroForces() |
addAttachmentRequest, addConstrainer, addMasterAttachment, connectToHierarchy, disconnectFromHierarchy, getAttachment, getConstrainers, getMasterAttachments, getSolveIndex, hasState, isActive, isAttached, isControllable, isDynamic, isParametric, removeAttachmentRequest, removeConstrainer, removeMasterAttachment, setAttached, setSolveIndexcreateRenderProps, getRenderHints, getRenderProps, getSelection, isSelectable, isVisible, numSelectionQueriesNeeded, prerender, setRenderProps, setVisible, updateBounds, updateRenderPropscheckFlag, checkName, checkNameUniqueness, clearFlag, clone, createTempFlag, getChildren, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasChildren, isFixed, isMarked, isScanning, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, postscan, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setScanning, setSelected, setWritable, updateReferences, writeequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddAttachmentRequest, removeAttachmentRequestaddConstrainer, addMasterAttachment, getAttachment, getConstrainers, getMasterAttachments, getSolveIndex, isActive, isAttached, isControllable, isDynamic, isParametric, removeConstrainer, removeMasterAttachment, setAttached, setSolveIndexadvanceState, getAuxVarDerivative, getAuxVarState, getStateVersion, hasState, numAuxVars, requiresAdvance, setAuxVarStateconnectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, setFixed, setMarked, setName, setNumber, setParent, setSelected, setWritable, updateReferencesgetPropertygetChildren, hasChildrenpostscanisWritable, writetransformPrioritypublic static PropertyList myProps
public BackNode3d(FemNode3d node)
public PropertyList getAllPropertyInfo()
HasPropertiesgetAllPropertyInfo in interface HasPropertiesgetAllPropertyInfo in class RenderableComponentBasepublic Point3d getPosition()
public void setPosition(Point3d pos)
public void scalePosition(double s,
Point3d frontPos)
public void clearPosition()
public boolean isPositionValid()
public void setPositionToRest()
public Vector3d getVelocity()
public void setVelocity(Vector3d vel)
public Point3d getRestPosition()
public void setRestPosition(Point3d rest)
public void scaleRestPosition(double s,
Point3d frontRest)
public void clearRestPosition()
public boolean isRestPositionExplicit()
public boolean isRestPositionValid()
public Point3d getRenderPosition()
public Vector3d getForce()
public void setForce(Vector3d f)
public void addForce(Vector3d f)
public void addScaledForce(double s,
Vector3d f)
public void subForce(Vector3d f)
public Vector3d getInternalForce()
public MatrixBlock createMassBlock()
createMassBlock in interface DynamicAgentpublic boolean isMassConstant()
isMassConstant in interface DynamicAgentpublic double getMass(double t)
getMass in interface DynamicAgentpublic double getMass()
If computed from density, the back node's mass is half of the total nodal mass due to shell elements. Otherwise, if the front node's mass is explicitly set, the back node's mass is set to half the front node mass.
public void getMass(Matrix M, double t)
getMass in interface DynamicAgentM - matrix to return the mass int - current timepublic int getEffectiveMassForces(VectorNd f, double t, int idx)
f, starting at the location
specified by idx. Upon return, this method should
return the value of idx incremented by the dimension
of the mass forces.getEffectiveMassForces in interface DynamicAgentf - vector to return the forces int - current timeidx - starting location within f
where forces should be storedidxpublic void getInverseMass(Matrix Minv, Matrix M)
getInverseMass in interface DynamicAgentgetInverseMass in class DynamicComponentBaseMinv - matrix to return the inverse mass inM - matrix containing the mass to be invertedpublic void resetEffectiveMass()
resetEffectiveMass in interface DynamicAgentpublic void addEffectiveMass(double m)
public void getEffectiveMass(Matrix M, double t)
getEffectiveMass in interface DynamicAgentM - matrix to return the mass int - current timepublic double getEffectiveMass()
getEffectiveMass in interface DynamicAgentpublic int mulInverseEffectiveMass(Matrix M, double[] a, double[] f, int idx)
mulInverseEffectiveMass in interface DynamicAgentpublic void addSolveBlock(SparseNumberedBlockMatrix S)
addSolveBlock in interface DynamicAgentaddSolveBlock in class DynamicComponentBasepublic void addPosImpulse(double[] xbuf,
int xidx,
double h,
double[] vbuf,
int vidx)
addPosImpulse in interface DynamicAgentpublic int getPosDerivative(double[] buf,
int idx)
getPosDerivative in interface DynamicAgentpublic int getPosState(double[] buf,
int idx)
getPosState in interface DynamicAgentpublic int setPosState(double[] buf,
int idx)
setPosState in interface DynamicAgentpublic int getVelState(double[] buf,
int idx)
getVelState in interface DynamicAgentpublic int setVelState(double[] buf,
int idx)
setVelState in interface DynamicAgentpublic int setForce(double[] buf,
int idx)
setForce in interface DynamicAgentpublic int addForce(double[] buf,
int idx)
addForce in interface DynamicAgentpublic int getForce(double[] buf,
int idx)
getForce in interface DynamicAgentpublic int getPosStateSize()
getPosStateSize in interface DynamicAgentgetPosStateSize in interface MotionTargetComponentpublic int getVelStateSize()
getVelStateSize in interface DynamicAgentgetVelStateSize in interface MotionTargetComponentpublic void zeroForces()
zeroForces in interface DynamicAgentpublic void zeroExternalForces()
zeroExternalForces in interface DynamicAgentpublic void applyExternalForces()
applyExternalForces in interface DynamicAgentpublic boolean velocityLimitExceeded(double tlimit,
double rlimit)
DynamicAgentvelocityLimitExceeded in interface DynamicAgenttlimit - translational velocity limitrlimit - rotational velocity limitpublic void applyGravity(Vector3d gacc)
applyGravity in interface DynamicAgentpublic boolean hasForce()
DynamicAgentAny action that alters the return value of this method should
propagate a StructureChangeEvent. This can be
a state-not-changed event if component's state structure
is not altered (which it typically won't be).
hasForce in interface DynamicAgenttrue if this component exerts its own forces.public void getState(DataBuffer data)
HasNumericStategetState in interface DynamicAgentgetState in interface HasNumericStatedata - buffer for storing the state values.public void setState(DataBuffer data)
HasNumericStatesetState in interface DynamicAgentsetState in interface HasNumericStatedata - buffer containing the state informationpublic void setRandomPosState()
DynamicAgentsetRandomPosState in interface DynamicAgentpublic void setRandomVelState()
DynamicAgentsetRandomVelState in interface DynamicAgentpublic void setRandomForce()
DynamicAgentsetRandomForce in interface DynamicAgentpublic void applyForces(double t)
ForceEffectorapplyForces in interface ForceEffectort - time (seconds)public void addSolveBlocks(SparseNumberedBlockMatrix M)
ForceEffectorgetSolveIndex) for all dynamic or attached components affected by this
force effector.addSolveBlocks in interface ForceEffectorM - solve matrix to which blocks should be addedpublic void addPosJacobian(SparseNumberedBlockMatrix M, double s)
ForceEffector
M is guaranteed to be the same matrix supplied in the most recent call to
addSolveBlocks, and so implementations may choose
to cache the relevant matrix blocks from that call, instead of retrieving
them directly from M.
addPosJacobian in interface ForceEffectorM - solve matrix to which scaled position Jacobian is to be addeds - scaling factor for position Jacobianpublic void addVelJacobian(SparseNumberedBlockMatrix M, double s)
ForceEffector
M is guaranteed to be the same matrix supplied in the most recent call to
addSolveBlocks, and so implementations may choose
to cache the relevant matrix blocks from that call, instead of retrieving
them directly from M.
addVelJacobian in interface ForceEffectorM - solve matrix to which scaled velocity Jacobian is to be addeds - scaling factor for velocity Jacobianpublic int getJacobianType()
ForceEffectorMatrix.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 ForceEffectorpublic void transformGeometry(AffineTransform3dBase X)
TransformableGeometryTransformGeometryContext.transform (this, X, 0);
transformGeometry in interface TransformableGeometrytransformGeometry in class DynamicComponentBaseX - affine transformation to apply to the componentpublic void transformGeometry(GeometryTransformer gtr, TransformGeometryContext context, int flags)
TransformableGeometrygtr 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 TransformableGeometrytransformGeometry in class DynamicComponentBasegtr - 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)
TransformableGeometrycontext 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 TransformableGeometryaddTransformableDependencies in class DynamicComponentBasecontext - context information, to which the dependent components
are added.flags - specifies conditions associated with the transformationpublic boolean defaultRenderPropsAreNull()
defaultRenderPropsAreNull in class RenderableComponentBasepublic void render(Renderer renderer, int flags)
IsRenderableRenderer.render in interface IsRenderablerender in class RenderableComponentBaserenderer - 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 setDynamic(boolean enable)
public MotionTarget.TargetActivity getTargetActivity()
getTargetActivity in interface MotionTargetComponentpublic void setTargetActivity(MotionTarget.TargetActivity activity)
setTargetActivity in interface MotionTargetComponentpublic int getTargetVel(double[] velt,
double s,
double h,
int idx)
getTargetVel in interface MotionTargetComponentpublic int getTargetPos(double[] post,
double s,
double h,
int idx)
getTargetPos in interface MotionTargetComponentpublic int addTargetJacobian(SparseBlockMatrix J, int bi)
MotionTargetComponentvt = J u
addTargetJacobian in interface MotionTargetComponentJ - motion target Jacobianbi - block row index for the row to be addedpublic void resetTargets()
resetTargets in interface MotionTargetComponentpublic void scan(ReaderTokenizer rtok, java.lang.Object ref) throws java.io.IOException
write.scan in interface ModelComponentscan in interface Scannablescan in class ModelComponentBasertok - 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 saveRenderCoords()
public float[] getRenderCoords()
public BackNode3d copy(int flags, java.util.Map<ModelComponent,ModelComponent> copyMap)
copy in class DynamicComponentBase