|
| SLParticleSystem (SLAssetManager *assetMgr, const SLint amount, const SLVec3f &velocityRandomStart, const SLVec3f &velocityRandomEnd, const SLfloat &timeToLive, SLGLTexture *texC, const SLstring &name="Particle system", SLGLTexture *texFlipbook=nullptr) |
| SLParticleSystem ctor with some initial values. The number of particles. More...
|
|
void | draw (SLSceneView *sv, SLNode *node) |
|
void | deleteData () |
| deleteData deletes all mesh data and VAOs More...
|
|
void | deleteDataGpu () |
| deleteData deletes all mesh data and VAOs More...
|
|
void | buildAABB (SLAABBox &aabb, const SLMat4f &wmNode) |
|
void | generate () |
| Function which will generate the particles and attributes them to the VAO. More...
|
|
void | generateBernsteinPAlpha () |
|
void | generateBernsteinPSize () |
|
void | changeTexture () |
|
void | setNotVisibleInFrustum () |
|
void | pauseOrResume () |
|
SLVec3f | acceleration () |
|
SLfloat | accelerationConst () |
|
SLint | amount () |
|
SLfloat | angularVelocityConst () |
|
SLVec2f | angularVelocityRange () |
|
float * | bezierControlPointAlpha () |
|
float * | bezierStartEndPointAlpha () |
|
float * | bezierControlPointSize () |
|
float * | bezierStartEndPointSize () |
|
SLBillboardType | billboardType () |
|
SLCol4f | color () |
|
SLVColorLUTPoint & | colorPoints () |
|
SLbool | doDirectionSpeed () |
|
SLbool | doSpeedRange () |
|
SLbool | doAcc () |
|
SLbool | doAccDiffDir () |
|
SLbool | doAlphaOverLT () |
|
SLbool | doAlphaOverLTCurve () |
|
SLbool | doBlendBrightness () |
|
SLbool | doCounterGap () |
|
SLbool | doColor () |
|
SLbool | doColorOverLT () |
|
SLbool | doGravity () |
|
SLbool | doFlipBookTexture () |
|
SLbool | doRotation () |
|
SLbool | doRotRange () |
|
SLbool | doSizeOverLT () |
|
SLbool | doSizeOverLTCurve () |
|
SLbool | doShape () |
|
SLbool | doShapeSurface () |
|
SLbool | doShapeOverride () |
|
SLbool | doShapeSpawnBase () |
|
SLbool | doWorldSpace () |
|
SLVec3f | direction () |
|
AvgFloat & | drawTime () |
|
SLVec3f | emitterPos () const |
|
SLVec3f | gravity () |
|
SLint | flipbookColumns () |
|
SLint | flipbookRows () |
|
int | frameRateFB () |
|
SLbool | isGenerated () |
|
SLbool | isPaused () |
|
SLfloat | radiusW () |
|
SLfloat | radiusH () |
|
SLfloat | scale () |
|
SLShapeType | shapeType () |
|
SLfloat | shapeAngle () |
|
SLfloat | shapeHeight () |
|
SLfloat | shapeRadius () |
|
SLVec3f | shapeScale () |
|
SLfloat | shapeWidth () |
|
SLfloat | speed () |
|
SLVec2f | speedRange () |
|
SLGLTexture * | textureFirst () |
|
SLGLTexture * | textureFlipbook () |
|
SLfloat | timeToLive () |
|
AvgFloat & | updateTime () |
|
SLint | velocityType () |
|
SLVec3f | velocityConst () |
|
SLVec3f | velocityRndMin () |
|
SLVec3f | velocityRndMax () |
|
void | amount (SLint i) |
|
void | accConst (SLfloat f) |
|
void | acceleration (SLVec3f v) |
|
void | acceleration (SLfloat vX, SLfloat vY, SLfloat vZ) |
|
void | angularVelocityConst (SLfloat f) |
|
void | angularVelocityRange (SLVec2f v) |
|
void | angularVelocityRange (SLfloat vX, SLfloat vY) |
|
void | billboardType (SLBillboardType bt) |
|
void | bezierControlPointAlpha (float arrayPoint[4]) |
|
void | bezierStartEndPointAlpha (float arrayPoint[4]) |
|
void | bezierControlPointSize (float arrayPoint[4]) |
|
void | bezierStartEndPointSize (float arrayPoint[4]) |
|
void | color (SLCol4f c) |
|
void | colorArr (SLfloat *arr) |
|
void | direction (SLVec3f v) |
|
void | direction (SLfloat vX, SLfloat vY, SLfloat vZ) |
|
void | doAcceleration (SLbool b) |
|
void | doAlphaOverLT (SLbool b) |
|
void | doAlphaOverLTCurve (SLbool b) |
|
void | doAccDiffDir (SLbool b) |
|
void | doBlendBrightness (SLbool b) |
|
void | doColor (SLbool b) |
|
void | doColorOverLT (SLbool b) |
|
void | doCounterGap (SLbool b) |
|
void | doDirectionSpeed (SLbool b) |
|
void | doGravity (SLbool b) |
|
void | doFlipBookTexture (SLbool b) |
|
void | doRotation (SLbool b) |
|
void | doRotRange (SLbool b) |
|
void | doSpeedRange (SLbool b) |
|
void | doShape (SLbool b) |
|
void | doShapeSurface (SLbool b) |
|
void | doShapeOverride (SLbool b) |
|
void | doShapeSpawnBase (SLbool b) |
|
void | doSizeOverLT (SLbool b) |
|
void | doSizeOverLTCurve (SLbool b) |
|
void | doWorldSpace (SLbool b) |
|
void | emitterPos (SLVec3f p) |
|
void | gravity (SLVec3f v) |
|
void | gravity (SLfloat vX, SLfloat vY, SLfloat vZ) |
|
void | flipbookColumns (SLint i) |
|
void | flipbookRows (SLint i) |
|
void | frameRateFB (int i) |
|
void | isGenerated (SLbool b) |
|
void | radiusW (SLfloat f) |
|
void | radiusH (SLfloat f) |
|
void | scale (SLfloat f) |
|
void | speed (SLfloat f) |
|
void | speedRange (SLVec2f v) |
|
void | speedRange (SLfloat vX, SLfloat vY) |
|
void | shapeType (SLShapeType st) |
|
void | shapeAngle (SLfloat f) |
|
void | shapeRadius (SLfloat r) |
|
void | shapeScale (SLVec3f v) |
|
void | shapeScale (SLfloat vX, SLfloat vY, SLfloat vZ) |
|
void | shapeHeight (SLfloat f) |
|
void | shapeWidth (SLfloat f) |
|
void | timeToLive (SLfloat f) |
|
void | textureFirst (SLGLTexture *t) |
|
void | textureFlipbook (SLGLTexture *t) |
|
void | velocityType (SLint i) |
|
void | velocityConst (SLVec3f v) |
|
void | velocityConst (SLfloat vX, SLfloat vY, SLfloat vZ) |
|
void | velocityRndMin (SLVec3f v) |
|
void | velocityRndMin (SLfloat vX, SLfloat vY, SLfloat vZ) |
|
void | velocityRndMax (SLVec3f v) |
|
void | velocityRndMax (SLfloat vX, SLfloat vY, SLfloat vZ) |
|
| SLMesh (SLAssetManager *assetMgr, const SLstring &name="Mesh") |
|
| ~SLMesh () override |
| The destructor deletes everything by calling deleteData. More...
|
|
virtual void | init (SLNode *node) |
| SLMesh::shapeInit sets the transparency flag of the AABB. More...
|
|
virtual void | draw (SLSceneView *sv, SLNode *node) |
|
void | drawIntoDepthBuffer (SLSceneView *sv, SLNode *node, SLMaterial *depthMat) |
| Simplified drawing method for shadow map creation. More...
|
|
void | addStats (SLNodeStats &stats) |
|
virtual void | buildAABB (SLAABBox &aabb, const SLMat4f &wmNode) |
|
void | updateAccelStruct () |
|
SLbool | hit (SLRay *ray, SLNode *node) |
|
virtual void | preShade (SLRay *ray) |
|
virtual void | deleteData () |
| SLMesh::deleteData deletes all mesh data and vbo's. More...
|
|
virtual void | deleteDataGpu () |
|
void | deleteSelected (SLNode *node) |
| Deletes the rectangle selected vertices and the dependent triangles. More...
|
|
void | deleteUnused () |
| Deletes unused vertices (= vertices that are not indexed in I16 or I32) More...
|
|
virtual void | calcMinMax () |
|
virtual void | calcNormals () |
| SLMesh::calcNormals recalculates vertex normals for triangle meshes. More...
|
|
void | calcCenterRad (SLVec3f ¢er, SLfloat &radius) |
|
SLbool | hitTriangleOS (SLRay *ray, SLNode *node, SLuint iT) |
|
virtual void | generateVAO (SLGLVertexArray &vao) |
| Generate the Vertex Array Object for a specific shader program. More...
|
|
void | computeHardEdgesIndices (float angleRAD, float epsilon) |
| computes the hard edges and stores the vertex indexes separately More...
|
|
void | transformSkin (const std::function< void(SLMesh *)> &cbInformNodes) |
| Transforms the vertex positions and normals with by joint weights. More...
|
|
void | deselectPartialSelection () |
|
SLMaterial * | mat () const |
|
SLMaterial * | matOut () const |
|
SLGLPrimitiveType | primitive () const |
|
const SLAnimSkeleton * | skeleton () const |
|
SLuint | numI () const |
|
SLGLVertexArray & | vao () |
|
SLbool | isSelected () const |
|
SLfloat | edgeAngleDEG () const |
|
SLfloat | edgeWidth () const |
|
SLCol4f | edgeColor () const |
|
SLVec3f | finalP (SLuint i) |
|
SLVec3f | finalN (SLuint i) |
|
SLbool | accelStructIsOutOfDate () |
|
void | mat (SLMaterial *m) |
|
void | matOut (SLMaterial *m) |
|
void | primitive (SLGLPrimitiveType pt) |
|
void | skeleton (SLAnimSkeleton *skel) |
|
void | isSelected (bool isSelected) |
|
void | edgeWidth (SLfloat ew) |
|
void | edgeAngleDEG (SLfloat ea) |
|
void | edgeColor (const SLCol4f &ec) |
|
void | vertexPosEpsilon (SLfloat eps) |
|
| SLObject (const SLstring &Name="", const SLstring &url="") |
|
virtual | ~SLObject () |
|
void | name (const SLstring &Name) |
|
void | url (const SLstring &url) |
|
const SLstring & | name () const |
|
const SLstring & | url () const |
|
|
SLint | _amount |
| Amount of a particle. More...
|
|
SLVec3f | _emitterPos |
| Position of the particle emitter. More...
|
|
SLfloat | _timeToLive |
| Time to live of a particle. More...
|
|
SLfloat | _radiusW = 0.4f |
| width radius of a particle More...
|
|
SLfloat | _radiusH = 0.4f |
| height radius of a particle More...
|
|
SLfloat | _scale = 1.0f |
| Scale of a particle (Scale the radius) More...
|
|
SLVec4f | _bernsteinPYAlpha = SLVec4f(2.0f, -3.0f, 0.0f, 1.0f) |
| Vector for bezier curve (default linear function) More...
|
|
float | _bezierControlPointAlpha [4] = {0.0f, 1.0f, 1.0f, 0.0f} |
| Floats for bezier curve control points (P1: 01 ; P2: 23) More...
|
|
float | _bezierStartEndPointAlpha [4] = {0.0f, 1.0f, 1.0f, 0.0f} |
| Floats for bezier curve end start points (Start: 01 ; End: 23) More...
|
|
SLVec4f | _bernsteinPYSize = SLVec4f(-1.4f, 1.8f, 0.6f, 0.0f) |
| Vector for bezier curve (default linear function) More...
|
|
float | _bezierControlPointSize [4] = {0.0f, 0.0f, 1.0f, 1.0f} |
| Floats for bezier curve control points (P1: 01 ; P2: 23) More...
|
|
float | _bezierStartEndPointSize [4] = {0.0f, 0.0f, 1.0f, 1.0f} |
| Floats for bezier curve end start points (Start: 01 ; End: 23) More...
|
|
SLVec3f | _acceleration = SLVec3f(1, 1, 1) |
| Vector for acceleration (different direction as the velocity) More...
|
|
SLfloat | _accelerationConst = 0.0f |
| Acceleration constant (same direction as the velocity) More...
|
|
SLVec3f | _gravity = SLVec3f(0.0f, -9.81f, 0.0f) |
| Vector for gravity (2nd. acceleration vector) More...
|
|
SLVec3f | _velocityConst = SLVec3f(0, 1, 0) |
| Velocity constant (go in xyz direction) More...
|
|
SLVec3f | _velocityRndMin = SLVec3f(-1, -1, -1) |
| Min. random velocity. More...
|
|
SLVec3f | _velocityRndMax = SLVec3f(1, 1, 1) |
| Max. random velocity. More...
|
|
SLVec3f | _direction = SLVec3f(0, 0, 0) |
| Direction of particle. More...
|
|
SLfloat | _speed = 1.0f |
| Speed of particle. More...
|
|
SLVec2f | _speedRange = SLVec2f(1, 2) |
| Speed random between two value. More...
|
|
SLCol4f | _color = SLCol4f(0.66f, 0.0f, 0.66f, 0.2f) |
| Color for particle. More...
|
|
SLfloat | _colorArr [256 *3] |
| Color values of color gradient widget. More...
|
|
SLVColorLUTPoint | _colorPoints |
|
int | _drawBuf = 0 |
| Color gradient points. More...
|
|
int | _flipbookFPS = 16 |
| Number of update of flipbook by second. More...
|
|
float | _flipboookLastUpdate = 0.0f |
| Last time flipbook was updated. More...
|
|
SLint | _flipbookColumns = 8 |
| Number of flipbook sub-textures by column. More...
|
|
SLint | _flipbookRows = 8 |
| Number of flipbook sub-textures by row. More...
|
|
AvgFloat | _updateTime |
| Averaged time for updating in MS. More...
|
|
AvgFloat | _drawTime |
| Averaged time for drawing in MS. More...
|
|
SLfloat | _startDrawTimeMS = 0.0f |
| Time since start of draw in MS. More...
|
|
SLfloat | _startUpdateTimeMS = 0.0f |
| Time since start for updating in MS. More...
|
|
SLfloat | _startUpdateTimeS = 0.0f |
| Time since start for updating in S. More...
|
|
SLfloat | _deltaTimeUpdateS = 0.0f |
| Delta time in between two frames S. More...
|
|
SLfloat | _notVisibleTimeS = 0.0f |
| Time since start when node not visible in S. More...
|
|
SLfloat | _lastTimeBeforePauseS = 0.0f |
| Time since the particle system is paused. More...
|
|
SLfloat | _shapeRadius = 1.0f |
| Radius of sphere and cone shape. More...
|
|
SLVec3f | _shapeScale = SLVec3f(1.0f) |
| Scale of box shape. More...
|
|
SLfloat | _shapeHeight = 3.0f |
| Height of cone and pyramid shapes. More...
|
|
SLfloat | _shapeAngle = 10.0f |
| Angle of cone and pyramid shapes. More...
|
|
SLfloat | _shapeWidth = 2.0f |
| Width of pyramid shape. More...
|
|
SLfloat | _angularVelocityConst = 30.0f |
| Rotation rate const (change in angular rotation divide by change in time) More...
|
|
SLVec2f | _angularVelocityRange = SLVec2f(-30.0f, 30.0f) |
| Rotation rate range (change in angular rotation divide by change in time) More...
|
|
SLBillboardType | _billboardType = BT_Camera |
| Billboard type (BT_Camera, BT_Vertical, BT_Horizontal. More...
|
|
SLShapeType | _shapeType = ST_Sphere |
| Shape type (ST_) More...
|
|
SLint | _velocityType = 0 |
| Velocity type. More...
|
|
SLGLTexture * | _textureFirst |
| Main texture of PS (non flipbook) More...
|
|
SLGLTexture * | _textureFlipbook |
| Flipbook texture with e.g. multiple flames at subsequent frames. More...
|
|
SLGLVertexArray | _vao1 |
| First OpenGL Vertex Array Object for swapping between updating/drawing. More...
|
|
SLGLVertexArray | _vao2 |
| Second OpenGL Vertex Array Object for swapping between updating/drawing. More...
|
|
SLbool | _isVisibleInFrustum = true |
| Boolean to set time since node not visible. More...
|
|
SLbool | _isPaused = false |
| Boolean to stop updating. More...
|
|
SLbool | _isGenerated = false |
| Boolean to generate particle system and load it on the GPU. More...
|
|
SLbool | _doBlendBrightness = false |
| Boolean for glow/brightness on pixel with many particle. More...
|
|
SLbool | _doDirectionSpeed = false |
| Boolean for direction and speed (override velocity) More...
|
|
SLbool | _doSpeedRange = false |
| Boolean for speed range. More...
|
|
SLbool | _doCounterGap = true |
| Boolean for counter lag/gap, can create flickering with few particle (explained in documentation) when enable. More...
|
|
SLbool | _doAcceleration = false |
| Boolean for acceleration. More...
|
|
SLbool | _doAccDiffDir = false |
| Boolean for acceleration (different direction) More...
|
|
SLbool | _doRotation = true |
| Boolean for rotation. More...
|
|
SLbool | _doRotRange = false |
| Boolean for rotation range (random value between range) More...
|
|
SLbool | _doColor = true |
| Boolean for color. More...
|
|
SLbool | _doShape = false |
| Boolean for shape feature. More...
|
|
SLbool | _doShapeSurface = false |
| Boolean for shape surface (particle will be spawned on surface) More...
|
|
SLbool | _doShapeOverride = false |
| Boolean for override direction for shape direction. More...
|
|
SLbool | _doShapeSpawnBase = false |
| Boolean for spawn at base of shape (for cone and pyramid) More...
|
|
SLbool | _doWorldSpace = false |
| Boolean for world space position. More...
|
|
SLbool | _doGravity = false |
| Boolean for gravity. More...
|
|
SLbool | _doAlphaOverLT = true |
| Boolean for alpha over life time. More...
|
|
SLbool | _doColorOverLT = false |
| Boolean for color over life time. More...
|
|
SLbool | _doAlphaOverLTCurve = false |
| Boolean for alpha over life time curve. More...
|
|
SLbool | _doSizeOverLT = true |
| Boolean for size over life time. More...
|
|
SLbool | _doSizeOverLTCurve = false |
| Boolean for size over life time curve. More...
|
|
SLbool | _doFlipBookTexture = false |
| Boolean for flipbook texture. More...
|
|
SLParticleSystem creates a particle meshes from a point primitive buffer.
The SLParticleSystem mesh object of which the vertices are drawn as points. An OpenGL transform feedback buffer is used to update the particle positions on the GPU and a geometry shader is used the create two triangles per particle vertex and orient them as a billboard to the viewer. Geometry shaders are only supported under OpenGL >= 4.0 and OpenGL ES >= 3.2. This is the case on most desktop systems and on Android SDK > 24 but not on iOS which has only OpenGL ES 3.0.
. The particle system supports many options of which many can be turned on the do* methods. All options can also be modified in the UI when the mesh is selected. See the different demo scenes in the app_demo_slproject under the demo scene group Particle Systems.