public class FrameNode3d extends DynamicComponentBase
ModelComponent.NavpanelVisibility
Modifier and Type | Field and Description |
---|---|
static PropertyList |
myProps |
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
TG_ARTICULATED, TG_DRAGGER, TG_PRESERVE_ORIENTATION, TG_SIMULATING
TRANSPARENT, TWO_DIMENSIONAL
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 |
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.
|
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)
Shouldn't need this because gravity is applied to world nodes
|
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) |
Frame |
getFrame() |
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(double t)
Returns the scalar mass of this component at time t.
|
void |
getMass(Matrix M,
double t)
Gets the mass of this component at a particular time.
|
int |
getPosDerivative(double[] buf,
int idx) |
Point3d |
getPosition() |
int |
getPosState(double[] buf,
int idx) |
int |
getPosStateSize() |
void |
getState(DataBuffer data)
Saves state information for this component by adding data to the
supplied DataBuffer.
|
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() |
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.
|
int |
setForce(double[] buf,
int idx) |
void |
setForce(Vector3d f) |
void |
setPosition(Point3d pos) |
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 |
setState(DataBuffer data)
Restores the state for this component by reading from the supplied
data buffer, starting at the current buffer offsets.
|
void |
setVelocity(Vector3d vel) |
int |
setVelState(double[] buf,
int idx) |
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, copy, disconnectFromHierarchy, getAttachment, getConstrainers, getMasterAttachments, getSolveIndex, hasState, isActive, isAttached, isControllable, isDynamic, isParametric, removeAttachmentRequest, removeConstrainer, removeMasterAttachment, setAttached, setSolveIndex
createRenderProps, getRenderHints, getRenderProps, getSelection, isSelectable, isVisible, numSelectionQueriesNeeded, prerender, setRenderProps, setVisible, updateBounds, updateRenderProps
checkFlag, 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, scan, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setScanning, setSelected, setWritable, updateReferences, write
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
advanceState, getAuxVarDerivative, getAuxVarState, getStateVersion, numAuxVars, requiresAdvance, setAuxVarState
getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, isFixed, isMarked, isSelected, notifyParentOfChange, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, setWritable, updateReferences
getProperty
getChildren, hasChildren
postscan
isWritable, write
transformPriority
public static PropertyList myProps
public PropertyList getAllPropertyInfo()
HasProperties
getAllPropertyInfo
in interface HasProperties
getAllPropertyInfo
in class RenderableComponentBase
public Frame getFrame()
public Point3d getPosition()
public void setPosition(Point3d pos)
public Vector3d getVelocity()
public void setVelocity(Vector3d vel)
public Vector3d getForce()
public void setForce(Vector3d f)
public void addForce(Vector3d f)
public MatrixBlock createMassBlock()
public boolean isMassConstant()
public double getMass(double t)
public void getMass(Matrix M, double t)
M
- 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.f
- vector to return the forces int
- current timeidx
- starting location within f
where forces should be storedidx
public void getInverseMass(Matrix Minv, Matrix M)
getInverseMass
in interface DynamicAgent
getInverseMass
in class DynamicComponentBase
Minv
- matrix to return the inverse mass inM
- matrix containing the mass to be invertedpublic void resetEffectiveMass()
public void addEffectiveMass(double m)
public void getEffectiveMass(Matrix M, double t)
M
- matrix to return the mass int
- current timepublic double getEffectiveMass()
public int mulInverseEffectiveMass(Matrix M, double[] a, double[] f, int idx)
public void addSolveBlock(SparseNumberedBlockMatrix S)
addSolveBlock
in interface DynamicAgent
addSolveBlock
in class DynamicComponentBase
public void addPosImpulse(double[] xbuf, int xidx, double h, double[] vbuf, int vidx)
public int getPosDerivative(double[] buf, int idx)
public int getPosState(double[] buf, int idx)
public int setPosState(double[] buf, int idx)
public int getVelState(double[] buf, int idx)
public int setVelState(double[] buf, int idx)
public int setForce(double[] buf, int idx)
public int addForce(double[] buf, int idx)
public int getForce(double[] buf, int idx)
public int getPosStateSize()
public int getVelStateSize()
public void zeroForces()
public void zeroExternalForces()
public void applyExternalForces()
public boolean velocityLimitExceeded(double tlimit, double rlimit)
DynamicAgent
tlimit
- translational velocity limitrlimit
- rotational velocity limitpublic void applyGravity(Vector3d gacc)
public boolean hasForce()
DynamicAgent
Any 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).
true
if this component exerts its own forces.public void getState(DataBuffer data)
HasNumericState
data
- buffer for storing the state values.public void setState(DataBuffer data)
HasNumericState
data
- buffer containing the state informationpublic void setRandomPosState()
DynamicAgent
public void setRandomVelState()
DynamicAgent
public void setRandomForce()
DynamicAgent
public void applyForces(double t)
ForceEffector
t
- time (seconds)public void addSolveBlocks(SparseNumberedBlockMatrix M)
ForceEffector
getSolveIndex
) for all dynamic or attached components affected by this
force effector.M
- 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.
M
- 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.
M
- solve matrix to which scaled velocity Jacobian is to be addeds
- scaling factor for velocity Jacobianpublic int getJacobianType()
ForceEffector
Matrix.SYMMETRIC
or Matrix.POSITIVE_DEFINITE
. The former should be set if adding the Jacobian
terms preserves symmetry, and the latter should be set if positive
definiteness if preserved. Both should be set if there is no Jacobian for
this effector (i.e., the Jacobian methods are not implemented). Matrix
types from all the force effectors are logically and-ed together to
determine the type for the entire solve matrix.public void transformGeometry(AffineTransform3dBase X)
TransformableGeometry
TransformGeometryContext.transform (this, X, 0);
transformGeometry
in interface TransformableGeometry
transformGeometry
in class DynamicComponentBase
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
transformGeometry
in class DynamicComponentBase
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
addTransformableDependencies
in class DynamicComponentBase
context
- context information, to which the dependent components
are added.flags
- specifies conditions associated with the transformationpublic boolean defaultRenderPropsAreNull()
defaultRenderPropsAreNull
in class RenderableComponentBase
public void render(Renderer renderer, int flags)
IsRenderable
Renderer
.render
in interface IsRenderable
render
in class RenderableComponentBase
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
.