public class RigidBody extends Frame implements CollidableBody, HasSurfaceMesh, HasDistanceGrid, ConnectableBody
| Modifier and Type | Class and Description | 
|---|---|
| static class  | RigidBody.DistanceSurfaceRenderingDescribes how the distance surface should be rendered, if at all | 
| static class  | RigidBody.InertiaMethod | 
Collidable.Collidability, Collidable.Group| Modifier and Type | Field and Description | 
|---|---|
| static PropertyList | myProps | 
dynamicVelInWorldCoords, myRenderFrameenforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNamesAll, AllBodies, Deformable, Rigid, SelfCOPY_REFERENCESTG_ARTICULATED, TG_DRAGGER, TG_PRESERVE_ORIENTATION, TG_SIMULATINGTRANSPARENT, TWO_DIMENSIONAL| Constructor and Description | 
|---|
| RigidBody() | 
| RigidBody(RigidTransform3d XBodyToWorld,
         SpatialInertia M,
         PolygonalMesh mesh,
         java.lang.String meshFileName) | 
| RigidBody(java.lang.String name) | 
| Modifier and Type | Method and Description | 
|---|---|
| void | addConnector(BodyConnector c) | 
| void | addEffectiveInertia(SpatialInertia M) | 
| void | addEffectivePointMass(double m,
                     Vector3d loc)Adds a point mass to the effective spatial inertia for this Frame. | 
| boolean | allowCollision(ContactPoint cpnt,
              Collidable other,
              java.util.Set<Vertex3d> attachedVertices)Returns  trueif a collision between this Collidable
 andothershould be allowed for the contact pointcpnt. | 
| void | applyGravity(Vector3d gacc)Applies a gravity force to this component, given a prescribed
 gravity acceleration vector. | 
| void | centerPoseOnCenterOfMass()Adjusts the pose so that it reflects the rigid body's center of mass | 
| double | computeVolume() | 
| boolean | containsContactMaster(CollidableDynamicComponent comp)Returns true if this Collidable contains a specified contact master
 component. | 
| RigidBody | copy(int flags,
    java.util.Map<ModelComponent,ModelComponent> copyMap)Create a copy of this component. | 
| static RigidBody | createBox(java.lang.String bodyName,
         double wx,
         double wy,
         double wz,
         double density)Creates a box-shaped RigidBody with a prescribed uniform density. | 
| static RigidBody | createBox(java.lang.String bodyName,
         double wx,
         double wy,
         double wz,
         double density,
         boolean addNormals)Creates a box-shaped RigidBody with a prescribed uniform density. | 
| static RigidBody | createCylinder(java.lang.String bodyName,
              double r,
              double h,
              double density,
              int nsides)Creates a cylindrical RigidBody with a prescribed uniform density. | 
| static RigidBody | createEllipsoid(java.lang.String bodyName,
               double a,
               double b,
               double c,
               double density,
               int nslices)Creates an ellipsoidal RigidBody with a prescribed uniform density. | 
| static RigidBody | createFromMesh(java.lang.String bodyName,
              java.lang.Object obj,
              java.lang.String relPath,
              double density,
              double scale) | 
| static RigidBody | createFromMesh(java.lang.String bodyName,
              PolygonalMesh mesh,
              double density,
              double scale) | 
| static RigidBody | createFromMesh(java.lang.String bodyName,
              PolygonalMesh mesh,
              java.lang.String meshFilePath,
              double density,
              double scale) | 
| static RigidBody | createFromMesh(java.lang.String bodyName,
              java.lang.String meshPath,
              double density,
              double scale) | 
| static RigidBody | createIcosahedralSphere(java.lang.String bodyName,
                       double r,
                       double density,
                       int ndivisions)Creates an icosahedrally spherical RigidBody with a prescribed uniform
 density. | 
| RenderProps | createRenderProps()Factory method to create render properties appropriate to this object. | 
| static RigidBody | createSphere(java.lang.String bodyName,
            double r,
            double density,
            int nslices)Creates an spherical RigidBody with a prescribed uniform density. | 
| void | extrapolatePose(Twist vel,
               double h) | 
| PropertyList | getAllPropertyInfo()Returns a list giving static information about all properties exported by
 this object. | 
