|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gicentre.utils.network.traer.physics.Function<Particle,Particle>
org.gicentre.utils.network.traer.physics.Gravity
public class Gravity
Represents a gravity function which may be applied to particles.
Field Summary | |
---|---|
static float |
DEFAULT_GRAVITY
|
Constructor Summary | |
---|---|
Gravity()
Creates a zero-gravitational function. |
|
Gravity(float grav)
Creates a gravity function with the given gravity value applied in the 'y' direction. |
|
Gravity(float gx,
float gy,
float gz)
Creates a gravity function with the given gravity value applied 3 dimensions. |
|
Gravity(Vector3D grav3d)
Creates a gravity function with the given gravity value applied 3 dimensions. |
Method Summary | |
---|---|
Particle |
apply(Particle p)
Applies this gravity function to the given particle, modifying its velocity and direction as appropriate. |
Gravity |
setGravity(float grav)
Sets the gravity function with the given gravity value applied in the 'y' direction. |
Gravity |
setGravity(float gx,
float gy,
float gz)
Sets the gravity function with the given gravity value applied 3 dimensions. |
Gravity |
setGravity(Vector3D grav3d)
Sets the gravity function with the given gravity value applied 3 dimensions. |
Methods inherited from class org.gicentre.utils.network.traer.physics.Function |
---|
combine, functor, transform |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final float DEFAULT_GRAVITY
Constructor Detail |
---|
public Gravity()
public Gravity(float grav)
grav
- Gravitational parameter.public Gravity(float gx, float gy, float gz)
gx
- Gravitational parameter to be applied in the x-direction.gy
- Gravitational parameter to be applied in the y-direction.gz
- Gravitational parameter to be applied in the z-direction.public Gravity(Vector3D grav3d)
grav3d
- Gravitational parameter to be applied in the 3 dimensions.Method Detail |
---|
public Gravity setGravity(float grav)
grav
- Gravitational parameter.
public Gravity setGravity(float gx, float gy, float gz)
gx
- Gravitational parameter to be applied in the x-direction.gy
- Gravitational parameter to be applied in the y-direction.gz
- Gravitational parameter to be applied in the z-direction.
public Gravity setGravity(Vector3D grav3d)
grav3d
- Gravitational parameter to be applied in three dimensions.
public Particle apply(Particle p)
apply
in class Function<Particle,Particle>
p
- Particle upon which to apply the gravity.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |