PageRenderTime 225ms CodeModel.GetById 221ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/xbmc/screensavers/rsxs-0.9/src/skyrocket/bee.hh

http://github.com/xbmc/xbmc
C++ Header | 59 lines | 30 code | 7 blank | 22 comment | 0 complexity | 38c9e34a80c38e987c00ed1adbfd122a MD5 | raw file
 1/*
 2 * Really Slick XScreenSavers
 3 * Copyright (C) 2002-2006  Michael Chapman
 4 *
 5 * This program is free software; you can redistribute it and/or modify
 6 * it under the terms of the GNU General Public License version 2 as
 7 * published by the Free Software Foundation.
 8 *
 9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17 *
18 *****************************************************************************
19 *
20 * This is a Linux port of the Really Slick Screensavers,
21 * Copyright (C) 2002 Terence M. Welsh, available from www.reallyslick.com
22 */
23#ifndef _BEE_HH
24#define _BEE_HH
25
26#include <common.hh>
27
28#include <color.hh>
29#include <particle.hh>
30#include <vector.hh>
31
32class Bee : public Particle {
33private:
34	RGBColor _RGB;
35	float _brightness;
36
37	Vector _accel;
38	Vector _accelSpeed;
39
40	Vector _sparkPos;
41public:
42	Bee(const Vector& pos, const Vector& vel, const RGBColor& RGB) :
43		Particle(pos, vel, 0.3f, Common::randomFloat(1.0f) + 2.5f),
44		_RGB(RGB), _accel(
45			Common::randomFloat(M_PI * 2),
46			Common::randomFloat(M_PI * 2),
47			Common::randomFloat(M_PI * 2)
48		), _accelSpeed(
49			Common::randomFloat(M_PI * 2),
50			Common::randomFloat(M_PI * 2),
51			Common::randomFloat(M_PI * 2)
52		), _sparkPos(_pos) {}
53
54	void update();
55	void updateCameraOnly();
56	void draw() const;
57};
58
59#endif // _BEE_HH