| Point3d | getCenterOfMass() | 
| void | getCenterOfMass(Point3d com) | 
| Collidable.Collidability | getCollidable()Returns the  Collidable.Collidabilityof this Collidable. | 
| Collidable | getCollidableAncestor()Returns the most immediate Collidable ancestor of this Collidable,
 if any. | 
| int | getCollidableIndex() | 
| PolygonalMesh | getCollisionMesh()Returns the mesh that should be used for computing collisions, or
  nullif there is no such mesh. | 
| java.util.List<BodyConnector> | getConnectors() | 
| boolean | getCopyReferences(java.util.List<ModelComponent> refs,
                 ModelComponent ancestor)Collects external references which must also be copied in order to
 duplicate this component. | 
| double | getDensity()Returns the density of this body. | 
| Range | getDensityRange() | 
| DistanceGrid | getDistanceGrid()Returns a signed distance grid that can be used with a
 SignedDistanceCollider, or  nullif a grid is not available
 (i.e., ifhasDistanceGrid()returnsfalse). | 
| int | getDistanceGridMaxRes()Returns the default maximum cell resolution that should be used when
 constructing a signed distance grid for this component. | 
| boolean | getDistanceGridOBB() | 
| java.lang.String | getDistanceGridRenderRanges()Returns a string describing the x, y, z vertex ranges used when rendering
 this component's signed distance grid. | 
| Range | getDistanceGridRenderRangesRange() | 
| Vector3i | getDistanceGridRes()Returns the cell resolutions (in the x, y, and z directions) that should
 be used when constructing a signed distance grid for this component. | 
| double | getDistanceSurfaceIso() | 
| SpatialInertia | getEffectiveInertia() | 
| void | getEffectiveMass(Matrix M,
                double t)Gets the effective mass of this component at a particular time. | 
| static int | getEffectiveMassForces(VectorNd f,
                      double t,
                      FrameState state,
                      SpatialInertia effectiveInertia,
                      int idx) | 
| int | getEffectiveMassForces(VectorNd f,
                      double t,
                      int idx)Gets the mass forces for this component at a particular time. | 
| AffineTransform3d | getFileTransform() | 
| FrameMarker[] | getFrameMarkers()Returns an array of all FrameMarkers currently associated with this rigid
 body. | 
| void | getInertia(SpatialInertia M) | 
| RigidBody.InertiaMethod | getInertiaMethod() | 
| void | getInverseMass(Matrix Minv,
              Matrix M)Inverts a mass for this component. | 
| double | getMass()Returns the mass of this body. | 
| 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. | 
| Range | getMassRange() | 
| PolygonalMesh | getMesh() | 
| java.lang.String | getMeshFileName() | 
| AffineTransform3dBase | getMeshFileTransform()Returns the file transform associated with this rigid body's mesh. | 
| boolean | getRenderDistanceGrid()Queries whether this component's signed distance grid should be rendered. | 
| RigidBody.DistanceSurfaceRendering | getRenderDistanceSurface()Queries if and how the distance surface is rendered. | 
| SymmetricMatrix3d | getRotationalInertia()Returns the rotational inertia of this body. | 
| void | getRotationalInertia(SymmetricMatrix3d J) | 
| PolygonalMesh | getSurfaceMesh()Returns the surface mesh associated with this component, or
  nullif no mesh exists. | 
| PolygonalMesh[] | getSurfaceMeshes()Returns an array listing all the (non-null) surface meshes associated
 with this component, or a zero-length array if there are none. | 
| void | getVertexMasters(java.util.List<ContactMaster> mlist,
                Vertex3d vtx)Returns all the contact master components associated with a particular
 mesh vertex. | 
| boolean | hasDistanceGrid()Returns  trueif this RigidBody supports a signed
 distance grid that can be used with a SignedDistanceCollider. | 
| boolean | isCompound()Queries whether or not this collidable has sub-collidables. | 
| boolean | isDeformable()Returns  trueif this collidable is deformable. | 
| boolean | isDuplicatable()Returns true if this component can be duplicated. | 
| boolean | isFileTransformRigid() | 
| boolean | isFreeBody() | 
| boolean | isMassConstant() | 
| boolean | isMeshModfied() | 
| int | mulInverseEffectiveMass(Matrix M,
                       double[] a,
                       double[] f,
                       int idx) | 
| static int | mulInverseEffectiveMass(SpatialInertia S,
                       double[] a,
                       double[] f,
                       int idx) | 
