AxisConstraint
Defines one or many relationships between an infinite axis and single particles.
Orientaiton of the axis is defined by 2 points: axisA
and axisB
.
var axisA = 0, axisB = 1
var a = 2, b = 3, c = 4
var single = AxisConstraint.create(axisA, axisB, a)
var many = AxisConstraint.create(axisA, axisB, [a, b, c])
AxisConstraint
( axisA, axisB, a
)
src/constraints/AxisConstraint.js:14
-
axisA
IntParticle index defining start of axis
-
axisB
IntParticle index defining end of axis
-
a
Int | ArrayParticle index or list of many indices
applyConstraint
( index, p0, p1
)
protected
src/constraints/Constraint.js:90
Apply constraint to one set of particles defining a constrint relation.
Called _count
times per relaxation loop.
-
index
IntConstraint set index -
p0
Float32Array (Vec3)Reference toParticleSystem.positions
-
p1
Float32Array (Vec3)Reference toParticleSystem.positionsPrev
create
(
)
static
src/constraints/AxisConstraint.js:41
Create instance, accepts constructor arguments.
setAxis
( a, b
)
src/constraints/AxisConstraint.js:49
Set particles defining constraint axis
-
a
IntParticle index defining start of axis
-
b
IntParticle index defining end of axis
setIndices
( indices, [a]
)
src/constraints/Constraint.js:73
Set particle indices with Array
or list of arguments
.
-
indices
Int | ArraySingle or many particle indices -
[a]
Int (*..n)Particle index
_count
Int
private
src/constraints/Constraint.js:37
Number of constraint relations managed by this instance
_itemSize
Int
private
src/constraints/Constraint.js:46
Number of particles per constraint relation
_offset
Int
private
src/constraints/Constraint.js:55
Number of indices to save at beginning of index array
indices
Uint16Array
src/constraints/Constraint.js:29
Particle indices defining constraint relations