circle_shape.h
1 /*
2 ** ClanLib SDK
3 ** Copyright (c) 1997-2013 The ClanLib Team
4 **
5 ** This software is provided 'as-is', without any express or implied
6 ** warranty. In no event will the authors be held liable for any damages
7 ** arising from the use of this software.
8 **
9 ** Permission is granted to anyone to use this software for any purpose,
10 ** including commercial applications, and to alter it and redistribute it
11 ** freely, subject to the following restrictions:
12 **
13 ** 1. The origin of this software must not be misrepresented; you must not
14 ** claim that you wrote the original software. If you use this software
15 ** in a product, an acknowledgment in the product documentation would be
16 ** appreciated but is not required.
17 ** 2. Altered source versions must be plainly marked as such, and must not be
18 ** misrepresented as being the original software.
19 ** 3. This notice may not be removed or altered from any source distribution.
20 **
21 ** Note: Some of the libraries ClanLib may link to may have additional
22 ** requirements or restrictions.
23 **
24 ** File Author(s):
25 **
26 ** Arkadiusz Kalinowski
27 */
28 
29 #pragma once
30 
31 #include "../../api_physics2d.h"
32 #include "../../../Core/Math/vec2.h"
33 #include "../../Collision/Shapes/shape.h"
34 
35 namespace clan
36 {
39 
40 class PhysicsContext;
41 class PhysicsWorld;
42 class CircleShape_Impl;
43 
47 class CL_API_PHYSICS CircleShape : public Shape
48 {
51 public:
52 
54  CircleShape();
55 
59  CircleShape(const PhysicsWorld &pw);
60 
64  CircleShape(const PhysicsContext &pc);
65 
66  ~CircleShape();
67 
71 public:
72 
74  bool is_null() const { return !impl; }
75 
77  void throw_if_null() const;
78 
82 public:
83 
85  CircleShape &operator =(const CircleShape &copy);
86 
87  //Add us
88  void set_radius(float radius);
89  //b2Shape * Clone (b2BlockAllocator *allocator) const
90  //Implement b2Shape.
91  //int32 GetChildCount () const
92  //bool TestPoint (const b2Transform &transform, const b2Vec2 &p) const
93 
94  //bool RayCast (b2RayCastOutput *output, const b2RayCastInput &input, const b2Transform &transform, int32 childIndex) const
95 
96  //void ComputeAABB (b2AABB *aabb, const b2Transform &transform, int32 childIndex) const
97  //void ComputeMass (b2MassData *massData, float32 density) const
98  //int32 GetSupport (const b2Vec2 &d) const
99 
100  //const b2Vec2 & GetSupportVertex (const b2Vec2 &d) const
101 
102  //int32 GetVertexCount () const
103 
104  //const b2Vec2 & GetVertex (int32 index) const
105  //Add us
106 
110 private:
111 
112  std::shared_ptr<CircleShape_Impl> impl;
113 
115  friend class FixtureDescription;
116 };
117 
118 }
119 
120 /// \}
bool is_null() const
Returns true if this object is invalid.
Definition: circle_shape.h:74
Shape class.
Definition: shape.h:49
Circle Shape class.
Definition: circle_shape.h:47
Top-level world class.
Definition: physics_world.h:52
Definition: physics_context.h:45
FixtureDescription class.
Definition: fixture_description.h:40