ForceGenerator Class
adds a constant force to associated objects
Constructor
ForceGenerator
(
-
force
Parameters:
-
force
Vec3[optional] force the generator applies
Methods
affect
(
-
object
adds an object to be affected by the generator
Parameters:
-
object
Mixedobject to be affected, must have
applyForce
method
applyForce
()
applies force to the associated objects
disable
()
disables the force generator
enable
()
enables the force generator
unaffect
(
-
object
removes an object from being affected by the generator
Parameters:
-
object
Mixedobject to be affected, must have
applyForce
method
Properties
affected
Array
private
array of objects affected by the generator
Default: []
enabled
Boolean
whether or not the force generator is enabled
Default: true
force
Vec3
force which will be applied to affected objects
Default: [ 0, 0, 0 ]