pward84020
Forum Replies Created
-
AuthorPosts
-
pward84020ParticipantThings appear to be quite stable now.
Minimal work will still be required to integrate into the engine of your choice.
I’ve not tested all effects ( ex. particles which align themselves from their velocity ), but any bugs there should be easy to locate.
How would this source snippet best be delivered ?
pward84020ParticipantSure.
I’m just going through some final tests ( discovered animated frames was not working ).
Also trying to slim the classes down a bit…I currently have it running on an iOS environment ( iPad ). Will run off some profile numbers for some specific effects. iOS is almost always pixel bound ( especially with a lot of alpha blending going on ). But besides that, I’ll find out how much CPU time is spend for particle updates.
Will post code soon.
- This reply was modified 10 years, 10 months ago by pward84020.
pward84020ParticipantI’ve just completed a cpp conversion, and have it working in my custom engine.
This is not a stand alone port, as it still needs to be integrated into other engines. However, this should be simple as their are only a few methods related to graphics.
Because I intend to use this in games and need maximum performance, I removed the interpolation method of graphs, and only support look-up tables.
If anyone is interested in looking at this, as a starting point for your own conversion, please let me know
Peter
Ex: tlParticle looks like this:
class tlParticle : public tlEntity
{
public:
tlParticle();
~tlParticle();f32 GetCurrentFrame();
void SetCurrentFrame( f32 frame );void Update();
void Reset();
void Destroy();public:
// ———————————
tlEmitter * m_Emitter; // emitter it belongs to
// ———————————
f32 m_WeightVariation; // Particle weight variation
f32 m_GSizeX; // Particle global size x
f32 m_GSizeY; // Particle global size y
// ———————————
//f32 m_VelVariation; // velocity variation
//f32 m_VelSeed; // rnd seed
// ———————————
f32 m_CurrentFrame; // current frame of animation
// ———————————
FontChar * m_Avatar; // link to the glyph that represents the entity
// ———————————
f32 m_SpinVariation; // variation of spin speed
// ———————————
f32 m_DirectionVariation; // Direction variation at spawn time
f32 m_TimeTracker; // This is used to keep track of game ticks so that some things can be updated between specific time intervals
f32 m_RandomDirection; // current direction of the random motion that pulls the particle in different directions
f32 m_RandomSpeed; // random speed to apply to the particle movement
f32 m_EmissionAngle; // Direction variation at spawn time
int m_ReleaseSingleParticle; // set to true to release single particles and let them decay and die
// ———————————
int m_Layer; // layer the particle belongs to
bool m_GroupParticles; // whether the particle is added the PM pool or kept in the emitter’s pooltlParticle * m_Prev; // for linked lists of active/inactive particle objects.
tlParticle * m_Next;
}; -
AuthorPosts