public final class Real extends Noise
| Modifier and Type | Class and Description |
|---|---|
static class |
Real.PressurePoint
A PressurePoint defined by the origin, pressure pulse, Maximum time of perturbation
and wave longitude.
|
static class |
Real.Wave
A wave defined by the direction, amplitude, period, and optionally phase.
|
| Constructor and Description |
|---|
Real() |
| Modifier and Type | Method and Description |
|---|---|
int |
addPressurePoint(Vec2 origin,
float pressure,
float maxTime,
float waveLength)
Adds a pressure point to the system
|
int |
addWave(Vec2 dir,
float amplitude,
float periode,
float phase)
Adds a wave to the system.
|
protected void |
destroy()
Remove
|
int |
getNumWaves() |
protected float |
getStrength() |
float |
getValue(float x,
float y)
Get the specified x/y noise value
|
Real.Wave |
getWave(int id)
Returns a wave to the system.
|
protected boolean |
isUpdateThreadSafe() |
protected boolean |
loadConfig(ConfigManager config)
Load config
|
boolean |
modifyWave(int id,
Vec2 dir,
float A,
float T,
float p)
Modify a wave from the system.
|
boolean |
removeWave(int id)
Removes a wave from the system.
|
protected void |
saveConfig(java.lang.StringBuffer data)
Save config
|
protected boolean |
update(float timeSinceLastFrame)
Call it each frame
|
public int getNumWaves()
public int addWave(Vec2 dir, float amplitude, float periode, float phase)
dir - Direction of the wave.amplitude - Amplitude of the wave (m).periode - Period of the wave (s).phase - Phase of the wave (rad).public Real.Wave getWave(int id)
id - Identifier of the wave.public boolean removeWave(int id)
id - Identifier of the wave.public boolean modifyWave(int id,
Vec2 dir,
float A,
float T,
float p)
id - Identifier of the wave.A - Amplitude of the wave (m).T - Period of the wave (s).p - Phase of the wave (rad).public int addPressurePoint(Vec2 origin, float pressure, float maxTime, float waveLength)
origin - Origin of perturbation.pressure - Pressure pulse (N.m). \n
The maximum half-amplitude of the wave will result from divide this value
with g*rho. So, a pressure of 10000 N·m produces 2 m waves.maxTime - Maximum time of perturbation (s). \n
The effect of the perturbation will decay. When T time will be elapsed,
any effects will remain.waveLength - wave length. \n
To objects falling, similar values to amplitude can be OK. For ships Kelvin
wakes probably length of the ship is a better choice.protected void saveConfig(java.lang.StringBuffer data)
saveConfig in class Noisedata - String referenceprotected boolean loadConfig(ConfigManager config)
loadConfig in class Noiseconfig - ConfigManagerprotected boolean update(float timeSinceLastFrame)
protected boolean isUpdateThreadSafe()
isUpdateThreadSafe in class Noisepublic float getValue(float x,
float y)
protected float getStrength()
getStrength in class NoiseBonzai Engine 1.4.1-20200831 - A Java OpenGL engine and tools for Windows/Mac/Linux/Android
Copyright © 2007-2019 Jérôme Jouvie bonzaiengine.com contact@bonzaiengine.com