this.position = {
_value: utils.ensureInstanceOf( options.position.value, THREE.Vector3, new THREE.Vector3() ),
_spread: utils.ensureInstanceOf( options.position.spread, THREE.Vector3, new THREE.Vector3() ),
_spreadClamp: utils.ensureInstanceOf( options.position.spreadClamp, THREE.Vector3, new THREE.Vector3() ),
_distribution: utils.ensureTypedArg( options.position.distribution, types.NUMBER, this.type ),
_randomise: utils.ensureTypedArg( options.position.randomise, types.BOOLEAN, false ),
_radius: utils.ensureTypedArg( options.position.radius, types.NUMBER, 10 ),
_radiusScale: utils.ensureInstanceOf( options.position.scale, THREE.Vector3, new THREE.Vector3( 1, 1, 1 ) ),
_distributionClamp: utils.ensureTypedArg( options.position.distributionClamp, types.NUMBER, 0 ),
};
this.velocity = {
_value: utils.ensureInstanceOf( options.velocity.value, THREE.Vector3, new THREE.Vector3() ),
_spread: utils.ensureInstanceOf( options.velocity.spread, THREE.Vector3, new THREE.Vector3() ),
_distribution: utils.ensureTypedArg( options.velocity.distribution, types.NUMBER, this.type ),
_randomise: utils.ensureTypedArg( options.position.randomise, types.BOOLEAN, false )
};
this.acceleration = {
_value: utils.ensureInstanceOf( options.acceleration.value, THREE.Vector3, new THREE.Vector3() ),
_spread: utils.ensureInstanceOf( options.acceleration.spread, THREE.Vector3, new THREE.Vector3() ),
_distribution: utils.ensureTypedArg( options.acceleration.distribution, types.NUMBER, this.type ),
_randomise: utils.ensureTypedArg( options.position.randomise, types.BOOLEAN, false )
};
this.drag = {
_value: utils.ensureTypedArg( options.drag.value, types.NUMBER, 0 ),
_spread: utils.ensureTypedArg( options.drag.spread, types.NUMBER, 0 ),
_randomise: utils.ensureTypedArg( options.position.randomise, types.BOOLEAN, false )
};
this.wiggle = {
_value: utils.ensureTypedArg( options.wiggle.value, types.NUMBER, 0 ),
_spread: utils.ensureTypedArg( options.wiggle.spread, types.NUMBER, 0 )
};
this.rotation = {
_axis: utils.ensureInstanceOf( options.rotation.axis, THREE.Vector3, new THREE.Vector3( 0.0, 1.0, 0.0 ) ),
_axisSpread: utils.ensureInstanceOf( options.rotation.axisSpread, THREE.Vector3, new THREE.Vector3() ),
_angle: utils.ensureTypedArg( options.rotation.angle, types.NUMBER, 0 ),
_angleSpread: utils.ensureTypedArg( options.rotation.angleSpread, types.NUMBER, 0 ),
_static: utils.ensureTypedArg( options.rotation.static, types.BOOLEAN, false ),
_center: utils.ensureInstanceOf( options.rotation.center, THREE.Vector3, this.position._value.clone() ),
_randomise: utils.ensureTypedArg( options.position.randomise, types.BOOLEAN, false )
};
this.maxAge = {
_value: utils.ensureTypedArg( options.maxAge.value, types.NUMBER, 2 ),
_spread: utils.ensureTypedArg( options.maxAge.spread, types.NUMBER, 0 )
};