RioEngine  0.1
My first attempt to create a 3D WYSIWYG Game Engine
cbulletproperties.h
Go to the documentation of this file.
1 //--------------------------------------------------------------- @License begins
2 // RioEngine: The late night Coke -without whores- debugging sessions
3 // 2012-2015 Leopoldo Lomas Flores. Torreon, Coahuila. MEXICO
4 // leopoldolomas [at] gmail
5 // www.rioengine.com
6 // www.leopoldolomas.info
7 // "You have a problem, you face it like a man."
8 //
9 // This is free and unencumbered software released into the public domain.
10 //
11 // Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
12 // software, either in source code form or as a compiled binary, for any purpose,
13 // commercial or non-commercial, and by any means.
14 //
15 // In jurisdictions that recognize copyright laws, the author or authors of this
16 // software dedicate any and all copyright interest in the software to the public
17 // domain. We make this dedication for the benefit of the public at large and to
18 // the detriment of our heirs and successors. We intend this dedication to be
19 // an overt act of relinquishment in perpetuity of all present and future
20 // rights to this software under copyright law.
21 //
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS
24 // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE
25 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
26 // CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 //--------------------------------------------------------------- @License ends
29 
30 #ifndef RIOENGINE_CENGINE_CBULLETPROPERTIES_H_
31 #define RIOENGINE_CENGINE_CBULLETPROPERTIES_H_
32 
33 #include "cengine/cobject.h"
34 #include "bullet/btbulletdynamicscommon.h"
35 
40 class CBulletProperties : public CObject {
41  Q_OBJECT
42  Q_ENUMS(ShapeTypes)
43  Q_ENUMS(ActivationState)
44 
45 public:
46  enum ShapeTypes { Sphere = 0, Box = 1, Cylinder = 2, Capsule = 3, Cone = 4,
48 
50 
52  CBulletProperties(const CBulletProperties& original_obj);
53  const CBulletProperties& operator=(const CBulletProperties& original_obj);
54  virtual void copyValuesFromObject(const CBulletProperties& original_obj);
55 
56  const bool physicsEnabled() const;
57  void setPhysicsEnabled(bool physics_enabled);
58 
59  const float mass() const;
60  void setMass(float mass);
61 
62  const float restitution() const;
63  void setRestitution(float restitution);
64 
65  const float friction() const;
66  void setFriction(float friction);
67 
68  const btVector3& linearFactor() const;
69  void setLinearFactor(const btVector3& linear_factor);
70 
71  const btVector3& angularFactor() const;
72  void setAngularFactor(const btVector3& angular_factor);
73 
74  const ShapeTypes shapeType() const;
75  void setShapeType(ShapeTypes shape_type);
76 
77  const float height() const;
78  void setHeight(float height);
79 
80  const float radius() const;
81  void setRadius(float radius);
82 
83  const btVector3& size() const;
84  void setSize(const btVector3 &size);
85 
86  const btVector3& planeNormal() const;
87  void setPlaneNormal(const btVector3& plane_normal);
88 
89  const float planeConstant() const;
90  void setPlaneConstant(float plane_constant);
91 
92  const QString& vertices() const;
93  void setVertices(const QString& vertices);
94 
95  btRigidBody* rigidBody() const;
96  void setRigidBody(btRigidBody* rigid_body);
97 
100 
102 
103 private:
104  btRigidBody* m_rigidBody;
105 
106  bool m_physicsEnabled;
107  float m_mass;
108  float m_restitution;
109  float m_friction;
110  float m_height;
111  float m_radius;
112  float m_planeConstant;
113 
114  btVector3 m_linearFactor;
115  btVector3 m_angularFactor;
116  btVector3 m_size;
117  btVector3 m_planeNormal;
118 
119  CBulletProperties::ShapeTypes m_shapeType;
120  CBulletProperties::ActivationState m_activationState;
121 
122  QString m_vertices;
123 };
124 
125 #endif // RIOENGINE_CENGINE_CBULLETPROPERTIES_H_
const float planeConstant() const
void setPhysicsEnabled(bool physics_enabled)
void setFriction(float friction)
void setRadius(float radius)
void setRigidBody(btRigidBody *rigid_body)
const float height() const
const btVector3 & linearFactor() const
const ShapeTypes shapeType() const
const float friction() const
void setLinearFactor(const btVector3 &linear_factor)
virtual void copyValuesFromObject(const CBulletProperties &original_obj)
const QString & vertices() const
void setPlaneNormal(const btVector3 &plane_normal)
const CBulletProperties & operator=(const CBulletProperties &original_obj)
void setHeight(float height)
void setPlaneConstant(float plane_constant)
const float mass() const
void setShapeType(ShapeTypes shape_type)
void setVertices(const QString &vertices)
const float restitution() const
const float radius() const
const bool physicsEnabled() const
const btVector3 & size() const
const btVector3 & angularFactor() const
void setAngularFactor(const btVector3 &angular_factor)
void setSize(const btVector3 &size)
btRigidBody * rigidBody() const
const btVector3 & planeNormal() const
void setActivationState(const CBulletProperties::ActivationState &activationState)
void setMass(float mass)
CBulletProperties::ActivationState activationState() const
void setRestitution(float restitution)