public final class VolClouds
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
VolClouds.CameraData
Camera data struct
|
static class |
VolClouds.GeometrySettings
Geometry settings
|
| Modifier | Constructor and Description |
|---|---|
protected |
VolClouds(SkyX s)
Simple constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected Array<VolClouds.CameraData> |
_getCamerasData()
Get cameras data
|
protected void |
create(Vec2 height,
float radius)
Create
|
protected void |
create(VolClouds.GeometrySettings gs)
Create
|
protected void |
createIfNeeded(IGLApi glApi)
Create
|
protected void |
destroy(IGLApi glApi) |
Vec3 |
getAmbientColor(Vec3 dst)
Get Ambient color
|
Vec4 |
getAmbientFactors(Vec4 dst)
Get ambient factors
|
protected View |
getCamera() |
float |
getCloudFieldScale()
Get cloud field scale
|
protected com.bonzaiengine.effects.skyx.DataManager |
getDataManager()
Get data manager
|
void |
getDistanceFallingParams(Vec2 dst)
Get distance falling params
|
protected com.bonzaiengine.effects.skyx.GeometryManager |
getGeometryManager()
Get geometry manager
|
VolClouds.GeometrySettings |
getGeometrySettings()
Get geometry settings
|
float |
getGlobalOpacity()
Get global opacity
|
LightningManager |
getLightningManager()
Get lightning manager
|
Vec4 |
getLightResponse(Vec4 dst)
Get light response
|
float |
getNoiseScale()
Get noise scale
|
protected SkyX |
getSkyX() |
void |
getSunColor(Vec3 dst)
Get sun color
|
void |
getSunDirection(Vec3 dst)
Get sun direction
|
Vec2 |
getWeather(Vec2 dst)
Get weather
|
float |
getWindDirection()
Get wind direction
|
void |
getWindDirectionV2(Vec2 dst)
Get wind direction as a Vector2
|
float |
getWindSpeed()
Get wind speed
|
boolean |
isCreated()
Has been create() already called?
|
boolean |
isVisible()
Is VolClouds visible?
|
protected void |
notifyCameraRender(IGLApi glApi,
View c,
float timeSinceLastCameraFrame)
Notify camera render, to be invoked per-camera and per-frame
|
void |
registerCamera(View c)
Register camera
|
protected void |
render(Renderer pipeline) |
void |
setAmbientColor(Vec3 ambientColor)
Set ambient color
|
void |
setAmbientFactors(Vec4 ambientFactors)
Set ambient factors
|
void |
setCloudFieldScale(float cloudFieldScale)
Set cloud field scale
|
void |
setDistanceFallingParams(Vec2 distanceFallingParams)
Set distance falling params
|
void |
setGeometrySettings(VolClouds.GeometrySettings geometrySettings)
Set geometry settings
|
void |
setGlobalOpacity(float globalOpacity)
Set global opacity
|
void |
setLightResponse(Vec4 lightResponse)
Set light response
|
void |
setNoiseScale(float noiseScale)
Set noise scale
|
void |
setSunColor(Vec3 sunColor)
Set sun color
|
void |
setSunDirection(Vec3 sunDirection)
Set sun direction
|
void |
setVisible(boolean visible)
Set visible
|
void |
setWeather(float humidity,
float averageCloudsSize,
boolean delayedResponse)
Set weather parameters
Use this function to update the cloud field parameters, you'll get a smart and smooth transition from your old
setting to your new ones.
|
void |
setWindDirection(float windDirection)
Set wind direction
|
void |
setWindSpeed(float windSpeed)
Set wind speed
|
void |
unregisterCamera(View c)
Unregister camera
|
protected void |
update(IGLApi glApi,
float timeSinceLastFrame)
Update, to be invoked per frame
|
protected VolClouds(SkyX s)
s - Scene managerprotected void destroy(IGLApi glApi)
protected void createIfNeeded(IGLApi glApi)
protected void create(VolClouds.GeometrySettings gs)
gs - Geometry settingsprotected void create(Vec2 height, float radius)
height - x = Cloud field y-coord start, y: Field height (both in world coordinates)radius - Radiusprotected void update(IGLApi glApi, float timeSinceLastFrame)
timeSinceLastFrame - Time since last frameprotected void notifyCameraRender(IGLApi glApi, View c, float timeSinceLastCameraFrame)
c - Rendering cameratimeSinceLastCameraFrame - Time since last CAMERA frameprotected void render(Renderer pipeline)
public void registerCamera(View c)
c - Camerapublic void unregisterCamera(View c)
c - Camerapublic boolean isCreated()
public void setGeometrySettings(VolClouds.GeometrySettings geometrySettings)
geometrySettings - Geometry settingspublic VolClouds.GeometrySettings getGeometrySettings()
public void setDistanceFallingParams(Vec2 distanceFallingParams)
distanceFallingParams - DistanceFallingParams.x = Distance falling factor (How much the cloud field geometry falls with the distance)
Remember that the geometry falling is relative to the distance(height) between the camera
and the cloud field. Typical range is [0, ~2] 0 = no falling
DistanceFallingParams.y = Max falling (in world coords), useful when , i.e., you've water and you want to go in.
That param will allow you to avoid the cloud field geometry falls into the ocean.
-1 means not max falling. (default)public void getDistanceFallingParams(Vec2 dst)
public void setWindDirection(float windDirection)
windDirection - Wind directionpublic float getWindDirection()
public void getWindDirectionV2(Vec2 dst)
public void setWindSpeed(float windSpeed)
windSpeed - Wind speedpublic float getWindSpeed()
public void setSunDirection(Vec3 sunDirection)
sunDirection - Sun directionpublic void getSunDirection(Vec3 dst)
public void setSunColor(Vec3 sunColor)
sunColor - Sun colorpublic void getSunColor(Vec3 dst)
public void setAmbientColor(Vec3 ambientColor)
ambientColor - Ambient colorpublic void setLightResponse(Vec4 lightResponse)
lightResponse - x - Sun light power
y - Sun beta multiplier
z - Ambient color multiplier
w - Distance attenuationpublic void setAmbientFactors(Vec4 ambientFactors)
ambientFactors - x - constant, y - linear, z - quadratic, w - cubicpublic Vec4 getAmbientFactors(Vec4 dst)
public void setGlobalOpacity(float globalOpacity)
globalOpacity - Global opacity: [0,1] range 0.Transparent cloud fieldpublic float getGlobalOpacity()
public void setCloudFieldScale(float cloudFieldScale)
cloudFieldScale - Cloud field scalepublic float getCloudFieldScale()
public void setNoiseScale(float noiseScale)
noiseScale - Noise scalepublic float getNoiseScale()
public void setWeather(float humidity,
float averageCloudsSize,
boolean delayedResponse)
humidity - Humidity, in other words: the percentage of clouds in [0,1] range.averageCloudsSize - Average clouds size, for example: if previous weather clouds size parameter was very different from new one(i.e: more little)
only the old biggest clouds are going to be keept and the little ones are going to be replaceddelayedResponse - false to change weather conditions over several updates, true to change it at the momentpublic Vec2 getWeather(Vec2 dst)
public void setVisible(boolean visible)
visible - true to set VolClouds visible, false to hide itpublic boolean isVisible()
protected SkyX getSkyX()
protected com.bonzaiengine.effects.skyx.DataManager getDataManager()
protected com.bonzaiengine.effects.skyx.GeometryManager getGeometryManager()
public LightningManager getLightningManager()
protected View getCamera()
protected Array<VolClouds.CameraData> _getCamerasData()
Bonzai 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