artisynth.core.mechmodels
Class Point

java.lang.Object
  extended by artisynth.core.modelbase.ModelComponentBase
      extended by artisynth.core.modelbase.RenderableComponentBase
          extended by artisynth.core.mechmodels.DynamicMechComponentBase
              extended by artisynth.core.mechmodels.Point
All Implemented Interfaces:
DynamicMechComponent, ForceEffector, MotionTargetComponent, CopyableComponent, ModelComponent, RenderableComponent, Tracable, ScalableUnits, TransformableGeometry, java.lang.Cloneable, HasProperties, HierarchyNode, GLRenderable, GLSelectable, HasRenderProps, Renderable, RenderablePoint, Scannable
Direct Known Subclasses:
Elaston, Marker, Particle, PlanarPoint, TargetPoint

public class Point
extends DynamicMechComponentBase
implements RenderablePoint, TransformableGeometry, ScalableUnits, DynamicMechComponent, Tracable, MotionTargetComponent, CopyableComponent


Nested Class Summary
 
Nested classes/interfaces inherited from interface artisynth.core.modelbase.ModelComponent
ModelComponent.NavpanelVisibility
 
Field Summary
static PropertyList myProps
           
 float[] myRenderCoords
           
 
Fields inherited from class artisynth.core.modelbase.ModelComponentBase
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
 
Fields inherited from interface maspack.render.GLRenderable
TRANSLUCENT, TWO_DIMENSIONAL
 
Fields inherited from interface artisynth.core.util.TransformableGeometry
ARTICULATED, SIMULATING
 
Fields inherited from interface artisynth.core.modelbase.CopyableComponent
COPY_REFERENCES
 
Constructor Summary
Point()
           
