artisynth.core.mechmodels
Class RigidBodyConnector

java.lang.Object
  extended by artisynth.core.modelbase.ModelComponentBase
      extended by artisynth.core.modelbase.RenderableComponentBase
          extended by artisynth.core.mechmodels.RigidBodyConnector
All Implemented Interfaces:
Constrainer, HasAuxState, RigidBodyConstrainer, HasCoordinateFrame, ModelComponent, RenderableComponent, ScalableUnits, TransformableGeometry, java.lang.Cloneable, HasProperties, HierarchyNode, GLRenderable, GLSelectable, HasRenderProps, Renderable, Scannable
Direct Known Subclasses:
FullPlanarJoint, JointBase, PlanarConnector, SegmentedPlanarConnector

public abstract class RigidBodyConnector
extends RenderableComponentBase
implements ScalableUnits, TransformableGeometry, RigidBodyConstrainer, Constrainer, HasCoordinateFrame


Nested Class Summary
 
Nested classes/interfaces inherited from interface artisynth.core.mechmodels.HasAuxState
HasAuxState.StateContext
 
Nested classes/interfaces inherited from interface artisynth.core.modelbase.ModelComponent
ModelComponent.NavpanelVisibility
 
Field Summary
static PropertyList myProps
           
 
Fields inherited from class artisynth.core.modelbase.ModelComponentBase
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
 
Fields inherited from interface artisynth.core.util.TransformableGeometry
ARTICULATED, SIMULATING
 
Fields inherited from interface maspack.render.GLRenderable
TRANSLUCENT, TWO_DIMENSIONAL
 
Method Summary
 int addBilateralConstraints(SparseBlockMatrix GT, VectorNd dg, int numb, IntHolder changeCnt)
           
 int addFrictionConstraints(SparseBlockMatrix DT, MechSystem.FrictionInfo[] finfo, int numf)
           
