public class PlanarConnector extends BodyConnector implements CopyableComponent
ModelComponent.NavpanelVisibility
Modifier and Type | Field and Description |
---|---|
static PropertyList |
myProps |
debug, useOldDerivativeMethod
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
COPY_REFERENCES, REST_POSITION
TG_ARTICULATED, TG_DRAGGER, TG_PRESERVE_ORIENTATION, TG_SIMULATING
TRANSPARENT, TWO_DIMENSIONAL
Constructor and Description |
---|
PlanarConnector()
Creates a
PlanarConnector which is not attached to any bodies. |
PlanarConnector(ConnectableBody bodyA,
ConnectableBody bodyB,
RigidTransform3d TDW)
Creates a
PlanarConnector connecting two connectable bodies,
bodyA and bodyB . |
PlanarConnector(RigidBody bodyA,
Vector3d pCA,
RigidBody bodyB,
RigidTransform3d TDB)
Creates a
PlanarConnector connecting two rigid bodies, bodyA and bodyB . |
PlanarConnector(RigidBody bodyA,
Vector3d pCA,
RigidTransform3d TDW)
Creates a
PlanarConnector connecting a single rigid body, bodyA , to ground. |
Modifier and Type | Method and Description |
---|---|
PlanarConnector |
copy(int flags,
java.util.Map<ModelComponent,ModelComponent> copyMap)
Create a copy of this component.
|
RenderProps |
createRenderProps()
Factory method to create render properties appropriate to this object.
|
PropertyList |
getAllPropertyInfo()
Returns a list giving static information about all properties exported by
this object.
|
int |
getEngaged() |
Vector3d |
getNormal() |
double |
getPlanarActivation() |
double |
getPlaneNormal(Vector3d nrm)
Gets the current plane normal, in world coordinates.
|
double |
getPlaneSize()
Queries the size used to render this connector's plane as a square.
|
boolean |
isUnilateral() |
void |
render(Renderer renderer,
int flags)
Render this object using the functionality of the supplied
Renderer . |
static void |
renderXYSquare(Renderer renderer,
RenderProps props,
RigidTransform3d TDW,
double size,
boolean selected) |
void |
scaleDistance(double s)
Scales all distance coordinates.
|
void |
set(RigidBody bodyA,
Point3d pCA,
Vector3d worldPlaneNormal) |
void |
set(RigidBody bodyA,
Vector3d pCA,
RigidBody bodyB,
RigidTransform3d TDB)
Sets this PlanarConnectorX to connect two rigid bodies.
|
void |
set(RigidBody bodyA,
Vector3d pCA,
RigidTransform3d TDW)
Sets this PlanarConnectorX to connect a rigid body with the world frame.
|
void |
setPlaneSize(double size)
Sets the size used to render this connector's plane as a square.
|
void |
setUnilateral(boolean unilateral) |
void |
updateBounds(Vector3d pmin,
Vector3d pmax)
Update the minimum and maximum points for this object.
|
static void |
updateXYSquareBounds(Vector3d pmin,
Vector3d pmax,
RigidTransform3d TDW,
double size) |
addBilateralConstraints, addFrictionConstraints, addMasterBlocks, addTransformableDependencies, addUnilateralConstraints, computeConstraintMatrixA, computeConstraintMatrixB, connectToHierarchy, disconnectFromHierarchy, findAttachedBodies, getActivation, getAxisLength, getBilateralForceInA, getBilateralForceInA, getBilateralForceInB, getBilateralForceInB, getBilateralForceInC, getBilateralForceInC, getBilateralForces, getBilateralInfo, getBilateralSizes, getBodyA, getBodyB, getCompliance, getConstrainedComponents, getConstraint, getConstraintFlags, getConstraintForce, getCopyReferences, getCoupling, getCurrentTCD, getCurrentTCW, getCurrentTCW, getCurrentTDW, getCurrentTDW, getDamping, getDrawFrameC, getDrawFrameD, getFrameAttachmentA, getFrameAttachmentB, getFrictionForces, getFrictionState, getHardReferences, getLinearCompliance, getPenetrationTol, getPenetrationTolMode, getPose, getRenderFrame, getRotaryCompliance, getRotaryLimitTol, getRotaryLimitTolMode, getState, getStateVersion, getTransformDGeometryOnly, getTransformPositionOnly, getUnilateralForceInA, getUnilateralForceInA, getUnilateralForceInB, getUnilateralForceInB, getUnilateralForceInC, getUnilateralForceInC, getUnilateralForces, getUnilateralInfo, getUnilateralSizes, getUnilateralState, hasState, isActive, isConnectedToBodies, isDuplicatable, isEnabled, isNotAttached, maxFrictionConstraintSets, numBilateralConstraints, numConstraints, numEngagedUnilateralConstraints, numUnilateralConstraints, prerender, printConnectedBodies, printConstraintInfo, scaleMass, setAlwaysAdjustBodyA, setAxisLength, setBilateralForces, setBodies, setBodies, setBodies, setBodies, setCompliance, setCurrentTCW, setCurrentTDW, setDamping, setDrawFrameC, setDrawFrameD, setEnabled, setFrictionForces, setFrictionState, setLinearCompliance, setPenetrationTol, setPenetrationTolMode, setRotaryCompliance, setRotaryLimitTol, setRotaryLimitTolMode, setState, setTransformDGeometryOnly, setTransformPositionOnly, setUnilateralForces, setUnilateralState, transformGeometry, transformGeometry, updateAttachments, updateConstraints, zeroForces
defaultRenderPropsAreNull, getRenderHints, getRenderProps, getSelection, isSelectable, isVisible, numSelectionQueriesNeeded, setRenderProps, setVisible, updateRenderProps
checkFlag, checkName, checkNameUniqueness, clearFlag, clone, createTempFlag, getChildren, getGrandParent, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasChildren, isFixed, isMarked, isScanning, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, postscan, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, scan, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setScanning, setSelected, setWritable, updateReferences, write
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCopyReferences, isDuplicatable
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, setWritable, updateReferences
getProperty
getChildren, hasChildren
postscan
isWritable, write
transformPriority
advanceState, getAuxVarDerivative, getAuxVarState, numAuxVars, requiresAdvance, setAuxVarState
public static PropertyList myProps
public PlanarConnector()
PlanarConnector
which is not attached to any bodies.
It can subsequently be connected using one of the setBodies
or
set
methods.public PlanarConnector(RigidBody bodyA, Vector3d pCA, RigidBody bodyB, RigidTransform3d TDB)
PlanarConnector
connecting two rigid bodies, bodyA
and bodyB
. If A and B describe the coordinate frames of
bodyA
and bodyB
, and then pCA
gives the origin of
C with respect to A and TDB
gives the pose of D with respect to
B.bodyA
- rigid body ApCA
- origin of C with respect to A, as seen in AbodyB
- rigid body B (or null
)TDB
- transform from frame D to body frame Bpublic PlanarConnector(RigidBody bodyA, Vector3d pCA, RigidTransform3d TDW)
PlanarConnector
connecting a single rigid body, bodyA
, to ground. If A describes the coordinate frame of bodyA
,
then pCA
gives the origin of C with respect to A and TDW
gives the pose of D with respect to world.bodyA
- rigid body ApCA
- origin of C with respect to A, as seen in ATDW
- transform from frame D to world coordinatespublic PlanarConnector(ConnectableBody bodyA, ConnectableBody bodyB, RigidTransform3d TDW)
PlanarConnector
connecting two connectable bodies,
bodyA
and bodyB
. The joint frames D and C are assumed to
be initially coincident.
Specifying bodyB
as null
will cause bodyA
to
be connected to ground.
bodyA
- body AbodyB
- body BTDW
- initial transform from connector frames D and C to worldpublic PropertyList getAllPropertyInfo()
HasProperties
getAllPropertyInfo
in interface HasProperties
getAllPropertyInfo
in class BodyConnector
public Vector3d getNormal()
public double getPlaneSize()
public void setPlaneSize(double size)
size
- used to render the planepublic double getPlaneNormal(Vector3d nrm)
nrm
- returns the plane normalpublic int getEngaged()
public void set(RigidBody bodyA, Vector3d pCA, RigidBody bodyB, RigidTransform3d TDB)
bodyA
- first rigid bodypCA
- location of contact point relative to body AbodyB
- second rigid bodyTDB
- plane coordinate frame with respect to body B. The plane normal is given
by the z axis of this frame, and the plane's origin is given by TDB.ppublic void set(RigidBody bodyA, Vector3d pCA, RigidTransform3d TDW)
bodyA
- rigid bodypCA
- location of contact point relative to bodyTDW
- plane coordinate frame with respect to the world. The plane normal is
given by the z axis of this frame, and the plane's origin is given by
TDB.ppublic void updateBounds(Vector3d pmin, Vector3d pmax)
IsRenderable
updateBounds
in interface IsRenderable
updateBounds
in class BodyConnector
pmin
- minimum pointpmax
- maximum pointpublic RenderProps createRenderProps()
HasRenderProps
createRenderProps
in interface HasRenderProps
createRenderProps
in class RenderableComponentBase
public static void updateXYSquareBounds(Vector3d pmin, Vector3d pmax, RigidTransform3d TDW, double size)
public static void renderXYSquare(Renderer renderer, RenderProps props, RigidTransform3d TDW, double size, boolean selected)
public void render(Renderer renderer, int flags)
IsRenderable
Renderer
.render
in interface IsRenderable
render
in class BodyConnector
renderer
- provides the functionality used to perform the rendering.flags
- flags that may be used to control different
aspects of the rendering. Flags are defined in Renderer
and currently include
Renderer.HIGHLIGHT
and
Renderer.SORT_FACES
.public void scaleDistance(double s)
BodyConnector
scaleDistance
in interface ScalableUnits
scaleDistance
in class BodyConnector
s
- scaling factorpublic double getPlanarActivation()
public boolean isUnilateral()
public void setUnilateral(boolean unilateral)
public PlanarConnector copy(int flags, java.util.Map<ModelComponent,ModelComponent> copyMap)
CopyableComponent
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
.copy
in interface CopyableComponent
copy
in class BodyConnector
flags
- flags to control the copyingcopyMap
- map to possible existing instances of referenced
components