fixture_description.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 namespace clan
32 {
35 
36 class FixtureDescription_Impl;
37 class Shape;
38 
40 class CL_API_PHYSICS FixtureDescription
41 {
44 public:
47 
52 
57 
60 
61  virtual ~FixtureDescription();
62 
66 public:
67 
69  bool is_null() const { return !impl; }
70 
72  void throw_if_null() const;
73 
77 public:
78 
80  void set_shape(const Shape &shape);
81 
83  void set_friction(const float friction);
84 
86  void set_restitution(const float restitution);
87 
89  void set_density(const float density);
90 
91  void set_as_sensor(const bool value = true);
92 
94  void set_filter(); //Add me.
95 
96  FixtureDescription &operator =(const FixtureDescription &copy);
97 
101 private:
102 
103  std::shared_ptr<FixtureDescription_Impl> impl;
105  friend class Fixture;
106  friend class Fixture_Impl; // Think this over
107  friend class Body;
108 };
109 
110 }
111 
112 /// \}
bool is_null() const
Returns true if this object is invalid.
Definition: fixture_description.h:69
Shape class.
Definition: shape.h:49
Top-level world class.
Definition: physics_world.h:52
Body class.
Definition: body.h:52
Definition: physics_context.h:45
Fixture class.
Definition: fixture.h:48
FixtureDescription class.
Definition: fixture_description.h:40