|
||||||||||
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 | |
---|---|
java.util.List<ParticleBehavior> |
behaviors
|
toxi.geom.AABB |
bounds
Bounding box, by default set to null to disable |
java.util.List<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.ReadonlyVec3D v)
Creates particle at the position of the passed in vector |
|
VerletParticle(toxi.geom.ReadonlyVec3D 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 |
addBehavior(ParticleBehavior behavior)
|
VerletParticle |
addBehavior(ParticleBehavior behavior,
float timeStep)
|
VerletParticle |
addConstraint(ParticleConstraint c)
Adds the given constraint implementation to the list of constraints applied to this particle at each time step. |
VerletParticle |
addForce(toxi.geom.Vec3D f)
|
VerletParticle |
addVelocity(toxi.geom.Vec3D v)
|
void |
applyBehaviors()
|
void |
applyConstraints()
|
VerletParticle |
clearConstraints()
Removes any currently applied constraints from this particle. |
VerletParticle |
clearForce()
|
VerletParticle |
clearVelocity()
|
float |
getInvWeight()
|
toxi.geom.Vec3D |
getPreviousPosition()
Returns the particle's position at the most recent time step. |
toxi.geom.Vec3D |
getVelocity()
|
float |
getWeight()
|
boolean |
isLocked()
|
VerletParticle |
lock()
Locks/immobilizes particle in space |
boolean |
removeBehavior(ParticleBehavior b)
|
boolean |
removeConstraint(ParticleConstraint c)
Attempts to remove the given constraint instance from the list of active constraints. |
VerletParticle |
scaleVelocity(float scl)
|
VerletParticle |
setPreviousPosition(toxi.geom.Vec3D p)
|
void |
setWeight(float w)
|
VerletParticle |
unlock()
Unlocks particle again |
void |
update()
|
Methods inherited from class toxi.geom.Vec3D |
---|
abs, add, add, add, addSelf, addSelf, angleBetween, angleBetween, clear, compareTo, constrain, constrain, copy, cross, cross, crossInto, crossSelf, distanceTo, distanceToSquared, dot, dot, equals, equalsWithTolerance, floor, frac, fromXYTheta, fromXZTheta, fromYZTheta, getAbs, getComponent, getComponent, getConstrained, getFloored, getFrac, getInverted, getLimited, getNormalized, getNormalizedTo, getReciprocal, getReflected, getRotatedAroundAxis, getRotatedX, getRotatedY, getRotatedZ, getSignum, hashCode, headingXY, headingXZ, headingYZ, immutable, interpolateTo, interpolateTo, interpolateTo, interpolateTo, interpolateToSelf, interpolateToSelf, invert, isInAABB, isInAABB, isMajorAxis, isZeroVector, jitter, jitter, jitter, jitter, jitter, jitter, limit, magnitude, magSquared, max, maxSelf, min, minSelf, modSelf, modSelf, normalize, normalizeTo, randomVector, randomVector, reciprocal, reflect, rotateAroundAxis, rotateX, rotateY, rotateZ, roundToAxis, scale, scale, scale, scale, scaleSelf, scaleSelf, scaleSelf, set, set, set, setComponent, setComponent, setXY, shuffle, signum, sub, sub, sub, subSelf, subSelf, to2DXY, to2DXZ, to2DYZ, toArray, toArray4, toCartesian, toSpherical, toString, x, y, z |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public toxi.geom.AABB bounds
public java.util.List<ParticleConstraint> constraints
public java.util.List<ParticleBehavior> behaviors
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.ReadonlyVec3D v)
v
- positionpublic VerletParticle(toxi.geom.ReadonlyVec3D v, float w)
v
- positionw
- weightpublic VerletParticle(VerletParticle p)
p
- Method Detail |
---|
public VerletParticle addBehavior(ParticleBehavior behavior)
public VerletParticle addBehavior(ParticleBehavior behavior, float timeStep)
public VerletParticle addConstraint(ParticleConstraint c)
c
- constraint instance
public VerletParticle addForce(toxi.geom.Vec3D f)
public VerletParticle addVelocity(toxi.geom.Vec3D v)
public void applyBehaviors()
public void applyConstraints()
public VerletParticle clearConstraints()
public VerletParticle clearForce()
public VerletParticle clearVelocity()
public final float getInvWeight()
public toxi.geom.Vec3D getPreviousPosition()
public toxi.geom.Vec3D getVelocity()
public final float getWeight()
public final boolean isLocked()
public VerletParticle lock()
public boolean removeBehavior(ParticleBehavior b)
public boolean removeConstraint(ParticleConstraint c)
c
- constraint to remove
public VerletParticle scaleVelocity(float scl)
public VerletParticle setPreviousPosition(toxi.geom.Vec3D p)
public void setWeight(float w)
public VerletParticle unlock()
public void update()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |