public abstract class PointSpringBase extends Spring implements RenderableComponent, ScalableUnits
ModelComponent.NavpanelVisibility
Modifier and Type | Field and Description |
---|---|
static boolean |
myIgnoreCoriolisInJacobian |
static PropertyList |
myProps |
static boolean |
useMaterial |
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
TRANSLUCENT, TWO_DIMENSIONAL
Constructor and Description |
---|
PointSpringBase(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
double |
computeDFdl(double l,
double ldot)
Computes the derivative of spring force magnitude (acting along the unit
vector from the first to the second particle) with respect to spring
length.
|
double |
computeDFdldot(double l,
double ldot)
Computes the derivative of spring force magnitude (acting along the unit
vector from the first to the second particle)with respect to the time
derivative of spring length.
|
double |
computeF(double l,
double ldot)
Computes the force magnitude acting along the unit vector from the first
to the second particle.
|
ModelComponent |
copy(int flags,
java.util.Map<ModelComponent,ModelComponent> copyMap) |
static AxialMaterial |
createDefaultMaterial() |
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.
|
AxialMaterial |
getEffectiveMaterial() |
abstract double |
getLength() |
AxialMaterial |
getMaterial() |
static double |
getMaxForce(PointSpringBase s) |
float[] |
getRenderColor() |
int |
getRenderHints()
Returns a bit code giving rendering hints about this renderable.
|
RenderProps |
getRenderProps()
Returns the render properities for this object.
|
double |
getRestLength() |
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. |
boolean |
isSelectable()
Returns true if this object is in fact selectable.
|
int |
numSelectionQueriesNeeded()
If this selectable manages its own selection (by issuing selection
queries within its
render method), then this method should
return the maximum number of selection queries that will be
required. |
void |
prerender(RenderList list)
Prepare for rendering, and potentially add itself to a list to be drawn
by a GLRenderer.
|
abstract void |
render(GLRenderer renderer,
int flags)
Render this object using Open GL via the JOGL.
|
void |
scaleDistance(double s)
Scales all distance coordinates.
|
void |
scaleMass(double s)
Scales all mass units.
|
static void |
setDamping(PointSpringBase s,
double d) |
void |
setLinearMaterial(double k,
double d) |
void |
setMaterial(AxialMaterial mat) |
static void |
setMaxForce(PointSpringBase s,
double maxf) |
void |
setRenderProps(RenderProps props)
Assigns a new set of render properties to this object.
|
void |
setRestLength(double l) |
abstract double |
setRestLengthFromPoints()
Sets the rest length of the spring from the current point locations
|
static void |
setStiffness(PointSpringBase s,
double k) |
abstract void |
updateBounds(Point3d pmin,
Point3d pmax)
Update the minimum and maximum points for this object.
|
applyForces
checkFlag, checkName, checkNameUniqueness, clearFlag, clone, connectToHierarchy, createTempFlag, disconnectFromHierarchy, getChildren, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasChildren, hasState, 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
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, postscan, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, updateReferences
getProperty
getChildren, hasChildren
isWritable, write
addPosJacobian, addSolveBlocks, addVelJacobian, getJacobianType
public static boolean myIgnoreCoriolisInJacobian
public static boolean useMaterial
public static PropertyList myProps
public PropertyList getAllPropertyInfo()
HasProperties
getAllPropertyInfo
in interface HasProperties
getAllPropertyInfo
in class ModelComponentBase
public static AxialMaterial createDefaultMaterial()
public AxialMaterial getMaterial()
public void setLinearMaterial(double k, double d)
public void setMaterial(AxialMaterial mat)
public AxialMaterial getEffectiveMaterial()
public abstract double getLength()
public abstract double setRestLengthFromPoints()
public double getRestLength()
public void setRestLength(double l)
public RenderProps getRenderProps()
HasRenderProps
getRenderProps
in interface HasRenderProps
public void setRenderProps(RenderProps props)
HasRenderProps
null
will remove render properties from this object.setRenderProps
in interface HasRenderProps
props
- new render properties for this objectpublic RenderProps createRenderProps()
HasRenderProps
createRenderProps
in interface HasRenderProps
public void prerender(RenderList list)
GLRenderable
prerender
in interface GLRenderable
public abstract void updateBounds(Point3d pmin, Point3d pmax)
GLRenderable
updateBounds
in interface GLRenderable
pmin
- minimum pointpmax
- maximum pointpublic int getRenderHints()
GLRenderable
TRANSLUCENT
.getRenderHints
in interface GLRenderable
public boolean isSelectable()
GLSelectable
isSelectable
in interface GLSelectable
public int numSelectionQueriesNeeded()
GLSelectable
render
method), then this method should
return the maximum number of selection queries that will be
required. Otherwise, this method should return -1.numSelectionQueriesNeeded
in interface GLSelectable
public abstract void render(GLRenderer renderer, int flags)
GLRenderable
render
in interface GLRenderable
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
.public void getSelection(java.util.LinkedList<java.lang.Object> list, int qid)
GLSelectable
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.getSelection
in interface GLSelectable
list
- selected objects are appended to the end of this listqid
- index of the selection querypublic double computeF(double l, double ldot)
public double computeDFdl(double l, double ldot)
public double computeDFdldot(double l, double ldot)
public float[] getRenderColor()
public void scaleDistance(double s)
ScalableUnits
scaleDistance
in interface ScalableUnits
s
- scaling factorpublic void scaleMass(double s)
ScalableUnits
scaleMass
in interface ScalableUnits
s
- scaling factorpublic static void setStiffness(PointSpringBase s, double k)
public static void setDamping(PointSpringBase s, double d)
public static void setMaxForce(PointSpringBase s, double maxf)
public static double getMaxForce(PointSpringBase s)
public ModelComponent copy(int flags, java.util.Map<ModelComponent,ModelComponent> copyMap)
copy
in class ModelComponentBase