Package toxi.physics3d
Class ParticlePath3D
java.lang.Object
toxi.geom.Spline3D
toxi.physics3d.ParticlePath3D
This class is used as a builder to dynamically construct a
ParticleString3D
following a given spline path, sampled at a fixed
frequency/step distance. This functionality is needed especially when working
with various obstacles/mechanic constraints which the string should flow/wrap
around.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateParticles
(VerletPhysics3D physics, int subDiv, float step, float mass) Creates particles along the spline at the fixed interval given.Methods inherited from class toxi.geom.Spline3D
add, add, getNumPoints, getPointList, getTightness, setPointList, setTightness, toLineStrip3D, updateCoefficients
-
Constructor Details
-
ParticlePath3D
public ParticlePath3D() -
ParticlePath3D
-
-
Method Details
-
createParticles
public List<VerletParticle3D> createParticles(VerletPhysics3D physics, int subDiv, float step, float mass) Creates particles along the spline at the fixed interval given. The precision of this interval will largely depend on the number of subdivision vertices created, but can be adjusted via the related parameter.- Parameters:
physics
- physics instancesubDiv
- number spline segment subdivisionsstep
- desired rest length between particlesmass
- desired particle mass- Returns:
- list of particles
-