Point(Point3d pnt)
           
 
Method Summary
 void addExternalForce(Vector3d f)
           
 void addForce(Vector3d f)
           
 void addPosImpulse(double[] xbuf, int xidx, double h, double[] vbuf, int vidx)
           
 void addPosition(double dx, double dy, double dz)
           
 void addPosJacobian(SparseNumberedBlockMatrix S, double s)
          Scales the components of the position Jacobian associated with this force effector and adds it to the supplied solve matrix M.
 void addScaledExternalForce(double s, Vector3d f)
           
 void addScaledForce(double s, Vector3d f)
           
 void addScaledPosition(double s, Vector3d v)
          Adds a scaled vector to this point's position.
 void addScaledVelocity(double s, Vector3d v)
           
 void addSolveBlock(SparseNumberedBlockMatrix S)
           
 void addSolveBlocks(SparseNumberedBlockMatrix S)
          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 addToSolveBlockDiagonal(SparseNumberedBlockMatrix S, double d)
           
 void addVelJacobian(SparseNumberedBlockMatrix S, double s)
          Scales the components of the velocity Jacobian associated with this force effector and adds it to the supplied solve matrix M.
 void addVelocity(double dx, double dy, double dz)
           
 void applyForces(double t)
          Adds forces to the components affected by this force effector at a particular time.
 void applyGravity(Vector3d gacc)
          Applies a gravity force to this component, given a prescribed gravity acceleration vector.
 ModelComponent copy(int flags, java.util.Map<ModelComponent,ModelComponent> copyMap)
          Create a copy of this component.
 Matrix3x3DiagBlock 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).
 RenderProps createRenderProps()
          Factory method to create render properties appropriate to this object.
 MatrixBlock createSolveBlock()
           
 double distance(Point pnt)
           
 double distance(Point3d pos)
           
 PropertyList getAllPropertyInfo()
          Returns a list giving static information about all properties exported by this object.
 boolean getCopyReferences(java.util.List<ModelComponent> refs, ModelComponent ancestor)
          Collects external references which must also be copied in order to duplicate this component.
 Vector3d getExternalForce()
           
 Vector3d getForce()
           
 int getForce(double[] f, int idx)
           
 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 getMassForces(VectorNd f, double t, int idx)
          Gets the mass forces for this component at a particular time.
 double getPointDamping()
           
 PropertyMode getPointDampingMode()
           
 int getPosDerivative(double[] dxdt, int idx)
           
 Point3d getPosition()
           
 void getPosition(Point3d pos)
           
 int getPosState(double[] x, int idx)
           
 int getPosStateSize()
           
 float[] getRenderCoords()
           
 RenderProps getRenderProps()
          Returns the render properities for this object.
 void getSelection(java.util.LinkedList<java.lang.Object> list, int qid)
          Append to list the component (or components) associated with the qid-th selection query issued by this component's render method.
 void getState(PointState state)
           
 int getState(VectorNd x, int idx)
           
 MotionTarget.TargetActivity getTargetActivity()
           
 int getTargetPos(double[] post, double s, double h, int idx)
           
 Point3d getTargetPosition()
           
 int getTargetVel(double[] velt, double s, double h, int idx)
           
 Vector3d getTargetVelocity()
           
 java.lang.String[] getTracables()
           
 TracingProbe getTracingProbe(java.lang.String tracableName)
           
 Vector3d getVelocity()
           
 void getVelocity(Vector3d vel)
           
 int getVelState(double[] v, int idx)
           
 int getVelStateSize()
           
 boolean isDuplicatable()
          Returns true if this component can be duplicated.
 boolean isMassConstant()
           
 boolean isSelectable()
          Returns true if this object is in fact selectable.
 void prerender(RenderList list)
          Prepare for rendering, and potentially add itself to a list to be drawn by a GLRenderer.
 void render(GLRenderer renderer, int flags)
          Render this object using Open GL via the JOGL.
 void resetTargets()
           
 void scaleDistance(double s)
          Scales all distance coordinates.
 void scaleMass(double s)
          Scales all mass units.
 void setExternalForce(Vector3d f)
           
 int setForce(double[] f, int idx)
           
 void setForce(Vector3d f)
           
 void setForcesToExternal()
           
 void setPointDamping(double d)
           
 void setPointDampingMode(PropertyMode mode)
           
 void setPosition(double x, double y, double z)
           
 void setPosition(Point3d p)
           
 int setPosState(double[] p, int idx)
           
 void setRenderProps(RenderProps props)
          Assigns a new set of render properties to this object.
 void setScaledExternalForce(double s, Vector3d f)
           
 void setState(DynamicMechComponent c)
          Sets the state of this DynamicMechComponent from that of another.
 void setState(Point point)
           
 int setState(VectorNd x, int idx)
           
 void setTargetActivity(MotionTarget.TargetActivity activity)
           
 int setTargetPos(double[] post, int idx)
           
 void setTargetPosition(Point3d pos)
           
 int setTargetVel(double[] velt, int idx)
           
 void setTargetVelocity(Vector3d vel)
           
 void setVelocity(double x, double y, double z)
           
 void setVelocity(Vector3d v)
           
 int setVelState(double[] v, int idx)
           
 void subForce(Vector3d f)
           
 void transformGeometry(AffineTransform3dBase X)
          Applies an affine transformation to the geometry of this object.
 void transformGeometry(AffineTransform3dBase X, TransformableGeometry topObject, int flags)
          Applies an affine transformation to the geometry of this object.
 void updateBounds(Point3d pmin, Point3d pmax)
          Update the minimum and maximum points for this object.
 boolean velocityLimitExceeded(double tlimit, double rlimit)
          Checks if the current component velocity exceeds specified limits.
 void zeroExternalForces()
           
 void zeroForces()
           
 
Methods inherited from class artisynth.core.mechmodels.DynamicMechComponentBase
addMasterAttachment, getAttachment, getInverseMass, getMasterAttachments, getSolveIndex, hasState, isActive, isAttached, isControllable, isDynamic, isParametric, removeMasterAttachment, setAttached, setSolveIndex
 
Methods inherited from class artisynth.core.modelbase.RenderableComponentBase
getRenderHints, numSelectionQueriesNeeded, updateRenderProps
 
Methods inherited from class artisynth.core.modelbase.ModelComponentBase
checkFlag, checkName, checkNameUniqueness, clearFlag, clone, connectToHierarchy, createTempFlag, disconnectFromHierarchy, getChildren, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasChildren, isFixed, isMarked, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, postscan, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, scan, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setSelected, updateReferences, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface maspack.render.RenderablePoint
isSelected
 
Methods inherited from interface maspack.render.GLSelectable
numSelectionQueriesNeeded
 
Methods inherited from interface maspack.render.GLRenderable
getRenderHints
 
Methods inherited from interface artisynth.core.mechmodels.DynamicMechComponent
addMasterAttachment, checkFlag, clearFlag, getAttachment, getInverseMass, getMasterAttachments, getSolveIndex, isActive, isAttached, isControllable, isDynamic, isParametric, removeMasterAttachment, setAttached, setFlag, setSolveIndex
 
Methods inherited from interface artisynth.core.modelbase.ModelComponent
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, postscan, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, updateReferences
 
Methods inherited from interface maspack.properties.HierarchyNode
getChildren, hasChildren
 
Methods inherited from interface maspack.util.Scannable
isWritable, write
 

Field Detail

myRenderCoords

public float[] myRenderCoords

myProps

public static PropertyList myProps
Constructor Detail

Point

public Point()

Point

public Point(Point3d pnt)
Method Detail

getAllPropertyInfo

public PropertyList getAllPropertyInfo()
Description copied from interface: HasProperties
Returns a list giving static information about all properties exported by this object.

Specified by:
getAllPropertyInfo in interface HasProperties
Overrides:
getAllPropertyInfo in class ModelComponentBase
Returns:
static information for all exported properties

getForce

public Vector3d getForce()

setForce

public void setForce(Vector3d f)

addForce

public void addForce(Vector3d f)

addScaledForce

public void addScaledForce(double s,
                           Vector3d f)

subForce

public void subForce(Vector3d f)

zeroForces

public void zeroForces()
Specified by:
zeroForces in interface DynamicMechComponent

setForcesToExternal

public void setForcesToExternal()
Specified by:
setForcesToExternal in interface DynamicMechComponent

addExternalForce

public void addExternalForce(Vector3d f)

addScaledExternalForce

public void addScaledExternalForce(double s,
                                   Vector3d f)

getExternalForce

public Vector3d getExternalForce()

setExternalForce

public void setExternalForce(Vector3d f)

zeroExternalForces

public void zeroExternalForces()
Specified by:
zeroExternalForces in interface DynamicMechComponent

setScaledExternalForce

public void setScaledExternalForce(double s,
                                   Vector3d f)

applyForces

public void applyForces(double t)
Description copied from interface: ForceEffector
Adds forces to the components affected by this force effector at a particular time. Component forces should be added and not set, since other forces may be added to the same components by other force effectors.

Specified by:
applyForces in interface ForceEffector
Parameters:
t - time (seconds)

addVelJacobian

public void addVelJacobian(SparseNumberedBlockMatrix S,
                           double s)
Description copied from interface: ForceEffector
Scales the components of the velocity Jacobian associated with this force effector and adds it to the supplied solve matrix M.

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.

Specified by:
addVelJacobian in interface ForceEffector
Parameters:
S - solve matrix to which scaled velocity Jacobian is to be added
s - scaling factor for velocity Jacobian

addPosJacobian

public void addPosJacobian(SparseNumberedBlockMatrix S,
                           double s)
Description copied from interface: ForceEffector
Scales the components of the position Jacobian associated with this force effector and adds it to the supplied solve matrix M.

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.

Specified by:
addPosJacobian in interface ForceEffector
Parameters:
S - solve matrix to which scaled position Jacobian is to be added
s - scaling factor for position Jacobian

addSolveBlocks

public void addSolveBlocks(SparseNumberedBlockMatrix S)
Description copied from interface: ForceEffector
Adds any needed blocks to a solve matrix in order to accomodate the Jacobian terms associated with this force effector. In general, blocks will be need to be added at locations given by the block indices (bi, bj), where bi and bj correspond to the solve indices (as returned by getSolveIndex) for all dynamic or attached components affected by this force effector.

Specified by:
addSolveBlocks in interface ForceEffector
Parameters:
S - solve matrix to which blocks should be added

getJacobianType

public int getJacobianType()
Description copied from interface: ForceEffector
Returns a code indicating the matrix type that results when the Jacobian terms of this force effector are added to the solve matrix. This should be a logical or-ing of either 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.

Specified by:
getJacobianType in interface ForceEffector
Returns:
solve matrix type resulting from adding Jacobian terms

getPosition

public Point3d getPosition()

getPosition

public void getPosition(Point3d pos)

distance

public double distance(Point pnt)

distance

public double distance(Point3d pos)

getPosState

public int getPosState(double[] x,
                       int idx)
Specified by:
getPosState in interface DynamicMechComponent

setPosition

public void setPosition(Point3d p)

setPosition

public void setPosition(double x,
                        double y,
                        double z)

addPosition

public void addPosition(double dx,
                        double dy,
                        double dz)

addScaledPosition

public void addScaledPosition(double s,
                              Vector3d v)
Adds a scaled vector to this point's position.

Parameters:
s - scale factor
v - vector to scale and add

setPosState

public int setPosState(double[] p,
                       int idx)
Specified by:
setPosState in interface DynamicMechComponent

addPosImpulse

public void addPosImpulse(double[] xbuf,
                          int xidx,
                          double h,
                          double[] vbuf,
                          int vidx)
Specified by:
addPosImpulse in interface DynamicMechComponent

getPosDerivative

public int getPosDerivative(double[] dxdt,
                            int idx)
Specified by:
getPosDerivative in interface DynamicMechComponent

getVelocity

public Vector3d getVelocity()

getVelocity

public void getVelocity(Vector3d vel)

getVelState

public int getVelState(double[] v,
                       int idx)
Specified by:
getVelState in interface DynamicMechComponent

setVelocity

public void setVelocity(Vector3d v)

addVelocity

public void addVelocity(double dx,
                        double dy,
                        double dz)

addScaledVelocity

public void addScaledVelocity(double s,
                              Vector3d v)

setVelState

public int setVelState(double[] v,
                       int idx)
Specified by:
setVelState in interface DynamicMechComponent

setVelocity

public void setVelocity(double x,
                        double y,
                        double z)

setForce

public int setForce(double[] f,
                    int idx)
Specified by:
setForce in interface DynamicMechComponent

getForce

public int getForce(double[] f,
                    int idx)
Specified by:
getForce in interface DynamicMechComponent

resetTargets

public void resetTargets()
Specified by:
resetTargets in interface MotionTargetComponent

getTargetActivity

public MotionTarget.TargetActivity getTargetActivity()
Specified by:
getTargetActivity in interface MotionTargetComponent

setTargetActivity

public void setTargetActivity(MotionTarget.TargetActivity activity)
Specified by:
setTargetActivity in interface MotionTargetComponent

getTargetPosition

public Point3d getTargetPosition()

setTargetPosition

public void setTargetPosition(Point3d pos)

getTargetVelocity

public Vector3d getTargetVelocity()

setTargetVelocity

public void setTargetVelocity(Vector3d vel)

getTargetVel

public int getTargetVel(double[] velt,
                        double s,
                        double h,
                        int idx)
Specified by:
getTargetVel in interface MotionTargetComponent

setTargetVel

public int setTargetVel(double[] velt,
                        int idx)
Specified by:
setTargetVel in interface MotionTargetComponent

getTargetPos

public int getTargetPos(double[] post,
                        double s,
                        double h,
                        int idx)
Specified by:
getTargetPos in interface MotionTargetComponent

setTargetPos

public int setTargetPos(double[] post,
                        int idx)
Specified by:
setTargetPos in interface MotionTargetComponent

addTargetJacobian

public int addTargetJacobian(SparseBlockMatrix J,
                             int bi)
Add a row to the motion target Jacobian for this motion target. The Jacobian maps state velocities u into motion target velocities vt according to
 vt = J u
 

Specified by:
addTargetJacobian in interface MotionTargetComponent
Parameters:
J - motion target Jacobian
bi - block row index for the row to be added
Returns:
bi + 1

getPointDamping

public double getPointDamping()

setPointDamping

public void setPointDamping(double d)

getPointDampingMode

public PropertyMode getPointDampingMode()

setPointDampingMode

public void setPointDampingMode(PropertyMode mode)

applyGravity

public void applyGravity(Vector3d gacc)
Applies a gravity force to this component, given a prescribed gravity acceleration vector.

Specified by:
applyGravity in interface DynamicMechComponent

getRenderCoords

public float[] getRenderCoords()
Specified by:
getRenderCoords in interface RenderablePoint

setRenderProps

public void setRenderProps(RenderProps props)
Description copied from interface: HasRenderProps
Assigns a new set of render properties to this object. An argument of null will remove render properties from this object.

Specified by:
setRenderProps in interface HasRenderProps
Overrides:
setRenderProps in class RenderableComponentBase
Parameters:
props - new render properties for this object

getRenderProps

public RenderProps getRenderProps()
Description copied from interface: HasRenderProps
Returns the render properities for this object. If no render properties are assigned, this routines returns null.

Specified by:
getRenderProps in interface HasRenderProps
Overrides:
getRenderProps in class RenderableComponentBase
Returns:
current render properties for this object

createRenderProps

public RenderProps createRenderProps()
Description copied from interface: HasRenderProps
Factory method to create render properties appropriate to this object.