| int | numSurfaceMeshes()Returns the number of surfaces meshes associated with this
 component, or 0 if no meshes exist. | 
| void | prerender(RenderList list)Called prior to rendering to allow this object to update the internal
 state required for rendering (such as by caching rendering coordinates). | 
| void | removeConnector(BodyConnector c) | 
| 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 | scaleDistance(double s)Scales all distance coordinates. | 
| void | scaleMass(double s)Scales all mass units. | 
| void | scaleMesh(double s) | 
| void | scaleMesh(double sx,
         double sy,
         double sz) | 
| void | scan(ReaderTokenizer rtok,
    java.lang.Object ref)Scans this element from a ReaderTokenizer. | 
| void | setCenterOfMass(Point3d com) | 
| void | setCollidable(Collidable.Collidability c) | 
| void | setCollidableIndex(int idx) | 
| void | setDensity(double density)Sets the density for the mesh, which is defined at the mass divided
 by the mesh volume. | 
| void | setDistanceGridMaxRes(int max)Sets the default maximum cell resolution that should be used when
 constructing a signed distance grid for this component. | 
| void | setDistanceGridOBB(boolean enable) | 
| void | setDistanceGridRenderRanges(java.lang.String ranges)Specifies the x, y, z vertex ranges used when rendering this component's
 signed distance grid. | 
| void | setDistanceGridRes(Vector3i res)Sets the cell resolution (in the x, y, and z directions) that should be
 used when constructing a signed distance grid for this component. | 
| void | setDistanceSurfaceIso(double iso) | 
| void | setDynamic(boolean dynamic) | 
| void | setInertia(double m,
          double Jxx,
          double Jyy,
          double Jzz)Explicitly sets the mass and rotational inertia of this body. | 
| void | setInertia(double m,
          SymmetricMatrix3d J)Explicitly sets the mass and rotational inertia of this body. | 
| void | setInertia(double m,
          SymmetricMatrix3d J,
          Point3d com)Explicitly sets the mass, rotational inertia, and center of mass of this
 body. | 
| void | setInertia(SpatialInertia M)Explicitly sets the spatial inertia of this body. | 
| void | setInertiaFromDensity(double density)Causes the inertia to be automatically computed from the mesh volume
 and a given density. | 
| void | setInertiaFromMass(double mass)Causes the inertia to be automatically computed from the mesh volume
 and a given mass (with the density computed by dividing the mass
 by the mesh volume). | 
| void | setInertiaMethod(RigidBody.InertiaMethod method)Sets the  InertiaMethodmethod used to
 determine the inertia for this RigidBody. | 
| void | setMass(double mass)Sets the mass for the mesh. | 
| void | setMesh(PolygonalMesh mesh) | 
| void | setMesh(PolygonalMesh mesh,
       java.lang.String fileName) | 
| void | setMesh(PolygonalMesh mesh,
       java.lang.String fileName,
       AffineTransform3dBase X)Sets a mesh for this body. | 
| void | setMeshFileName(java.lang.String filename) | 
| void | setPose(double x,
       double y,
       double z,
       double roll,
       double pitch,
       double yaw) | 
| void | setRenderDistanceGrid(boolean enable)Enables or disables rendering of this component's signed distance grid. | 
| void | setRenderDistanceSurface(RigidBody.DistanceSurfaceRendering rendering)Specifies if and how the distance surface is rendered. | 
| void | setRotationalInertia(SymmetricMatrix3d J)Explicitly sets the rotational inertia of this body. | 
| void | setSurfaceMesh(PolygonalMesh mesh,
              java.lang.String fileName) | 
| void | setSurfaceMesh(PolygonalMesh mesh,
              java.lang.String fileName,
              AffineTransform3dBase X)Sets a mesh for this body. | 
| void | transformGeometry(GeometryTransformer gtr,
                 TransformGeometryContext context,
                 int flags)Transforms the geometry of this component, using the geometry transformer
  gtrto transform its individual attributes. | 
| void | updateAttachmentPosStates() | 
| void | updateBounds(Vector3d pmin,
            Vector3d pmax)Update the minimum and maximum points for this object. | 
| void | write(java.io.PrintWriter pw,
     NumberFormat fmt,
     java.lang.Object ref)Writes a text description of this element to a PrintWriter. | 
addExternalForce, addForce, addPointForce, addPointForce, addPointMass, addPosImpulse, addPosJacobian, addScaledExternalForce, addSolveBlock, addSolveBlocks, addTargetJacobian, addToPointVelocity, addTransformableDependencies, addVelJacobian, applyExternalForces, applyForces, computeAppliedWrench, computeLocalPointForceJacobian, computePointCoriolis, computePointLocation, computePointPosition, computePointVelocity, computePointVelocity, computePointVelocity, computeWorldPointForceJacobian, createFrameAttachment, createMassBlock, createPointAttachment, getAxisLength, getBodyForce, getBodyVelocity, getBodyVelState, getExternalForce, getForce, getForce, getForce, getFrameDamping, getFrameDampingMode, getJacobianType, getMoment, getOrientation, getOrientation, getPosDerivative, getPose, getPose, getPosition, getPosState, getPosStateSize, getRotaryDamping, getRotaryDampingMode, getRotation, getSelection, getTargetActivity, getTargetOrientation, getTargetPos, getTargetPose, getTargetPosition, getTargetVel, getTargetVelocity, getTraceablePositionProperty, getTraceables, getTransForce, getVelocity, getVelocity, getVelState, getVelStateSize, getWorldVelState, resetTargets, setAxisLength, setBodyVelocity, setContactConstraint, setExternalForce, setForce, setForce, setFrameDamping, setFrameDampingMode, setOrientation, setPose, setPosition, setPosState, setRotaryDamping, setRotaryDampingMode, setRotation, setState, setTargetActivity, setTargetOrientation, setTargetPos, setTargetPose, setTargetPosition, setTargetVel, setTargetVelocity, setVelocity, setVelocity, setVelState, subPointForce, subPointForce, transformPose, velocityLimitExceeded, zeroExternalForces, zeroForcesaddConstrainer, addMasterAttachment, getAttachment, getConstrainers, getMasterAttachments, getSolveIndex, hasState, isActive, isAttached, isControllable, isDynamic, isParametric, removeConstrainer, removeMasterAttachment, setAttached, setSolveIndex, transformGeometrygetRenderHints, getRenderProps, isSelectable, numSelectionQueriesNeeded, setRenderProps, updateRenderPropscheckFlag, checkName, checkNameUniqueness, clearFlag, clone, connectToHierarchy, createTempFlag, disconnectFromHierarchy, getChildren, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasChildren, isConnectedToHierarchy, isFixed, isMarked, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, postscan, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setSelected, updateReferencesequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittransformPosecreateFrameAttachmentcreatePointAttachmentaddConstrainer, addMasterAttachment, checkFlag, clearFlag, getAttachment, getConstrainers, getMasterAttachments, getSolveIndex, isActive, isAttached, isControllable, isDynamic, isParametric, removeConstrainer, removeMasterAttachment, setAttached, setFlag, setSolveIndextransformGeometrypublic static PropertyList myProps
public RigidBody()
public RigidBody(java.lang.String name)
public RigidBody(RigidTransform3d XBodyToWorld, SpatialInertia M, PolygonalMesh mesh, java.lang.String meshFileName)
public PropertyList getAllPropertyInfo()
HasPropertiesgetAllPropertyInfo in interface HasPropertiesgetAllPropertyInfo in class Framepublic boolean isMassConstant()
isMassConstant in interface DynamicComponentisMassConstant in class Framepublic double getMass(double t)
DynamicComponentgetMass in interface DynamicComponentgetMass in class Framepublic void getMass(Matrix M, double t)
DynamicComponentgetMass in interface DynamicComponentgetMass in class FrameM - matrix to return the mass int - current timepublic SpatialInertia getEffectiveInertia()
public void getEffectiveMass(Matrix M, double t)
DynamicComponentgetEffectiveMass in interface DynamicComponentgetEffectiveMass in class FrameM - matrix to return the mass int - current timepublic int mulInverseEffectiveMass(Matrix M, double[] a, double[] f, int idx)
mulInverseEffectiveMass in interface DynamicComponentmulInverseEffectiveMass in class Framepublic static int mulInverseEffectiveMass(SpatialInertia S, double[] a, double[] f, int idx)
public static int getEffectiveMassForces(VectorNd f, double t, FrameState state, SpatialInertia effectiveInertia, int idx)
public int getEffectiveMassForces(VectorNd f, double t, int idx)
DynamicComponentf, 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 DynamicComponentgetEffectiveMassForces in class Framef - vector to return the forces int - current timeidx - starting location within f
 where forces should be storedidxpublic void resetEffectiveMass()
