xref: /haiku/src/add-ons/screen_savers/gravity/Particle.h (revision 8e727810a7795df5c54b6f67a966969d8bbdb539)
18cd10c71STri-Edge AI /*
28cd10c71STri-Edge AI  * Copyright 2012-2013 Tri-Edge AI <triedgeai@gmail.com>
3*8e727810SJohn Scipione  * Copyright 2014 Haiku, Inc. All rights reserved.
4*8e727810SJohn Scipione  *
5*8e727810SJohn Scipione  * Distributed under the terms of the MIT license.
6*8e727810SJohn Scipione  *
7*8e727810SJohn Scipione  * Authors:
8*8e727810SJohn Scipione  *		Tri-Edge AI
9*8e727810SJohn Scipione  *		John Scipione, jscipione@gmail.com
108cd10c71STri-Edge AI  */
118cd10c71STri-Edge AI #ifndef PARTICLE_H
128cd10c71STri-Edge AI #define PARTICLE_H
138cd10c71STri-Edge AI 
148cd10c71STri-Edge AI 
15*8e727810SJohn Scipione #include <ObjectList.h>
168cd10c71STri-Edge AI #include <GLView.h>
178cd10c71STri-Edge AI 
188cd10c71STri-Edge AI 
19*8e727810SJohn Scipione class Particle {
208cd10c71STri-Edge AI public:
21*8e727810SJohn Scipione 	static	BObjectList<Particle>*	list;
228cd10c71STri-Edge AI 
238cd10c71STri-Edge AI 	static	void					Initialize(int32 size, int32 shade);
24*8e727810SJohn Scipione 	static	void					AddParticles(int32 size, int32 shade);
25*8e727810SJohn Scipione 	static	void					RemoveParticles(int32 size, int32 shade);
26*8e727810SJohn Scipione 	static	void					ColorParticles(int32 size, int32 shade);
278cd10c71STri-Edge AI 	static	void					Terminate();
288cd10c71STri-Edge AI 	static	void					Tick();
298cd10c71STri-Edge AI 
308cd10c71STri-Edge AI 			float					x;
318cd10c71STri-Edge AI 			float					y;
328cd10c71STri-Edge AI 			float					z;
338cd10c71STri-Edge AI 			float					r;
348cd10c71STri-Edge AI 
358cd10c71STri-Edge AI 			float					vx;
368cd10c71STri-Edge AI 			float					vy;
378cd10c71STri-Edge AI 			float					vz;
388cd10c71STri-Edge AI 			float					vr;
398cd10c71STri-Edge AI 
408cd10c71STri-Edge AI 			float					red;
418cd10c71STri-Edge AI 			float					green;
428cd10c71STri-Edge AI 			float					blue;
438cd10c71STri-Edge AI 
448cd10c71STri-Edge AI private:
458cd10c71STri-Edge AI 			void					_Logic();
468cd10c71STri-Edge AI 			void					_Render() const;
478cd10c71STri-Edge AI 
48*8e727810SJohn Scipione 	static	void					_FillParticle(Particle* p, int32 size,
49*8e727810SJohn Scipione 										int32 shade);
50*8e727810SJohn Scipione 	static	void					_ColorParticle(Particle* p, int32 size,
51*8e727810SJohn Scipione 										int32 shade);
528cd10c71STri-Edge AI };
538cd10c71STri-Edge AI 
548cd10c71STri-Edge AI 
55*8e727810SJohn Scipione #endif	// PARTICLE_H
56