My Project
ParticleSystemRef.h
1 #pragma once
2 
3 namespace ParaEngine
4 {
5  class ParticleSystem;
6 
7 
10  {
11  ParticleSystemRef():m_ptr(NULL) {};
12  explicit ParticleSystemRef(ParticleSystem* ptr);
14 
16  ParticleSystemRef & operator=(const ParticleSystemRef& r); // never throws;
17 
18  inline ParticleSystem* get() const {return m_ptr;}
19  operator bool () const{
20  return m_ptr != 0;
21  }
22  bool operator! () const // never throws
23  {
24  return m_ptr == 0;
25  }
26  ParticleSystem& operator* () const // never throws
27  {
28  PE_ASSERT(m_ptr != 0);
29  return *m_ptr;
30  }
31  ParticleSystem * operator-> () const // never throws
32  {
33  PE_ASSERT(m_ptr != 0);
34  return m_ptr;
35  }
36 
37  inline bool operator==(const ParticleSystemRef & b)
38  {
39  return this->get() == b.get();
40  }
41 
42  inline bool operator!=(const ParticleSystemRef & b)
43  {
44  return this->get() != b.get();
45  }
46 
47  inline bool operator==(ParticleSystem const * b)
48  {
49  return this->get() == b;
50  }
51 
52  inline bool operator!=( ParticleSystem const * b)
53  {
54  return this->get() != b;
55  }
56 
57  protected:
58  ParticleSystem* m_ptr;
59  };
60 
61 
62 
63 }
different physics engine has different winding order.
Definition: EventBinding.h:32
holding a reference of this class
Definition: ParticleSystemRef.h:9
The particle class keeps a list of all of its instances.A particle system instance is always associat...
Definition: particle.h:99