TDME2  1.9.200
Sphere.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <tdme/tdme.h>
7 #include <tdme/math/Vector3.h>
8 
12 
13 /**
14  * Sphere physics primitive
15  * @author Andreas Drewke
16  */
18  : public BoundingVolume
19 {
20 private:
21  float radius;
22 
23  // overridden methods
24  void destroyCollisionShape() override;
25  void createCollisionShape(World* world) override;
26 
27 public:
28  // forbid class copy
30 
31  /**
32  * Public constructor
33  */
34  Sphere();
35 
36  /**
37  * Public constructor
38  * @param center center
39  * @param radius radius
40  * @param scale scale
41  */
42  Sphere(const Vector3& center, float radius, const Vector3& scale = Vector3(1.0f, 1.0f, 1.0f));
43 
44  /**
45  * Public destructor
46  */
47  ~Sphere();
48 
49  /**
50  * @return float radius
51  */
52  float getRadius() const;
53 
54  // overrides
55  void setScale(const Vector3& scale) override;
56  BoundingVolume* clone() const override;
57 
58 };
Dynamic physics world class.
Definition: World.h:38
Sphere physics primitive.
Definition: Sphere.h:19
Sphere()
Public constructor.
Definition: Sphere.cpp:19
void destroyCollisionShape() override
Destroy collision shape.
Definition: Sphere.cpp:49
void setScale(const Vector3 &scale) override
Set local scale.
Definition: Sphere.cpp:40
~Sphere()
Public destructor.
Definition: Sphere.cpp:31
void createCollisionShape(World *world) override
Create collision shap.
Definition: Sphere.cpp:56
BoundingVolume * clone() const override
Clones this bounding volume.
Definition: Sphere.cpp:68
Vector3 class representing vector3 mathematical structure and operations with x, y,...
Definition: Vector3.h:20
#define FORBID_CLASS_COPY(CLASS)
Definition: tdme.h:6