DynamicComponentresetEffectiveMass in interface DynamicComponentresetEffectiveMass in class Framepublic void addEffectivePointMass(double m,
                                  Vector3d loc)
addEffectivePointMass in class Framem - mass of the pointloc - location of the point (in local frame coordinates)public void addEffectiveInertia(SpatialInertia M)
public void getInverseMass(Matrix Minv, Matrix M)
DynamicComponentgetInverseMass in interface DynamicComponentgetInverseMass in class DynamicComponentBaseMinv - matrix to return the inverse mass inM - matrix containing the mass to be invertedpublic RigidBody.InertiaMethod getInertiaMethod()
public void setInertiaMethod(RigidBody.InertiaMethod method)
InertiaMethod method used to
 determine the inertia for this RigidBody.method - inertia method for this RigidBodysetInertia(maspack.spatialmotion.SpatialInertia), 
setInertiaFromDensity(double), 
setInertiaFromMass(double)public void getInertia(SpatialInertia M)
public void setCenterOfMass(Point3d com)
public void getCenterOfMass(Point3d com)
public Point3d getCenterOfMass()
public void centerPoseOnCenterOfMass()
public void setInertiaFromDensity(double density)
null then
 the inertia remains unchanged. Subsequent (non-null) changes
 to the mesh will cause the inertia to be recomputed.
 The inertia method is set to
 Density.density - desired uniform densitypublic void setInertiaFromMass(double mass)
null the mass 
 of the inertia is updated but the otherwise the inertia and density
 are left unchanged. Subsequent (non-null) changes
 to the mesh will cause the inertia to be recomputed.
 The inertia method is set to Mass.mass - desired body masspublic double computeVolume()
public void setDensity(double density)
Density or 
 Mass, the other components of
 the spatial inertia will also be updated.density - new density valuepublic Range getDensityRange()
public double getDensity()
setInertiaFromDensity, or is the
 mass/volume ratio for the most recently defined mesh.public void setMass(double mass)
Density or
 Mass, the
 other components of the spatial inertia will also be updated.mass - new mass valuepublic double getMass()
getMass in interface CollidableBodypublic Range getMassRange()
public void setRotationalInertia(SymmetricMatrix3d J)
getDensity) to be undefined).public void getRotationalInertia(SymmetricMatrix3d J)
public SymmetricMatrix3d getRotationalInertia()
public void setInertia(SpatialInertia M)
getDensity) to be undefined).public void setInertia(double m,
                       SymmetricMatrix3d J)
getDensity) to be
 undefined).public void setInertia(double m,
                       SymmetricMatrix3d J,
                       Point3d com)
getDensity) to be undefined).public void setInertia(double m,
                       double Jxx,
                       double Jyy,
                       double Jzz)
getDensity) to be
 undefined).public PolygonalMesh getMesh()
public AffineTransform3d getFileTransform()
public boolean isFileTransformRigid()
public boolean isMeshModfied()
public PolygonalMesh getSurfaceMesh()
HasSurfaceMeshnull if no mesh exists. If multiple surface
 meshes exist, this should be first one in the array returned
 by HasSurfaceMesh.getSurfaceMeshes().getSurfaceMesh in interface HasSurfaceMeshpublic int numSurfaceMeshes()
HasSurfaceMeshHasSurfaceMesh.getSurfaceMesh()
 returns null, then this method should return 0.numSurfaceMeshes in interface HasSurfaceMeshpublic PolygonalMesh[] getSurfaceMeshes()
HasSurfaceMeshHasSurfaceMesh.getSurfaceMesh() returns null, then a 
 zero-length array should be returned.getSurfaceMeshes in interface HasSurfaceMeshpublic java.lang.String getMeshFileName()
public void setMeshFileName(java.lang.String filename)
public AffineTransform3dBase getMeshFileTransform()
public void setMesh(PolygonalMesh mesh)
public void setMesh(PolygonalMesh mesh, java.lang.String fileName)
public void setSurfaceMesh(PolygonalMesh mesh, java.lang.String fileName)
public void scaleMesh(double sx,
                      double sy,
                      double sz)
