Declarations of free functions of World for shapes identified by ShapeID
.
More...
#include <playrho/BodyID.hpp>
#include <playrho/NonNegative.hpp>
#include <playrho/Real.hpp>
#include <playrho/Settings.hpp>
#include <playrho/ShapeID.hpp>
#include <playrho/Span.hpp>
#include <playrho/TypeInfo.hpp>
#include <playrho/Units.hpp>
#include <playrho/Vector2.hpp>
#include <playrho/d2/MassData.hpp>
#include <playrho/d2/UnitVec.hpp>
Namespaces | |
playrho | |
playrho::d2 | |
Functions | |
MassData | playrho::d2::ComputeMassData (const World &world, const Span< const ShapeID > &ids) |
Computes the mass data total of the identified shapes. More... | |
ShapeCounter | playrho::d2::GetAssociationCount (const World &world) |
Gets the count of body-shape associations in the given world. More... | |
NonNegativeFF< Real > | playrho::d2::GetDefaultFriction (const Shape &a, const Shape &b) |
Gets the default friction amount for the given shapes. | |
Real | playrho::d2::GetDefaultRestitution (const Shape &a, const Shape &b) |
Gets the default restitution amount for the given shapes. | |
NonNegative< AreaDensity > | playrho::d2::GetDensity (const World &world, ShapeID id) |
Gets the density of this shape. More... | |
Filter | playrho::d2::GetFilterData (const World &world, ShapeID id) |
Gets the filter data for the identified shape. More... | |
NonNegativeFF< Real > | playrho::d2::GetFriction (const World &world, ShapeID id) |
Gets the coefficient of friction of the specified shape. More... | |
MassData | playrho::d2::GetMassData (const World &world, ShapeID id) |
Gets the mass data for the identified shape in the given world. More... | |
Real | playrho::d2::GetRestitution (const World &world, ShapeID id) |
Gets the coefficient of restitution of the specified shape. More... | |
TypeID | playrho::d2::GetType (const World &world, ShapeID id) |
Gets the type of the shape. More... | |
ShapeCounter | playrho::d2::GetUsedShapesCount (const World &world) noexcept |
Gets the count of uniquely identified shapes that are in use - i.e. that are attached to bodies. More... | |
bool | playrho::d2::IsSensor (const World &world, ShapeID id) |
Is the specified shape a sensor (non-solid)? More... | |
void | playrho::d2::Rotate (World &world, ShapeID id, const UnitVec &value) |
Rotates all of the given shape's vertices by the given amount. More... | |
void | playrho::d2::Scale (World &world, ShapeID id, const Vec2 &value) |
Scales all of the given shape's vertices by the given amount. More... | |
void | playrho::d2::SetDensity (World &world, ShapeID id, NonNegative< AreaDensity > value) |
Sets the density of this shape. More... | |
void | playrho::d2::SetFilterData (World &world, ShapeID id, const Filter &filter) |
Convenience function for setting the contact filtering data. More... | |
void | playrho::d2::SetFriction (World &world, ShapeID id, NonNegative< Real > value) |
Convenience function for setting the coefficient of friction of the specified shape. More... | |
void | playrho::d2::SetRestitution (World &world, ShapeID id, Real value) |
Sets the coefficient of restitution of the specified shape. More... | |
void | playrho::d2::SetSensor (World &world, ShapeID id, bool value) |
Convenience function for setting whether the shape is a sensor or not. More... | |
bool | playrho::d2::TestPoint (const World &world, BodyID bodyId, ShapeID shapeId, const Length2 &p) |
Tests a point for containment in a shape associated with a body. More... | |
void | playrho::d2::Translate (World &world, ShapeID id, const Length2 &value) |
Translates all of the given shape's vertices by the given amount. More... | |
Declarations of free functions of World for shapes identified by ShapeID
.
This is a collection of non-member non-friend functions - also called "free" functions - that are related to shapes within an instance of a World
. Many are just "wrappers" to similarly named member functions but some are additional functionality built on those member functions. A benefit to using free functions that are now just wrappers, is that of helping to isolate your code from future changes that might occur to the underlying World
member functions. Free functions in this sense are "cheap" abstractions. While using these incurs extra run-time overhead when compiled without any compiler optimizations enabled, enabling optimizations should entirely eliminate that overhead.