Unit FireBlade

DescriptionusesClasses, Interfaces, Objects and RecordsFunctions and ProceduresTypesConstantsVariables

Description

FireBlade is a flexible and powerful particle engine. The creating of effects isn't done with emitters but in a low-level like form. This means that you are responsible for adding a particle to a container. This may result in a little more work for simpler effects, but guarantees a maximum of flexibility and leaves no borders for creating complexer effects.

Beside the implementation of the low-level containers, there are also several emitter implementations, for example to display writings with particle characters. FireBlade offers the possibility to switch between different vertex storage types, this guarantees the best performance and compatibility in all cases.

FireBlade offers many possibilities to change the visual appereance of an effect. This starts with adding a particle, where you can set many propertys for standard physics calculation and visual calculations. Later on you have the possibility to apply power to all particles without performance loss. These standard things are widely extended by four callbacks, where particle data can be used and manipulated. This includes all parameters used to calculate and render a particle. So there is, for instance, no problem even to work around the built in physics calculation. Everything is completely user defineable.

FireBlade is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.

Requires: dglOpenGL: www.delphigl.com

Copyright (C) 2005, 2009 by Sebastian Wagner. Special thanks to the DelphiGL community!

Overview

Classes, Interfaces, Objects and Records

Name Description
packed record TFB_SkeletonBone  
Class TFB_Magnet  
Class TFB_AppearanceModel  
packed record TFB_ParticleData  
Class TFB_Context  

Functions and Procedures

function fbGetError: Cardinal;

Types

PFB_ParticleData = ˆTFB_ParticleData;
TFB_Skeleton = Array of TFB_SkeletonBone;
TFB_NotifyEvent = procedure(AParticle: PFB_ParticleData; AContext: TFB_Context) of object;
TFB_GravitatedEvent = procedure(AParticle: PFB_ParticleData; AMagnet: TFB_Magnet; AContext: TFB_Context) of object;

Constants

FB_SHIFT = 100;
FB_FRUSTUM = 0;
FB_APPEARANCE = 1;
FB_PHYSICS = 2;
FB_VERTICES = 3;
FB_NORMALS = 4;
FB_POINTSPRITES = 5;
FB_SMEAR = 6;
FB_COLLISION_DETECTION = 7;
FB_CONCURRENT_DEPTHSORT = 8;
FB_TEXTURE_BLEND = 9;
FB_FLOWDENSITY = 0+FB_SHIFT;
FB_SMEARINTENSITY = 1+FB_SHIFT;
FB_SMEARSHIFT = 2+FB_SHIFT;
FB_WIND = 0+FB_SHIFT*3;
FB_MINBOUND = 1+FB_SHIFT*3;
FB_MAXBOUND = 2+FB_SHIFT*3;
FB_ARITHAVERAGE = 3+FB_SHIFT*3;
FB_PHYSICSMODEL_SIMPLE = 0;
FB_PHYSICSMODEL_REALISTIC = 1;
FB_MAGNETMODE_LINEAR = 0;
FB_MAGNETMODE_INVLINEAR = 1;
FB_MAGNETMODE_XYZDISTANCE = 2;
FB_MAGNETMODE_NORMALIZED = 3;
FB_MAGNETMODE_REALISTIC = 4;
FB_MAGNETMODE_USER = 5;
FB_INTERPOLATION_LINEAR = 0;
FB_INTERPOLATION_TRIGON = 1;
FB_SIZE_INTERPOLATION = 0;
FB_SIZE_ADDITION = 1;
FB_VERTEXSTORAGE_VBO = 0;
FB_VERTEXSTORAGE_VA = 1;
FB_VERTEXSTORAGE_USER = 2;
FB_ERR_NONE = 0;
FB_ERR_INVALID_VALUE = 1;
FB_ERR_INVALID_TARGET = 2;
FB_ERR_ILLEGAL_ACTION = 3;
FB_ERR_INVALID_TEXTURE = 4;

Description

Functions and Procedures

function fbGetError: Cardinal;

Returns the current error code.

Types

PFB_ParticleData = ˆTFB_ParticleData;

Pointer to TFB_ParticleData

TFB_Skeleton = Array of TFB_SkeletonBone;
 
TFB_NotifyEvent = procedure(AParticle: PFB_ParticleData; AContext: TFB_Context) of object;

Standard FireBlade event

Parameters
AParticle
The particle that fired the event
AContext
The particle's context
TFB_GravitatedEvent = procedure(AParticle: PFB_ParticleData; AMagnet: TFB_Magnet; AContext: TFB_Context) of object;