public void scaleMesh(double s)
public void setMesh(PolygonalMesh mesh, java.lang.String fileName, AffineTransform3dBase X)
getDensity returns a non-negative value), then the
 spatial inertia is automatically calculated from the mesh and the uniform
 density.public void setSurfaceMesh(PolygonalMesh mesh, java.lang.String fileName, AffineTransform3dBase X)
getDensity returns a non-negative value), then the
 spatial inertia is automatically calculated from the mesh and the uniform
 density.public void setPose(double x,
                    double y,
                    double z,
                    double roll,
                    double pitch,
                    double yaw)
public void extrapolatePose(Twist vel, double h)
public void applyGravity(Vector3d gacc)
FrameapplyGravity in interface DynamicComponentapplyGravity in class Framepublic void scan(ReaderTokenizer rtok, java.lang.Object ref) throws java.io.IOException
ModelComponentBasewrite.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 write(java.io.PrintWriter pw,
                  NumberFormat fmt,
                  java.lang.Object ref)
           throws java.io.IOException
ModelComponentBasescan and complete
 enough to allow full reconstruction of the element.write in interface Scannablewrite in class ModelComponentBasepw - stream for writing the elementfmt - numeric formating informationref - optional reference object which can be used for producing references to
 other objectsjava.io.IOException - if an I/O error occuredpublic RenderProps createRenderProps()