Specified by:
createRenderProps in interface HasRenderProps
Overrides:
createRenderProps in class RenderableComponentBase
Returns:
new render properties for this object

getTracables

public java.lang.String[] getTracables()
Specified by:
getTracables in interface Tracable

getTracingProbe

public TracingProbe getTracingProbe(java.lang.String tracableName)
Specified by:
getTracingProbe in interface Tracable

prerender

public void prerender(RenderList list)
Description copied from interface: GLRenderable
Prepare for rendering, and potentially add itself to a list to be drawn by a GLRenderer.

Specified by:
prerender in interface GLRenderable
Overrides:
prerender in class RenderableComponentBase

updateBounds

public void updateBounds(Point3d pmin,
                         Point3d pmax)
Description copied from interface: GLRenderable
Update the minimum and maximum points for this object. In an x-y-z coordinate system with x directed to the right and y directed upwards, the minimum and maximum points can be thought of as defining the left-lower-far and right-upper-near corners of a bounding cube. This method should only reduce the elements of the minimum point and increase the elements of the maximum point, since it may be used as part of an iteration to determine the bounding cube for several different objects.

Specified by:
updateBounds in interface GLRenderable
Overrides:
updateBounds in class RenderableComponentBase
Parameters:
pmin - minimum point
pmax - maximum point

isSelectable

public boolean isSelectable()
Description copied from class: RenderableComponentBase
Returns true if this object is in fact selectable.

Specified by:
isSelectable in interface GLSelectable
Overrides:
isSelectable in class RenderableComponentBase
Returns:
true if this object is selectable

render

public void render(GLRenderer renderer,
                   int flags)
Description copied from interface: GLRenderable
Render this object using Open GL via the JOGL.

Specified by:
render in interface GLRenderable
Specified by:
render in class RenderableComponentBase
Parameters:
renderer - renderer object which is used to perform the rendering. Provides pointers to GL and GLU, along with helper functions.
flags - supplies flags that may be used to control different aspects of the rendering. Flags are defined in GLRenderer and currently include GLRenderer.SELECTED, GLRenderer.VERTEX_COLORING, GLRenderer.HSV_COLOR_INTERPOLATION, GLRenderer.SORT_FACES, and GLRenderer.CLEAR_MESH_DISPLAY_LISTS.

getSelection

public void getSelection(java.util.LinkedList<java.lang.Object> list,
                         int qid)
Description copied from interface: GLSelectable
Append to list the component (or components) associated with the qid-th selection query issued by this component's render method. This will only be called if this component manages its own selection (i.e., the number nums returned by GLSelectable.numSelectionQueriesNeeded() is positive), and qid will in turn be a number between 0 and nums-1.

Specified by:
getSelection in interface GLSelectable
Overrides:
getSelection in class RenderableComponentBase
Parameters:
list - selected objects are appended to the end of this list
qid - index of the selection query

scaleDistance

public void scaleDistance(double s)
Description copied from interface: ScalableUnits
Scales all distance coordinates.

Specified by:
scaleDistance in interface ScalableUnits
Parameters:
s - scaling factor

scaleMass

public void scaleMass(double s)
Description copied from interface: ScalableUnits
Scales all mass units.

Specified by:
scaleMass in interface ScalableUnits
Parameters:
s - scaling factor

transformGeometry

public void transformGeometry(AffineTransform3dBase X,
                              TransformableGeometry topObject,
                              int flags)
Description copied from interface: TransformableGeometry
Applies an affine transformation to the geometry of this object. If recursively invoked within a component hierarchy, then topComponent should be the component for which the method was initially invoked. The variable flags provides information about the context in which the transformation is being applied. At present, the available flags are TransformableGeometry.SIMULATING and TransformableGeometry.ARTICULATED.

Specified by:
transformGeometry in interface TransformableGeometry
Parameters:
X - affine transformation
topObject - component on which the method was initially invoked
flags - provides information about the context in which the transformation is being applied.

transformGeometry

public void transformGeometry(AffineTransform3dBase X)
Description copied from interface: TransformableGeometry
Applies an affine transformation to the geometry of this object. This method should be equivalent to
 transformGeometry (X, this, 0);
 

Specified by:
transformGeometry in interface TransformableGeometry
Parameters:
X - affine transformation

createMassBlock

public Matrix3x3DiagBlock createMassBlock()
Description copied from interface: DynamicMechComponent
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).

