public class Particle extends Point
ModelComponent.NavpanelVisibility
Modifier and Type | Field and Description |
---|---|
static PropertyList |
myProps |
myRenderCoords
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
TRANSLUCENT, TWO_DIMENSIONAL
ARTICULATED, SIMULATING
COPY_REFERENCES
Constructor and Description |
---|
Particle() |
Particle(double m) |
Particle(double m,
double x,
double y,
double z) |
Particle(double m,
Point3d p) |
Particle(java.lang.String name,
double m,
double x,
double y,
double z) |
Modifier and Type | Method and Description |
---|---|
void |
applyGravity(Vector3d gacc)
Applies a gravity force to this component, given a prescribed
gravity acceleration vector.
|
int |
applyPosImpulse(double[] delx,
int idx) |
ModelComponent |
copy(int flags,
java.util.Map<ModelComponent,ModelComponent> copyMap)
Create a copy of this component.
|
PropertyList |
getAllPropertyInfo()
Returns a list giving static information about all properties exported by
this object.
|
Vector3d |
getConstraint()
Returns the constraint for this particle, if any.
|
boolean |
getCopyReferences(java.util.List<ModelComponent> refs,
ModelComponent ancestor)
Collects external references which must also be copied in order to
duplicate this component.
|
void |
getInverseMass(Matrix Minv,
Matrix M)
Inverts a mass for this component.
|
double |
getMass() |
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 |
getVelDerivative(double[] dxdt,
int idx,
double mass) |
boolean |
isDuplicatable()
Returns true if this component can be duplicated.
|
void |
scaleDistance(double s)
Scales all distance coordinates.
|
void |
scaleMass(double s)
Scales all mass units.
|
void |
setConstraint(Vector3d c)
Sets a constraint for this particle.
|
void |
setDynamic(boolean dynamic) |
void |
setMass(double m) |
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.
|
addExternalForce, addForce, addPosImpulse, addPosition, addPosJacobian, addScaledExternalForce, addScaledForce, addScaledPosition, addScaledVelocity, addSolveBlock, addSolveBlocks, addTargetJacobian, addToSolveBlockDiagonal, addVelJacobian, addVelocity, applyForces, createMassBlock, createRenderProps, createSolveBlock, distance, distance, getExternalForce, getForce, getForce, getJacobianType, getMassForces, getPointDamping, getPointDampingMode, getPosDerivative, getPosition, getPosition, getPosState, getPosStateSize, getRenderCoords, getRenderProps, getSelection, getState, getState, getTargetActivity, getTargetPos, getTargetPosition, getTargetVel, getTargetVelocity, getTracables, getTracingProbe, getVelocity, getVelocity, getVelState, getVelStateSize, isMassConstant, isSelectable, prerender, render, resetTargets, setExternalForce, setForce, setForce, setForcesToExternal, setPointDamping, setPointDampingMode, setPosition, setPosition, setPosState, setRenderProps, setScaledExternalForce, setState, setState, setState, setTargetActivity, setTargetPos, setTargetPosition, setTargetVel, setTargetVelocity, setVelocity, setVelocity, setVelState, subForce, updateBounds, velocityLimitExceeded, zeroExternalForces, zeroForces
addMasterAttachment, getAttachment, getMasterAttachments, getSolveIndex, hasState, isActive, isAttached, isControllable, isDynamic, isParametric, removeMasterAttachment, setAttached, setSolveIndex
getRenderHints, numSelectionQueriesNeeded, updateRenderProps
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
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isSelected
numSelectionQueriesNeeded
getRenderHints
addMasterAttachment, checkFlag, clearFlag, getAttachment, getMasterAttachments, getSolveIndex, isActive, isAttached, isControllable, isDynamic, isParametric, removeMasterAttachment, setAttached, setFlag, setSolveIndex
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, postscan, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, updateReferences
getChildren, hasChildren
isWritable, write
public static PropertyList myProps
public Particle()
public Particle(double m)
public Particle(double m, Point3d p)
public Particle(double m, double x, double y, double z)
public Particle(java.lang.String name, double m, double x, double y, double z)
public PropertyList getAllPropertyInfo()
HasProperties
getAllPropertyInfo
in interface HasProperties
getAllPropertyInfo
in class Point
public Vector3d getConstraint()
public void setConstraint(Vector3d c)
c
- constraint value.public double getMass()
public double getMass(double t)
DynamicMechComponent
getMass
in interface DynamicMechComponent
getMass
in class Point
public void getMass(Matrix M, double t)
DynamicMechComponent
getMass
in interface DynamicMechComponent
getMass
in class Point
M
- matrix to return the mass int
- current timepublic void getInverseMass(Matrix Minv, Matrix M)
DynamicMechComponent
getInverseMass
in interface DynamicMechComponent
getInverseMass
in class DynamicMechComponentBase
Minv
- matrix to return the inverse mass inM
- matrix containing the mass to be invertedpublic void setMass(double m)
public void applyGravity(Vector3d gacc)
Point
applyGravity
in interface DynamicMechComponent
applyGravity
in class Point
public int applyPosImpulse(double[] delx, int idx)
public int getVelDerivative(double[] dxdt, int idx, double mass)
public void scaleMass(double s)
ScalableUnits
scaleMass
in interface ScalableUnits
scaleMass
in class Point
s
- scaling factorpublic void setDynamic(boolean dynamic)
public void transformGeometry(AffineTransform3dBase X)
TransformableGeometry
transformGeometry (X, this, 0);
transformGeometry
in interface TransformableGeometry
transformGeometry
in class Point
X
- affine transformationpublic void transformGeometry(AffineTransform3dBase X, TransformableGeometry topObject, int flags)
TransformableGeometry
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
.transformGeometry
in interface TransformableGeometry
transformGeometry
in class Point
X
- affine transformationtopObject
- component on which the method was initially invokedflags
- provides information about the context in which the
transformation is being applied.public void scaleDistance(double s)
ScalableUnits
scaleDistance
in interface ScalableUnits
scaleDistance
in class Point
s
- scaling factorpublic 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 CopyableComponent
isDuplicatable
in class Point
true
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 CopyableComponent
getCopyReferences
in class Point
refs
- list to which references are appendedancestor
- root node of the hierarchy from which references are to be excludedpublic ModelComponent 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 Point