HasRenderPropscreateRenderProps in interface HasRenderPropscreateRenderProps in class Framepublic void updateBounds(Vector3d pmin, Vector3d pmax)
IsRenderableupdateBounds in interface IsRenderableupdateBounds in class Framepmin - minimum pointpmax - maximum pointpublic void prerender(RenderList list)
IsRenderablelist.addIfVisible (obj);
for each of the objects in question.prerender in interface IsRenderableprerender in class Framelist - list of objects to be renderedpublic void render(Renderer renderer, int flags)
IsRenderableRenderer.render in interface IsRenderablerender in class Framerenderer - provides the functionality used to perform the rendering.flags - flags that may be used to control different 
 aspects of the rendering. Flags are defined in Renderer
 and currently include
 Renderer.HIGHLIGHT and
 Renderer.SORT_FACES.public void transformGeometry(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 Framegtr - transformer implementing the transformcontext - context information, including what other components
 are being transformedflags - specifies conditions associated with the transformationpublic void scaleDistance(double s)
ScalableUnitsscaleDistance in interface ScalableUnitsscaleDistance in class Frames - scaling factorpublic void scaleMass(double s)
ScalableUnitsscaleMass in interface ScalableUnitsscaleMass in class Frames - scaling factorpublic void setDynamic(boolean dynamic)
public boolean isDuplicatable()
true if and only if CopyableComponent.getCopyReferences(java.util.List<artisynth.core.modelbase.ModelComponent>, 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>, artisynth.core.modelbase.ModelComponent) to build the list of copy references.
isDuplicatable in interface CopyableComponentisDuplicatable in class Frametrue if this component can be duplicated.public boolean getCopyReferences(java.util.List<ModelComponent> refs, ModelComponent ancestor)
true if and only if CopyableComponent.isDuplicatable() returns
 true.getCopyReferences in interface CopyableComponentgetCopyReferences in class Framerefs - list to which references are appendedancestor - root node of the hierarchy from which references are to be excludedpublic RigidBody copy(int flags, java.util.Map<ModelComponent,ModelComponent> copyMap)
CopyableComponentCOPY_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.copy in interface CopyableComponentcopy in class Frameflags - flags to control the copyingcopyMap - map to possible existing instances of referenced
 componentspublic FrameMarker[] getFrameMarkers()
public void addConnector(BodyConnector c)
addConnector in interface ConnectableBodypublic void removeConnector(BodyConnector c)
removeConnector in interface ConnectableBodypublic java.util.List<BodyConnector> getConnectors()
getConnectors in interface ConnectableBodypublic boolean isFreeBody()
isFreeBody in interface ConnectableBodypublic void updateAttachmentPosStates()
public static RigidBody createSphere(java.lang.String bodyName, double r, double density, int nslices)
bodyName - name of the RigidBodyr - radius of the spheredensity - density of the bodynslices - number of slices used in creating the meshpublic static RigidBody createIcosahedralSphere(java.lang.String bodyName, double r, double density, int ndivisions)
bodyName - name of the RigidBodyr - radius of the spheredensity - density of the bodyndivisions - number of divisions used in creating the meshpublic static RigidBody createEllipsoid(java.lang.String bodyName, double a, double b, double c, double density, int nslices)
bodyName - name of the RigidBodya - semi-axis length in the x directionb - semi-axis length in the y directionc - semi-axis length in the z directiondensity - density of the bodynslices - number of slices used in creating the meshpublic static RigidBody createBox(java.lang.String bodyName, double wx, double wy, double wz, double density, boolean addNormals)
bodyName - name of the RigidBodywx - width of the box in the x directionwy - width of the box in the y directionwz - width of the box in the z directiondensity - density of the bodypublic static RigidBody createBox(java.lang.String bodyName, double wx, double wy, double wz, double density)
bodyName - name of the RigidBodywx - width of the box in the x directionwy - width of the box in the y directionwz - width of the box in the z directiondensity - density of the bodypublic static RigidBody createCylinder(java.lang.String bodyName, double r, double h, double density, int nsides)
bodyName - name of the RigidBodyr - cylinder radiush - cylinder heightdensity - density of the bodynsides - number of sides used in creating the cylinder meshpublic static RigidBody createFromMesh(java.lang.String bodyName, PolygonalMesh mesh, double density, double scale)
public static RigidBody createFromMesh(java.lang.String bodyName, PolygonalMesh mesh, java.lang.String meshFilePath, double density, double scale)
public static RigidBody createFromMesh(java.lang.String bodyName, java.lang.String meshPath, double density, double scale)
public static RigidBody createFromMesh(java.lang.String bodyName, java.lang.Object obj, java.lang.String relPath, double density, double scale)
public PolygonalMesh getCollisionMesh()
CollidableBodynull if there is no such mesh. If this method
 returns null, then no collisions will
 be performed for this collidable, regardless any default or explicit
 collision behaviors that have been arranged by the system.getCollisionMesh in interface CollidableBodypublic boolean hasDistanceGrid()
true if this RigidBody supports a signed
 distance grid that can be used with a SignedDistanceCollider.
 A grid is available if either the property
 distanceGridMaxRes is positive, or
 the property distanceGridRes contains all positive values.hasDistanceGrid in interface CollidableBodyhasDistanceGrid in interface HasDistanceGridtrue if a signed distance grid is available
 for this RigidBodygetDistanceGridMaxRes(), 
getDistanceGridRes()public DistanceGrid getDistanceGrid()
null if a grid is not available
 (i.e., if hasDistanceGrid() returns false).
 The number of divisons in the grid is controlled explicitly by the
 property distanceGridRes, or, that is 0, by the property
 distanceGridMaxRes. If both properties are 0, no grid is
 available and null will be returned.getDistanceGrid in interface CollidableBodygetDistanceGrid in interface HasDistanceGridnull if a grid is
 not available this RigidBodygetDistanceGridMaxRes(), 
getDistanceGridRes()public Collidable.Collidability getCollidable()
CollidableCollidable.Collidability of this Collidable. This provides
 control over whether external and/or internal collisions are enabled for
 this Collidable. This setting takes precedence over default and
 explicitly requested collision behaviors.
 Note that for collisions to actually occur, they still need to be enabled through either a default or explicit collision behavior in the MechModel.
getCollidable in interface Collidablepublic Collidable getCollidableAncestor()
Collidablenull.getCollidableAncestor in interface Collidablenull.public boolean isCompound()
CollidableisCompound in interface Collidabletrue if this collidable has sub-collidablespublic void setCollidable(Collidable.Collidability c)
public boolean isDeformable()
Collidabletrue if this collidable is deformable. Whether or
 not a collidable is deformable determines how it responds to default
 collision behaviors involving deformable and rigid collidables. Also,
 self-collisions among sub-collidables of a collidable A are permitted
 only if A is deformable.isDeformable in interface CollidableisDeformable in interface ConnectableBodytrue if this collidable is deformablepublic void getVertexMasters(java.util.List<ContactMaster> mlist, Vertex3d vtx)
CollidableBodymlist. The list should not be cleared. The vertex
 should be a vertex of the mesh returned by CollidableBody.getCollisionMesh().getVertexMasters in interface CollidableBodymlist - collected master component informationvtx - vertex for which the master components are requestedpublic boolean containsContactMaster(CollidableDynamicComponent comp)
CollidableBodycontainsContactMaster in interface CollidableBodycomp - component to test fortrue if comp is contained in
 this Collidablepublic boolean allowCollision(ContactPoint cpnt, Collidable other, java.util.Set<Vertex3d> attachedVertices)
CollidableBodytrue if a collision between this Collidable
 and other should be allowed for the contact point
 cpnt. In making this decision, this method may
 refer to attachedVertices, which supplies a list
 of vertices on this Collidable which are attached in some way 
 to the other Collidable.allowCollision in interface CollidableBodycpnt - contact point being testedother - opposing collidableattachedVertices - list of vertices attached to other.true if the collision should be allowedpublic int getCollidableIndex()
getCollidableIndex in interface CollidableBodypublic void setCollidableIndex(int idx)
setCollidableIndex in interface CollidableBodypublic void setDistanceGridMaxRes(int max)
max is <= 0,
 the value will be set to 0. If the values returned by HasDistanceGrid.getDistanceGridRes()) are non-zero, those will be used to specify the
 cell resolutions instead. If the maximum cell resolution and the values
 returned by HasDistanceGrid.getDistanceGridRes() are all 0, then no signed
 distance grid will be available for this component and HasDistanceGrid.hasDistanceGrid() will return false.setDistanceGridMaxRes in interface HasDistanceGridmax - default maximum cell resolution for constructing a signed
 distance gridpublic int getDistanceGridMaxRes()
HasDistanceGrid.getDistanceGridMaxRes() for a more detailed description.getDistanceGridMaxRes in interface HasDistanceGridpublic void setDistanceGridRes(Vector3i res)
<= 0, then all of the values are
 set to zero and the value returned by HasDistanceGrid.getDistanceGridMaxRes()) is
 used to determine the grid divisions instead.setDistanceGridRes in interface HasDistanceGridres - cell resolution along x, y, z axes to be used in constructing 
 a signed distance gridHasDistanceGrid.getDistanceGridRes()public boolean getDistanceGridOBB()
public void setDistanceGridOBB(boolean enable)
public Vector3i getDistanceGridRes()
HasDistanceGrid.setDistanceGridRes(maspack.matrix.Vector3i) for a more detailed description.getDistanceGridRes in interface HasDistanceGridHasDistanceGrid.setDistanceGridRes(maspack.matrix.Vector3i)public boolean getRenderDistanceGrid()
getRenderDistanceGrid in interface HasDistanceGridtrue if distance grid rendering is enabledpublic void setRenderDistanceGrid(boolean enable)
setRenderDistanceGrid in interface HasDistanceGridenable - if true, enables distance grid renderingpublic RigidBody.DistanceSurfaceRendering getRenderDistanceSurface()
setRenderDistanceSurface(artisynth.core.mechmodels.RigidBody.DistanceSurfaceRendering)public void setRenderDistanceSurface(RigidBody.DistanceSurfaceRendering rendering)
rendering.rendering - specifies if and how the distance surface is rendered.getRenderDistanceSurface()public double getDistanceSurfaceIso()
public void setDistanceSurfaceIso(double iso)
public java.lang.String getDistanceGridRenderRanges()
HasDistanceGrid.setDistanceGridRenderRanges(java.lang.String) for a more detailed description.getDistanceGridRenderRanges in interface HasDistanceGridHasDistanceGrid.setDistanceGridRenderRanges(java.lang.String)public void setDistanceGridRenderRanges(java.lang.String ranges)
numVX X numVY X numVZ vertices in
 the x, y, z directions, where numVX, numVY, and
 numVZ are each one greater than the x, y, z cell resolution
 values returned by the DistanceGrid.getResolution()
 method of the distance grid itself. In general, the range string should
 contain three range specifications, one for each axis, where each
 specification is either * (all vertices), n:m
 (vertices in the index range n to m, inclusive),
 or n (vertices only at index n). A
 range specification of "* * *" (or "*")
 means draw all vertices, which is the default behavior. Other
 examples include:
 
  "* 7 *"      - all vertices along x and z, and those at index 7 along y
  "0 2 3"      - a single vertex at indices (0, 2, 3)
  "0:3 4:5 *"  - all vertices between indices 0 and 3 along x, and 4 and 5
                 along y
 setDistanceGridRenderRanges in interface HasDistanceGridranges - describing the render rangesHasDistanceGrid.getDistanceGridRenderRanges()public Range getDistanceGridRenderRangesRange()