Gravitated Event. A userdefined magnet force can be added by manipulating the AParticleˆ.MagnetForce field.

Parameters
AParticle
The particle that fired the event
AMagnet
The magnet which reacts with the particle
AContext
The particle's context

Constants

FB_SHIFT = 100;

Shift value

FB_FRUSTUM = 0;

Frustum Calculation. Enabled by default.

FB_APPEARANCE = 1;

Appearance calculation, contains size and color. Enabled by default.

FB_PHYSICS = 2;

Physics Calculation. Enabled by default

FB_VERTICES = 3;

Vertex Calculation, including texture coordinates and normals. Enabled by default.

FB_NORMALS = 4;

Normal Calculation. Disabled by default.

FB_POINTSPRITES = 5;

Rendering with point sprites. Uses the activated container texture and size of the first particle. The vertex calculation (FB_VERTICES) should be disabled unless needed by the user, because it is obsolete for point sprites. Disabled by default

FB_SMEAR = 6;

Smear effect. Disabled by default.

FB_COLLISION_DETECTION = 7;

Collision detection for particles. Disabled by default.

FB_CONCURRENT_DEPTHSORT = 8;

Depth sorting. WARNING - may lack performance at high particle count and fast camera changes. Disabled by default

FB_TEXTURE_BLEND = 9;

Soft texture blending. Blends two textures of a particle according to its age to avoid an instant change. May lack performance. Disabled by default.

FB_FLOWDENSITY = 0+FB_SHIFT;

Density of the world. Only necessary with FB_PHYSICSMODEL_REALISTIC. Default value: 1.29

FB_SMEARINTENSITY = 1+FB_SHIFT;

Intensity of the smear effect

FB_SMEARSHIFT = 2+FB_SHIFT;

Texture balance for smeared particles. Default value: 0.5

FB_WIND = 0+FB_SHIFT*3;

Wind speed. Only necessary with FB_PHYSICSMODEL_REALISTIC

FB_MINBOUND = 1+FB_SHIFT*3;

Effect minimum boundary

FB_MAXBOUND = 2+FB_SHIFT*3;

Effect maximum boundary

FB_ARITHAVERAGE = 3+FB_SHIFT*3;

Arithmetic effect center

FB_PHYSICSMODEL_SIMPLE = 0;

Simple physics model. Only force and velocity calculation

FB_PHYSICSMODEL_REALISTIC = 1;

Realistic physics model. Force and velocity calculation, flow density, collision, magnets. Default value

FB_MAGNETMODE_LINEAR = 0;

Gravitation increases lineary with less distance. Default value

FB_MAGNETMODE_INVLINEAR = 1;

Gravitation decreases lineary with less distance.

FB_MAGNETMODE_XYZDISTANCE = 2;

Calculation of the force by calculation single coordinates.

FB_MAGNETMODE_NORMALIZED = 3;

Same gravitation on every point in radius.

FB_MAGNETMODE_REALISTIC = 4;

Realistic mass gravitation calculation. Gravitation becomes magnet mass in megatons. Particles mass is in megatons too.

FB_MAGNETMODE_USER = 5;

User defined magnet force by the OnGravitated event.

FB_INTERPOLATION_LINEAR = 0;

Linear interpolation between two hooks. Default value

FB_INTERPOLATION_TRIGON = 1;

Trigonometric interpolation between two hooks.

FB_SIZE_INTERPOLATION = 0;

Interpolate size from size of hooks.

FB_SIZE_ADDITION = 1;

Change size by using the growth vector (size = size + growth*deltatime).

FB_VERTEXSTORAGE_VBO = 0;

Stores vertex data in a Vertex Buffer Object

FB_VERTEXSTORAGE_VA = 1;

Stores vertex data in a Vertex Array. Often faster than VBO, maybe because the VBO changes very often and the data has do be moved to graphics memory. Default value.

FB_VERTEXSTORAGE_USER = 2;

Does no vertex storage at all. The user may do this in OnCalculated event.

FB_ERR_NONE = 0;

No error occured

FB_ERR_INVALID_VALUE = 1;

A given value is invalid

FB_ERR_INVALID_TARGET = 2;

The target is unknown

FB_ERR_ILLEGAL_ACTION = 3;

The action is not allowed in current context

FB_ERR_INVALID_TEXTURE = 4;

The texture tile index of a particle is out of range

Author

Created

01.24.05

Last Modified

06.28.09


Generated by PasDoc 0.11.0 on 2009-06-29 23:12:35