1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     demo_Particle.h
4 
5   Copyright (C)2009-2012 Nintendo Co., Ltd.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Rev: 46365 $
14  *---------------------------------------------------------------------------*/
15 
16 #ifndef DEMO_PARTICLE_H_
17 #define DEMO_PARTICLE_H_
18 
19 #include "demo/Utility/demo_Utility.h"
20 
21 #include "demo/Body/demo_Body.h"
22 #include "demo/Body/demo_Sphere.h"
23 
24 namespace demo
25 {
26     /*!
27     :private
28 
29     @brief Particle class.
30     */
31 
32     class Particle : public Body
33     {
34     public:
35         Particle(void);
36         virtual ~Particle(void);
37 
38     public:
39         virtual void Initialize(void);
40         void InitializeParticle(const u32 vertexAttributes, const f32 radius, const u32 division);
41         virtual void Finalize(void);
42 
43     public:
44         void Update(const f32 time);
45     protected:
46         void Spawn(void);
47 
48     public:
49         virtual nn::math::MTX44 GetWorldMatrix(void) const;
50 
51     public:
52         virtual void Draw(void);
53 
54     public:
55         f32 m_LifeTime;
56 
57         f32 m_Mass;
58         nn::math::Vector3 m_Position;
59         nn::math::Vector3 m_Velocity;
60         nn::math::Vector3 m_Acceleration;
61 
62         nn::math::Vector3 m_Color;
63 
64         demo::Sphere m_Sphere;
65 
66     public:
67         static bool s_Initialize;
68         static u32 s_InitialLifeTime;
69         static f32 s_InitialMass;
70         static nn::math::Vector3 s_InitialPosition;
71         static nn::math::Vector3 s_InitialVelocity;
72         static nn::math::Vector3 s_RandomVelocityScale;
73         static nn::math::Vector3 s_Gravity;
74 
75         static f32 s_InitialRadius;
76     };
77 
78 }
79 
80 #endif
81