Specified by:
createMassBlock in interface DynamicMechComponent

isMassConstant

public boolean isMassConstant()
Specified by:
isMassConstant in interface DynamicMechComponent

getMass

public double getMass(double t)
Description copied from interface: DynamicMechComponent
Returns the scalar mass of this component at time t.

Specified by:
getMass in interface DynamicMechComponent

getMass

public void getMass(Matrix M,
                    double t)
Description copied from interface: DynamicMechComponent
Gets the mass of this component at a particular time.

Specified by:
getMass in interface DynamicMechComponent
Parameters:
M - matrix to return the mass in
t - current time

getMassForces

public int getMassForces(VectorNd f,
                         double t,
                         int idx)
Description copied from interface: DynamicMechComponent
Gets the mass forces for this component at a particular time. The forces should be stored in 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.

Specified by:
getMassForces in interface DynamicMechComponent
Parameters:
f - vector to return the forces in
t - current time
idx - starting location within f where forces should be stored
Returns:
updated value for idx

addSolveBlock

public void addSolveBlock(SparseNumberedBlockMatrix S)
Specified by:
addSolveBlock in interface DynamicMechComponent
Specified by:
addSolveBlock in class DynamicMechComponentBase

createSolveBlock

public MatrixBlock createSolveBlock()
Specified by:
createSolveBlock in interface DynamicMechComponent

setState

public void setState(DynamicMechComponent c)
Description copied from interface: DynamicMechComponent
Sets the state of this DynamicMechComponent from that of another.

Specified by:
setState in interface DynamicMechComponent
Parameters:
c - component from which the state is to be copied.

setState

public void setState(Point point)

setState

public int setState(VectorNd x,
                    int idx)

getState

public void getState(PointState state)

getState

public int getState(VectorNd x,
                    int idx)

addToSolveBlockDiagonal

public void addToSolveBlockDiagonal(SparseNumberedBlockMatrix S,
                                    double d)

velocityLimitExceeded

public boolean velocityLimitExceeded(double tlimit,
                                     double rlimit)
Checks if the current component velocity exceeds specified limits. Used to check solution stability.

Specified by:
velocityLimitExceeded in interface DynamicMechComponent
Parameters:
tlimit - translational velocity limit
rlimit - rotational velocity limit
Returns:
true if velocity exceeds specified limits

isDuplicatable

public boolean isDuplicatable()
Returns true if this component can be duplicated. Duplication means that we can expect to be able to make a complete copy of the component along with all it's external references. This method should return true if and only if CopyableComponent.getCopyReferences(java.util.List, artisynth.core.modelbase.ModelComponent) returns true.

This method is not currently used. It is intended to provide a faster way of determining if a component can be duplicated, without having to use CopyableComponent.getCopyReferences(java.util.List, artisynth.core.modelbase.ModelComponent) to build the list of copy references.

Specified by:
isDuplicatable in interface CopyableComponent
Returns:
true if this component can be duplicated.

getCopyReferences

public boolean getCopyReferences(java.util.List<ModelComponent> refs,
                                 ModelComponent ancestor)
Collects external references which must also be copied in order to duplicate this component. These references should exclude those which are contained within a specified component hierarchy. This method should return true if and only if CopyableComponent.isDuplicatable() returns true.

Specified by:
getCopyReferences in interface CopyableComponent
Parameters:
refs - list to which references are appended
ancestor - root node of the hierarchy from which references are to be excluded
Returns:
false if it is discovered that the component cannot be duplicated

copy

public ModelComponent copy(int flags,
                           java.util.Map<ModelComponent,ModelComponent> copyMap)
Description copied from interface: CopyableComponent
Create a copy of this component. If COPY_REFERENCES is set in flags, then any component referenced by this component should itself be set to a copy. This should be done first checking copyMap for an existing copy of the referenced component. If there is no existing copy, then a copy should be created by calling copy recursively and adding the new copy to copyMap.

Specified by:
copy in interface CopyableComponent
Overrides:
copy in class DynamicMechComponentBase

getVelStateSize

public int getVelStateSize()
Specified by:
getVelStateSize in interface DynamicMechComponent
Specified by:
getVelStateSize in interface MotionTargetComponent

getPosStateSize

public int getPosStateSize()
Specified by:
getPosStateSize in interface DynamicMechComponent
Specified by:
getPosStateSize in interface MotionTargetComponent