static int addFrictionConstraints(SparseBlockMatrix DT, MechSystem.FrictionInfo[] finfo, int numf, java.util.ArrayList<RigidBodyConstraint> unilaterals, RigidBody bodyA, RigidBody bodyB, RigidTransform3d XCA)
           
 int addUnilateralConstraints(SparseBlockMatrix NT, VectorNd dn, int numu, IntHolder changeCnt)
           
 void advanceAuxState(double t0, double t1)
          Called at the very beginning of the time step (in the system's preadvance() method) to perform any required updating of the component's state before the application in input probes or controllers.
 void connectToHierarchy()
          Called by the system after this component is added to the component hierarchy (i.e., when it is added as a child of another CompositeComponent).
 ModelComponent copy(int flags, java.util.Map<ModelComponent,ModelComponent> copyMap)
           
 void disconnectFromHierarchy()
          Called by the system after this component is removed from the component hierarchy (i.e., when it is removed as a child of its parent).
 double getActivation(int idx)
          Returns the activation level associated with a specific constraint.
 PropertyList getAllPropertyInfo()
          Returns a list giving static information about all properties exported by this object.
 void getAuxState(DataBuffer data)
          Saves state information for this component by adding data to the supplied DataBuffer.
 MatrixNdBlock getBilateralBlockA(int numb)
           
 MatrixNdBlock getBilateralBlockB(int numb)
           
 int getBilateralConstraints(java.util.ArrayList<RigidBodyConstraint> bilaterals)
          Gets the bilateral constraints associated with this constrainer.
 Wrench getBilateralForceInA()
          Returns the most recently computed bilateral constraint force as seen in the coordinate frame of body A.
 void getBilateralForceInA(Wrench wr)
          Returns the most recently computed bilateral constraint force as seen in the coordinate frame of body A.
 int getBilateralImpulses(VectorNd lam, int idx)
           
 int getBilateralInfo(MechSystem.ConstraintInfo[] ginfo, int idx)
           
 void getBilateralSizes(VectorNi sizes)
           
 RigidBody getBodyA()
          Returns the first body associated with this constrainer.
 RigidBody getBodyB()
          Returns the second body associated with this constrainer, or null if there is no such body.
 double getBreakAccel()
           
 double getBreakSpeed()
           
 VectorNd getCompliance()
           
 double getContactDistance()
           
 boolean getCopyReferences(java.util.List<ModelComponent> refs, ModelComponent ancestor)
           
 void getCurrentXDB(RigidTransform3d XDB)
           
 RigidTransform3d getCurrentXDW()
           
 void getCurrentXFA(RigidTransform3d XFA)
           
 RigidTransform3d getCurrentXFW()
           
 VectorNd getDamping()
           
 void getHardReferences(java.util.List<ModelComponent> refs)
          Appends all hard references for this component to a list.
 void getInitialAuxState(DataBuffer newData, DataBuffer oldData)
          Saves initial state information data for this component by adding data to the supplied data buffer.
 double getLinearCompliance()
           
 double getPenetrationTol()
           
 PropertyMode getPenetrationTolMode()
           
 void getPose(RigidTransform3d X)
           
 double getRotaryCompliance()
           
 MatrixNdBlock getUnilateralBlockA(int numb)
           
 MatrixNdBlock getUnilateralBlockB(int numb)
           
 double getUnilateralConstraints(java.util.ArrayList<RigidBodyConstraint> unilaterals, boolean setEngaged)
          Gets the unilateral constraints associated with this constrainer.
 Wrench getUnilateralForceInA()
          Returns the most recently computed unilateral constraint force as seen in the coordinate frame of body A.
 void getUnilateralForceInA(Wrench wr)
          Returns the most recently computed unilateral constraint force as seen in the coordinate frame of body A.
 int getUnilateralImpulses(VectorNd the, int idx)
           
 int getUnilateralInfo(MechSystem.ConstraintInfo[] ninfo, int idx)
           
 void getUnilateralSizes(VectorNi sizes)
           
 RigidTransform3d getXCA()
          Returns the most recently updated value for XCA.
 RigidTransform3d getXCB()
          Returns the most recently updated value for XCB.
 RigidTransform3d getXDB()
           
 RigidTransform3d getXFA()
           
 boolean hasState()
          Returns true if this component has state.
 boolean hasUnilateralConstraints()
          Returns true if this constrainer has unilateral constraints.
 boolean isActive()
          Returns true if this RigidBodyConnectorX is enabled and at least one of it's associated RigidBodies is active.
 boolean isDuplicatable()
           
 boolean isEnabled()
           
 int maxFrictionConstraintSets()
           
 int numBilateralConstraints()
          Returns the number of bilateral constraints associated with this constrainer.
 int numBodies()
           
 int numUnilateralConstraints()
          Returns the number of unilateral constraints which are currently engaged.
 void scaleDistance(double s)
          Scales all distance coordinates.
 void scaleMass(double m)
          Nothing to do for scale mass.
 void setAuxState(DataBuffer data)
          Restores the state for this component by reading from the supplied data buffer, starting at the current buffer offsets.
 int setBilateralImpulses(VectorNd lam, double h, int idx)
           
 void setBodies(RigidBody bodyA, RigidTransform3d XFA, RigidBody bodyB, RigidTransform3d XDB)
           
 void setBreakAccel(double a)
           
 void setBreakSpeed(double s)
           
 void setCompliance(VectorNd compliance)
           
 void setContactDistance(double d)
           
 void setDamping(VectorNd damping)
           
 void setEnabled(boolean enabled)
           
 void setLinearCompliance(double c)
           
 void setPenetrationTol(double tol)
          Sets the penetration tolerance for this component.
 void setPenetrationTolMode(PropertyMode mode)
           
 void setRotaryCompliance(double c)
           
 int setUnilateralImpulses(VectorNd the, double h, int idx)
           
 void setXDB(RigidTransform3d XDB)
           
 void setXFA(RigidTransform3d XFA)
           
 void skipAuxState(DataBuffer data)
          Skips over the state information for this component contained in the supplied data buffer, starting at the current buffer offsets.
 void transformGeometry(AffineTransform3dBase X)
          Applies an affine transformation to the geometry of this object.
 void transformGeometry(AffineTransform3dBase X, TransformableGeometry topObject, int flags)
          Adjusts the global location of this constraint, assuming the global locations of A and B remain unchanged.
 void updateBodyStates(double t, boolean setEngaged)
          Updates internal information needed for computing constraints.
 void updateBounds(Point3d pmin, Point3d pmax)
          Update the minimum and maximum points for this object.
 double updateConstraints(double t, int flags)
           
 void updateForBodyPositionChange(RigidBody body, RigidTransform3d XBodyToWorldNew)
           
 void updateUnilateralConstraints(java.util.ArrayList<RigidBodyConstraint> unilaterals, int offset, int numc)
          Updates the unilateral constraints associated with this constrainer.
 void zeroImpulses()
           
 
Methods inherited from class artisynth.core.modelbase.RenderableComponentBase
createRenderProps, getRenderHints, getRenderProps, getSelection, isSelectable, numSelectionQueriesNeeded, prerender, render, setRenderProps, updateRenderProps
 
Methods inherited from class artisynth.core.modelbase.ModelComponentBase
checkFlag, checkName, checkNameUniqueness, clearFlag, clone, createTempFlag, getChildren, getGrandParent, 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 artisynth.core.modelbase.ModelComponent
getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, isFixed, isMarked, isSelected, notifyParentOfChange, postscan, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, updateReferences
 
Methods inherited from interface maspack.properties.HasProperties
getProperty
 
Methods inherited from interface maspack.properties.HierarchyNode
getChildren, hasChildren
 
Methods inherited from interface maspack.util.Scannable
isWritable, write
 

Field Detail

myProps

public static PropertyList myProps
Method Detail

setPenetrationTol

public void setPenetrationTol(double tol)
Sets the penetration tolerance for this component. Setting a value of -1 will cause a default value to be computed based on the radius of the topmost MechModel.

Specified by:
setPenetrationTol in interface RigidBodyConstrainer
Parameters:
tol - new penetration tolerance

getPenetrationTol

public double getPenetrationTol()
Specified by:
getPenetrationTol in interface RigidBodyConstrainer

getPenetrationTolMode

public PropertyMode getPenetrationTolMode()

setPenetrationTolMode

public void setPenetrationTolMode(PropertyMode mode)

getBilateralForceInA

public void getBilateralForceInA(Wrench wr)
Returns the most recently computed bilateral constraint force as seen in the coordinate frame of body A. This method is more efficient than than getBilateralForceInA(maspack.spatialmotion.Wrench) since it does not allocate a Wrench object.

Parameters:
wr - returns the constraint force

getBilateralForceInA

public Wrench getBilateralForceInA()
Returns the most recently computed bilateral constraint force as seen in the coordinate frame of body A.

Returns:
bilateral constraint force in body A

getUnilateralForceInA

public void getUnilateralForceInA(Wrench wr)
Returns the most recently computed unilateral constraint force as seen in the coordinate frame of body A. This method is more efficient than than getUnilateralForceInA(maspack.spatialmotion.Wrench) since it does not allocate a Wrench object.

Parameters:
wr - returns the constraint force

getUnilateralForceInA

public Wrench getUnilateralForceInA()
Returns the most recently computed unilateral constraint force as seen in the coordinate frame of body A.

Returns:
unilateral constraint force in body A

getLinearCompliance

public double getLinearCompliance()

setLinearCompliance

public void setLinearCompliance(double c)

getRotaryCompliance

public double getRotaryCompliance()

setRotaryCompliance

public void setRotaryCompliance(double c)

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

getCompliance

public VectorNd getCompliance()

setCompliance

public void setCompliance(VectorNd compliance)

getDamping

public VectorNd getDamping()

setDamping

public void setDamping(VectorNd damping)

setEnabled

public void setEnabled(boolean enabled)

isEnabled

public boolean isEnabled()

numBodies

public int numBodies()

getBodyA

public RigidBody getBodyA()
Description copied from interface: RigidBodyConstrainer
Returns the first body associated with this constrainer.

Specified by:
getBodyA in interface RigidBodyConstrainer
Returns:
first body associated with this constrainer

getBodyB

public RigidBody getBodyB()
Description copied from interface: RigidBodyConstrainer
Returns the second body associated with this constrainer, or null if there is no such body.

Specified by:
getBodyB in interface RigidBodyConstrainer
Returns:
second body associated with this constrainer

getBilateralBlockA

public MatrixNdBlock getBilateralBlockA(int numb)
Specified by:
getBilateralBlockA in interface RigidBodyConstrainer

getBilateralBlockB

public MatrixNdBlock getBilateralBlockB(int numb)
Specified by:
getBilateralBlockB in interface RigidBodyConstrainer

getUnilateralBlockA

public MatrixNdBlock getUnilateralBlockA(int numb)
Specified by:
getUnilateralBlockA in interface RigidBodyConstrainer

getUnilateralBlockB

public MatrixNdBlock getUnilateralBlockB(int numb)
Specified by:
getUnilateralBlockB in interface RigidBodyConstrainer

getXFA

public RigidTransform3d getXFA()

getCurrentXFA

public void getCurrentXFA(RigidTransform3d XFA)

setXFA

public void setXFA(RigidTransform3d XFA)

getXDB

public RigidTransform3d getXDB()

getCurrentXDB

public void getCurrentXDB(RigidTransform3d XDB)

setXDB

public void setXDB(RigidTransform3d XDB)

numBilateralConstraints

public int numBilateralConstraints()
Description copied from interface: RigidBodyConstrainer
Returns the number of bilateral constraints associated with this constrainer.

Specified by:
numBilateralConstraints in interface RigidBodyConstrainer
Returns:
number of bilateral constraints

numUnilateralConstraints

public int numUnilateralConstraints()
Description copied from interface: RigidBodyConstrainer
Returns the number of unilateral constraints which are currently engaged. This should be the same as the number of constraints that would be returned by getUnilateralConstraints with setEngaged set to false.

Specified by:
numUnilateralConstraints in interface RigidBodyConstrainer
Returns:
number of currently engaged unilateral constraints

getBilateralSizes

public void getBilateralSizes(VectorNi sizes)
Specified by:
getBilateralSizes in interface Constrainer
Specified by:
getBilateralSizes in interface RigidBodyConstrainer

getUnilateralSizes

public void getUnilateralSizes(VectorNi sizes)
Specified by:
getUnilateralSizes in interface Constrainer
Specified by:
getUnilateralSizes in interface RigidBodyConstrainer

updateConstraints

public double updateConstraints(double t,
                                int flags)
Specified by:
updateConstraints in interface Constrainer
Specified by:
updateConstraints in interface RigidBodyConstrainer

addBilateralConstraints

public int addBilateralConstraints(SparseBlockMatrix GT,
                                   VectorNd dg,
                                   int numb,
                                   IntHolder changeCnt)
Specified by:
addBilateralConstraints in interface Constrainer

getBilateralInfo

public int getBilateralInfo(MechSystem.ConstraintInfo[] ginfo,
                            int idx)
Specified by:
getBilateralInfo in interface Constrainer

addUnilateralConstraints

public int addUnilateralConstraints(SparseBlockMatrix NT,
                                    VectorNd dn,
                                    int numu,
                                    IntHolder changeCnt)
Specified by:
addUnilateralConstraints in interface Constrainer

getUnilateralInfo

public int getUnilateralInfo(MechSystem.ConstraintInfo[] ninfo,
                             int idx)
Specified by:
getUnilateralInfo in interface Constrainer

maxFrictionConstraintSets

public int maxFrictionConstraintSets()
Specified by:
maxFrictionConstraintSets in interface Constrainer

addFrictionConstraints

public int addFrictionConstraints(SparseBlockMatrix DT,
                                  MechSystem.FrictionInfo[] finfo,
                                  int numf)
Specified by:
addFrictionConstraints in interface Constrainer

addFrictionConstraints

public static int addFrictionConstraints(SparseBlockMatrix DT,
                                         MechSystem.FrictionInfo[] finfo,
                                         int numf,
                                         java.util.ArrayList<RigidBodyConstraint> unilaterals,
                                         RigidBody bodyA,
                                         RigidBody bodyB,
                                         RigidTransform3d XCA)

setBodies

public void setBodies(RigidBody bodyA,
                      RigidTransform3d XFA,
                      RigidBody bodyB,
                      RigidTransform3d XDB)

getCurrentXDW

public RigidTransform3d getCurrentXDW()

getPose

public void getPose(RigidTransform3d X)
Specified by:
getPose in interface HasCoordinateFrame

getCurrentXFW

public RigidTransform3d getCurrentXFW()

getActivation

public double getActivation(int idx)
Returns the activation level associated with a specific constraint.

Parameters:
idx - index of the constraint
Returns:
activation level of the constraint

updateBodyStates

public void updateBodyStates(double t,
                             boolean setEngaged)
Description copied from interface: RigidBodyConstrainer
Updates internal information needed for computing constraints.

Specified by:
updateBodyStates in interface RigidBodyConstrainer
Parameters:
t - current time (seconds)
setEngaged - if true, then the method should determine which unilateral constraints are engaged

getXCA

public RigidTransform3d getXCA()
Returns the most recently updated value for XCA. This update is done whenever updateBodyStates() is called. The returned value must be treated as read-only and not modified.

Returns:
current value for XCA.

getXCB

public RigidTransform3d getXCB()
Returns the most recently updated value for XCB. This update is done whenever updateBodyStates() is called. The returned value must be treated as read-only and not modified.

Returns:
current value for XCB.

scaleMass

public void scaleMass(double m)
Nothing to do for scale mass.

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

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

getBilateralConstraints

public int getBilateralConstraints(java.util.ArrayList<RigidBodyConstraint> bilaterals)
Description copied from interface: RigidBodyConstrainer
Gets the bilateral constraints associated with this constrainer. They are supplied by the constrainer and appended to an array list.

Specified by:
getBilateralConstraints in interface RigidBodyConstrainer
Parameters:
bilaterals - array list into which the constrainer places the constraints

setBilateralImpulses

public int setBilateralImpulses(VectorNd lam,
                                double h,
                                int idx)
Specified by:
setBilateralImpulses in interface Constrainer
Specified by:
setBilateralImpulses in interface RigidBodyConstrainer

getBilateralImpulses

public int getBilateralImpulses(VectorNd lam,
                                int idx)
Specified by:
getBilateralImpulses in interface Constrainer
Specified by:
getBilateralImpulses in interface RigidBodyConstrainer

zeroImpulses

public void zeroImpulses()
Specified by:
zeroImpulses in interface Constrainer
Specified by:
zeroImpulses in interface RigidBodyConstrainer

hasUnilateralConstraints

public boolean hasUnilateralConstraints()
Description copied from interface: RigidBodyConstrainer
Returns true if this constrainer has unilateral constraints.

Specified by:
hasUnilateralConstraints in interface RigidBodyConstrainer
Returns:
true if there are unilateral constraints

setContactDistance

public void setContactDistance(double d)

getContactDistance

public double getContactDistance()

setBreakSpeed

public void setBreakSpeed(double s)

getBreakSpeed

public double getBreakSpeed()

setBreakAccel

public void setBreakAccel(double a)

getBreakAccel

public double getBreakAccel()

getUnilateralConstraints

public double getUnilateralConstraints(java.util.ArrayList<RigidBodyConstraint> unilaterals,
                                       boolean setEngaged)
Description copied from interface: RigidBodyConstrainer
Gets the unilateral constraints associated with this constrainer. They are supplied by the constrainer and appended to an array list.

Specified by:
getUnilateralConstraints in interface RigidBodyConstrainer
Parameters:
unilaterals - array list into which the constrainer places the constraints
setEngaged - if true, recompute the set of unilateral constraints. If false, the set of unilateral constraints will stay the same.
Returns:
maximum penetration of the unilateral constraints

updateUnilateralConstraints

public void updateUnilateralConstraints(java.util.ArrayList<RigidBodyConstraint> unilaterals,
                                        int offset,
                                        int numc)
Description copied from interface: RigidBodyConstrainer
Updates the unilateral constraints associated with this constrainer. The constraints are the same as those returned by the most recent call to getUnilateralConstraints, located at a specific offset within an array list.

Specified by:
updateUnilateralConstraints in interface RigidBodyConstrainer
Parameters:
unilaterals - contains constraints which should be updated
offset - starting location of constraints within unilaterals
numc - number of constraints to update

setUnilateralImpulses

public int setUnilateralImpulses(VectorNd the,
                                 double h,
                                 int idx)
Specified by:
setUnilateralImpulses in interface Constrainer
Specified by:
setUnilateralImpulses in interface RigidBodyConstrainer

getUnilateralImpulses

public int getUnilateralImpulses(VectorNd the,
                                 int idx)
Specified by:
getUnilateralImpulses in interface Constrainer
Specified by:
getUnilateralImpulses in interface RigidBodyConstrainer

isActive

public boolean isActive()
Returns true if this RigidBodyConnectorX is enabled and at least one of it's associated RigidBodies is active.


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

transformGeometry

public void transformGeometry(AffineTransform3dBase X,
                              TransformableGeometry topObject,
                              int flags)
Adjusts the global location of this constraint, assuming the global locations of A and B remain unchanged.

If XDW represents frame D in world coordinates, then XDW is adjusted according to

    XDW' = X XDW
 
This transformation is done using mulAffineLeft, which removes the stretching and shearing components from X when adjusting the rotation matrix. The transforms XDB is then updated accordingly. A similar procedure is used for XFA.

Specified by:
transformGeometry in interface TransformableGeometry
Parameters:
X - an affine transform applied to frames D and F in world coordinates
topObject - top-most object being transformed
flags -

getHardReferences

public void getHardReferences(java.util.List<ModelComponent> refs)
Description copied from class: ModelComponentBase
Appends all hard references for this component to a list. References are other components, outside of this component's immediate ancestry, on which this component depends. For example, an AxialSpring refers to two Point components as for it's end points. A hard reference is one which the referring component must have, and which if deleted, implies that the referring component should be deleted too.

Specified by:
getHardReferences in interface ModelComponent
Overrides:
getHardReferences in class ModelComponentBase
Parameters:
refs - list to which hard references are appended

connectToHierarchy

public void connectToHierarchy()
Description copied from class: ModelComponentBase
Called by the system after this component is added to the component hierarchy (i.e., when it is added as a child of another CompositeComponent). This method is responsible for doing any required hierarchy-dependent initialization.

When this method is called, ModelComponent.getParent() will return the new parent component; the system will have set this beforehand.

Specified by:
connectToHierarchy in interface ModelComponent
Overrides:
connectToHierarchy in class ModelComponentBase

disconnectFromHierarchy

public void disconnectFromHierarchy()
Description copied from class: ModelComponentBase
Called by the system after this component is removed from the component hierarchy (i.e., when it is removed as a child of its parent). This method is responsible for any required hierarchy-dependent deinitialization.

When this method is called, ModelComponent.getParent() will still return this original parent component; the system will set this to null after.

Specified by:
disconnectFromHierarchy in interface ModelComponent
Overrides:
disconnectFromHierarchy in class ModelComponentBase

isDuplicatable

public boolean isDuplicatable()

getCopyReferences

public boolean getCopyReferences(java.util.List<ModelComponent> refs,
                                 ModelComponent ancestor)

copy

public ModelComponent copy(int flags,
                           java.util.Map<ModelComponent,ModelComponent> copyMap)
Overrides:
copy 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

updateForBodyPositionChange

public void updateForBodyPositionChange(RigidBody body,
                                        RigidTransform3d XBodyToWorldNew)

advanceAuxState

public void advanceAuxState(double t0,
                            double t1)
Description copied from interface: HasAuxState
Called at the very beginning of the time step (in the system's preadvance() method) to perform any required updating of the component's state before the application in input probes or controllers. If no such updating is required, this method may do nothing.

Specified by:
advanceAuxState in interface HasAuxState
Parameters:
t0 - beginning time associated with the time step advance
t1 - end time associated with the time step advance

skipAuxState

public void skipAuxState(DataBuffer data)
Skips over the state information for this component contained in the supplied data buffer, starting at the current buffer offsets. Essentially this a dummy read; the buffer offsets should be advanced over the state information, but that information should not actually be stored in the component.

Specified by:
skipAuxState in interface HasAuxState
Parameters:
data - buffer containing the state information

getAuxState

public void getAuxState(DataBuffer data)
Description copied from interface: HasAuxState
Saves state information for this component by adding data to the supplied DataBuffer. Existing data in the buffer should not be disturbed.

Specified by:
getAuxState in interface HasAuxState
Parameters:
data - buffer for storing the state values.

setAuxState

public void setAuxState(DataBuffer data)
Description copied from interface: HasAuxState
Restores the state for this component by reading from the supplied data buffer, starting at the current buffer offsets.

Specified by:
setAuxState in interface HasAuxState
Parameters:
data - buffer containing the state information

getInitialAuxState

public void getInitialAuxState(DataBuffer newData,
                               DataBuffer oldData)
Description copied from interface: HasAuxState
Saves initial state information data for this component by adding data to the supplied data buffer. Existing data in the buffer should not be disturbed.

If oldData is non-null, then this contains previously stored initial state information (starting at its current buffer offsets), which should be stored into newData in place of the current component state data. This may only be partially possible if the component's state structure has changed since oldData was written.

Specified by:
getInitialAuxState in interface HasAuxState
Parameters:
newData - buffer for storing the state values.
oldData - if non-null, contains old state information that should be written into newData in place of the current state information.

hasState

public boolean hasState()
Returns true if this component has state. Structure change events involving components that have state will cause the current state history of of the system to be cleared.

Specified by:
hasState in interface ModelComponent
Overrides:
hasState in class ModelComponentBase