Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
Particles.h
Package: VCtracking.rar [view]
Upload User: xuczgm
Upload Date: 2022-04-25
Package Size: 8601k
Code Size: 2k
Category:
Special Effects
Development Platform:
Visual C++
- /****************************************************************************
- Particles.h Particle and particle system base classes.
- Author : Dave Astle
- Date : 2/1/2001
- Written for OpenGL Game Programming
- *****************************************************************************/
- #ifndef __PARTICLES_H_INCLUDED__
- #define __PARTICLES_H_INCLUDED__
- /********************************* Includes *********************************/
- //using namespace std;
- #include "../include/vector.h"
- /***************************** Data structures ******************************/
- class CParticleSystem;
- struct particle_t
- {
- CVector m_pos; // current position of the particle
- CVector m_prevPos; // last position of the particle
- CVector m_velocity; // direction and speed
- CVector m_acceleration; // acceleration
- float m_energy; // determines how long the particle is alive
- float m_size; // size of particle
- float m_sizeDelta; // amount to change the size over time
- float m_weight; // determines how gravity affects the particle
- float m_weightDelta; // change over time
- float m_color[4]; // current color of the particle
- float m_colorDelta[4]; // how the color changes with time
- };
- class CParticleSystem
- {
- public:
- CParticleSystem(int maxParticles, CVector origin);
- // abstract functions
- virtual void Update(float elapsedTime) = 0;
- virtual void Render() = 0;
- virtual int Emit(int numParticles);
- virtual void InitializeSystem();
- virtual void KillSystem();
- protected:
- virtual void InitializeParticle(int index) = 0;
- particle_t *m_particleList; // particles for this emitter
- int m_maxParticles; // maximum number of particles in total
- int m_numParticles; // indicies of all free particles
- CVector m_origin; // center of the particle system
- float m_accumulatedTime; // used to track how long since the last particle was emitted
- CVector m_force; // force (gravity, wind, etc.) acting on the particle system
- };
- #endif // __PARTICLES_H_INCLUDED__