physics_debug_draw.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 
30 #pragma once
31 
32 #include "../api_physics2d.h"
33 #include <memory>
34 
35 namespace clan
36 {
39 
40 class Canvas;
41 class PhysicsWorld;
42 class PhysicsDebugDraw_Impl;
43 
46 {
48  f_shape = 0x0001,
49 
51  f_joint = 0x0002,
52 
54  f_aabb = 0x0004,
55 
57  f_pair = 0x0008,
58 
61 
62 };
63 
65 class CL_API_PHYSICS PhysicsDebugDraw
66 {
69 public:
72 
76  PhysicsDebugDraw(const PhysicsWorld &pw);
77 
79 
83 public:
84 
86  bool is_null() const { return !impl; }
87 
89  void throw_if_null() const;
90 
92  unsigned int get_flags() const;
93 
97 public:
98 
100  void draw(Canvas &canvas);
101 
103  void set_flags(unsigned int flags);
104 
108 
109 private:
110  std::shared_ptr<PhysicsDebugDraw_Impl> impl;
111 
113 
114 };
115 
116 }
117 
Draw axis aligned bonding boxes flag.
Definition: physics_debug_draw.h:54
2D Graphics Canvas
Definition: canvas.h:70
PhysicsDebugDraw class.
Definition: physics_debug_draw.h:65
Top-level world class.
Definition: physics_world.h:52
DebugFlags
Physic Debug Draw flags.
Definition: physics_debug_draw.h:45
Draw joint connections flag.
Definition: physics_debug_draw.h:51
Draw shapes flag.
Definition: physics_debug_draw.h:48
Draw center of mass frame flag.
Definition: physics_debug_draw.h:60
bool is_null() const
Returns true if this object is invalid.
Definition: physics_debug_draw.h:86
Draw braod-phase pairs flag.
Definition: physics_debug_draw.h:57