PointForce

Extends: Force
Defined in: src/forces/PointForce.js:14

Defines a directional force that affects all particles in the system.

var repulsor = PointForce.create([0.0, 2.0, 3.0], {
  type : Force.REPULSOR,
  radius : 15.0,
  intensity : 0.1
})
PointForce( position, [opts] )
src/forces/PointForce.js:14
  • position Array (Vec3)

    Force position

  • [opts] Object

    Options

    • type Int (Enum)
    • radius Float
    • intensity Float
applyForce( ix, f0, p0, p1 ) protected
Defined in Force: src/forces/Force.js:67

Apply force to one particle in system.

  • ix Int

    Particle vector x index

  • f0 Float32Array (Vec3)

    Reference to ParticleSystem.accumulatedForces

  • p0 Float32Array (Vec3)

    Reference to ParticleSystem.positions

  • p1 Float32Array (Vec3)

    Reference to ParticleSystem.positionsPrev

create( ) static
src/forces/PointForce.js:54

Create instance, accepts constructor arguments.

set( x, y, z )
Defined in Force: src/forces/Force.js:55

Alias for Vec3.set.

  • x Float
  • y Float
  • z Float
setRadius( r )
src/forces/PointForce.js:62

Set radius

  • r Float

    Radius

_radius2 Float private
src/forces/PointForce.js:72

Cached value of squared influence radius

intensity Float
src/forces/PointForce.js:38

Magnitude of force vector

Default: 0.05

type Int (Enum)
src/forces/Force.js:43

Force type enum: Force.ATTRACTOR, Force.REPULSOR, Force.ATTRACTOR_REPULSOR.

Default: Force.ATTRACTOR