|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttoxi.geom.Vec3D
toxi.physics.VerletParticle
public class VerletParticle
An individual 3D particle for use by the VerletPhysics and VerletSpring classes. A particle has weight, can be locked in space and its position constrained inside an (optional) axis-aligned bounding box.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class toxi.geom.Vec3D |
---|
toxi.geom.Vec3D.Axis |
Field Summary | |
---|---|
toxi.geom.AABB |
bounds
Bounding box, by default set to null to disable |
java.util.ArrayList<ParticleConstraint> |
constraints
An optional particle constraints, called immediately after a particle is updated (and only used if particle is unlocked (default) |
Fields inherited from class toxi.geom.Vec3D |
---|
MAX_VALUE, MIN_VALUE, x, X_AXIS, y, Y_AXIS, z, Z_AXIS, ZERO |
Constructor Summary | |
---|---|
VerletParticle(float x,
float y,
float z)
Creates particle at position xyz |
|
VerletParticle(float x,
float y,
float z,
float w)
Creates particle at position xyz with weight w |
|
VerletParticle(toxi.geom.Vec3D v)
Creates particle at the position of the passed in vector |
|
VerletParticle(toxi.geom.Vec3D v,
float w)
Creates particle with weight w at the position of the passed in vector |
|
VerletParticle(VerletParticle p)
Creates a copy of the passed in particle |
Method Summary | |
---|---|
VerletParticle |
addConstraint(ParticleConstraint c)
Adds the given constraint implementation to the list of constraints applied to this particle at each time step. |
VerletParticle |
addVelocity(toxi.geom.Vec3D v)
|
void |
applyConstraints()
|
VerletParticle |
clearVelocity()
|
toxi.geom.Vec3D |
getPreviousPosition()
Returns the particle's position at the most recent time step. |
float |
getWeight()
|
boolean |
isLocked()
|
VerletParticle |
lock()
Locks/immobilizes particle in space |
VerletParticle |
removeAllConstraints()
Removes any currently applied constraints from this particle. |
boolean |
removeConstraint(ParticleConstraint c)
Attempts to remove the given constraint instance from the list of active constraints. |
VerletParticle |
scaleVelocity(float scl)
|
void |
setWeight(float w)
|
VerletParticle |
unlock()
Unlocks particle again |
Methods inherited from class toxi.geom.Vec3D |
---|
abs, add, add, addSelf, addSelf, angleBetween, angleBetween, clear, closestPointOnLine, compareTo, constrain, constrain, copy, cross, crossInto, crossSelf, distanceTo, distanceToSquared, dot, equals, equalsWithTolerance, floor, frac, fromXYTheta, fromXZTheta, fromYZTheta, getAbs, getComponent, getConstrained, getFloored, getFrac, getInverted, getLimited, getNormalized, getNormalizedTo, getReciprocal, getRotatedAroundAxis, getRotatedX, getRotatedY, getRotatedZ, getSignum, hashCode, headingXY, headingXZ, headingYZ, interpolateTo, interpolateTo, interpolateToSelf, interpolateToSelf, invert, isInAABB, isInAABB, isZeroVector, jitter, jitter, jitter, limit, magnitude, magSquared, max, maxSelf, min, minSelf, modSelf, modSelf, normalize, normalizeTo, randomVector, randomVector, reciprocal, rotateAroundAxis, rotateX, rotateY, rotateZ, scale, scale, scale, scaleSelf, scaleSelf, scaleSelf, set, set, setComponent, setXY, signum, sub, sub, subSelf, subSelf, to2DXY, to2DXZ, to2DYZ, toArray, toCartesian, toSpherical, toString |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public toxi.geom.AABB bounds
public java.util.ArrayList<ParticleConstraint> constraints
Constructor Detail |
---|
public VerletParticle(float x, float y, float z)
x
- y
- z
- public VerletParticle(float x, float y, float z, float w)
x
- y
- z
- w
- public VerletParticle(toxi.geom.Vec3D v)
v
- positionpublic VerletParticle(toxi.geom.Vec3D v, float w)
v
- positionw
- weightpublic VerletParticle(VerletParticle p)
p
- Method Detail |
---|
public VerletParticle addConstraint(ParticleConstraint c)
c
- constraint instance
public VerletParticle addVelocity(toxi.geom.Vec3D v)
public void applyConstraints()
public VerletParticle clearVelocity()
public toxi.geom.Vec3D getPreviousPosition()
public float getWeight()
public boolean isLocked()
public VerletParticle lock()
public VerletParticle removeAllConstraints()
public boolean removeConstraint(ParticleConstraint c)
c
- constraint to remove
public VerletParticle scaleVelocity(float scl)
public void setWeight(float w)
public VerletParticle unlock()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |