Modifier and Type | Field and Description |
---|---|
static float |
DEFAULT_GRAVITY
Default gravity value (0)
|
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public static final float DEFAULT_GRAVITY
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.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.