Package toxi.physics2d.behaviors
Class ConstantForceBehavior2D
java.lang.Object
toxi.physics2d.behaviors.ConstantForceBehavior2D
- All Implemented Interfaces:
ParticleBehavior2D
- Direct Known Subclasses:
GravityBehavior2D
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Applies the constraint to the passed in particle.void
applyWithIndex
(SpatialIndex<Vec2D> spaceHash) void
configure
(float timeStep) getForce()
void
boolean
-
Constructor Details
-
ConstantForceBehavior2D
-
-
Method Details
-
apply
Description copied from interface:ParticleBehavior2D
Applies the constraint to the passed in particle. The method is assumed to manipulate the given instance directly.- Specified by:
apply
in interfaceParticleBehavior2D
- Parameters:
p
- particle
-
applyWithIndex
- Specified by:
applyWithIndex
in interfaceParticleBehavior2D
-
configure
public void configure(float timeStep) - Specified by:
configure
in interfaceParticleBehavior2D
-
getForce
- Returns:
- the force
-
setForce
- Parameters:
force
- the force to set
-
supportsSpatialIndex
public boolean supportsSpatialIndex()- Specified by:
supportsSpatialIndex
in interfaceParticleBehavior2D
-