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