PlaneConstraint
Defines one or many relationships between an infinite plane and single particles.
Orientaiton of the plane is defined by 3 points: planeA, planeB, and planeC.
var planeA = 0, planeB = 1, planeC = 2
var a = 3, b = 4, c = 5
var single = PlaneConstraint.create(planeA, planeB, planeC, a)
var many = PlaneConstraint.create(planeA, planeB, planeC, [a, b, c])
PlaneConstraint( planeA, planeB, planeC, a )
src/constraints/PlaneConstraint.js:15
-
planeAIntParticle index defining point on plane
-
planeBIntParticle index defining point on plane
-
planeCIntParticle index defining point on plane
-
aInt | ArrayParticle index or list of many indices
_calculateNormal( index, p0 )
private
src/constraints/PlaneConstraint.js:77
Calculate and cache plane normal vector. Calculated once per relaxation loop iteration.
-
indexIntConstraint set index
-
p0Float32Array (Vec3)Reference to
ParticleSystem.positions
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.
-
indexIntConstraint set index
-
p0Float32Array (Vec3)Reference to
ParticleSystem.positions -
p1Float32Array (Vec3)Reference to
ParticleSystem.positionsPrev
create( )
static
src/constraints/PlaneConstraint.js:53
Create instance, accepts constructor arguments.
setIndices( indices, [a] )
src/constraints/Constraint.js:73
Set particle indices with Array or list of arguments.
-
indicesInt | ArraySingle or many particle indices
-
[a]Int (*..n)Particle index
setPlane( a, b, c )
src/constraints/PlaneConstraint.js:61
Set particles defining constraint plane
-
aIntParticle index point on plane
-
bIntParticle index point on plane
-
cIntParticle index point on plane
_count Int
private
src/constraints/Constraint.js:37
Number of constraint relations managed by this instance
_hasNormal Bool
private
src/constraints/PlaneConstraint.js:129
State of constraint's plane normal resolution
_offset Int
private
src/constraints/Constraint.js:55
Number of indices to save at beginning of index array
bufferVec3 Float32Array (Vec3)
private
src/constraints/PlaneConstraint.js:40
Vec3 buffer which stores plane normal.