Package toxi.physics3d.behaviors
Class AttractionBehavior3D
java.lang.Object
toxi.physics3d.behaviors.AttractionBehavior3D
- All Implemented Interfaces:
ParticleBehavior3D
-
Constructor Summary
ConstructorDescriptionAttractionBehavior3D
(Vec3D attractor, float radius, float strength) AttractionBehavior3D
(Vec3D attractor, float radius, float strength, float jitter) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Applies the constraint to the passed in particle.void
configure
(float timeStep) float
float
float
void
setAttractor
(Vec3D attractor) void
setJitter
(float jitter) void
setRadius
(float r) void
setStrength
(float strength)
-
Constructor Details
-
AttractionBehavior3D
-
AttractionBehavior3D
-
-
Method Details
-
apply
Description copied from interface:ParticleBehavior3D
Applies the constraint to the passed in particle. The method is assumed to manipulate the given instance directly.- Specified by:
apply
in interfaceParticleBehavior3D
- Parameters:
p
- particle
-
configure
public void configure(float timeStep) - Specified by:
configure
in interfaceParticleBehavior3D
-
getAttractor
- Returns:
- the attractor
-
getJitter
public float getJitter()- Returns:
- the jitter
-
getRadius
public float getRadius()- Returns:
- the radius
-
getStrength
public float getStrength()- Returns:
- the strength
-
setAttractor
- Parameters:
attractor
- the attractor to set
-
setJitter
public void setJitter(float jitter) - Parameters:
jitter
- the jitter to set
-
setRadius
public void setRadius(float r) -
setStrength
public void setStrength(float strength) - Parameters:
strength
- the strength to set
-