PlayRho  2.0.0
An interactive physics engine & library.
WorldContact.hpp File Reference

Declarations of free functions of World for contacts identified by ContactID. More...

#include <map>
#include <optional>
#include <utility>
#include <playrho/BodyID.hpp>
#include <playrho/ContactID.hpp>
#include <playrho/KeyedContactID.hpp>
#include <playrho/NonNegative.hpp>
#include <playrho/Real.hpp>
#include <playrho/Settings.hpp>
#include <playrho/ShapeID.hpp>
#include <playrho/UnitInterval.hpp>
#include <playrho/Units.hpp>
#include <playrho/d2/WorldManifold.hpp>
Include dependency graph for WorldContact.hpp:
This graph shows which files directly or indirectly include this file:

Namespaces

 playrho
 
 playrho::d2
 

Functions

BodyID playrho::d2::GetBodyA (const World &world, ContactID id)
 Gets the body-A of the identified contact if it has one. More...
 
BodyID playrho::d2::GetBodyB (const World &world, ContactID id)
 Gets the body-B of the identified contact if it has one. More...
 
ChildCounter playrho::d2::GetChildIndexA (const World &world, ContactID id)
 Gets the child primitive index A for the identified contact. More...
 
ChildCounter playrho::d2::GetChildIndexB (const World &world, ContactID id)
 Gets the child primitive index B for the identified contact. More...
 
Real playrho::d2::GetDefaultFriction (const World &world, ContactID id)
 Gets the default friction amount for the identified contact. More...
 
Real playrho::d2::GetDefaultRestitution (const World &world, ContactID id)
 Gets the default restitution amount for the identified contact. More...
 
NonNegativeFF< Real > playrho::d2::GetFriction (const World &world, ContactID id)
 Gets the friction used with the identified contact. More...
 
Real playrho::d2::GetRestitution (const World &world, ContactID id)
 Gets the restitution used with the identified contact. More...
 
ShapeID playrho::d2::GetShapeA (const World &world, ContactID id)
 Gets shape A of the identified contact. More...
 
ShapeID playrho::d2::GetShapeB (const World &world, ContactID id)
 Gets shape B of the identified contact. More...
 
LinearVelocity playrho::d2::GetTangentSpeed (const World &world, ContactID id)
 Gets the tangent speed of the identified contact. More...
 
std::optional< UnitIntervalFF< Real > > playrho::d2::GetToi (const World &world, ContactID id)
 Gets the time of impact (TOI) as a fraction or empty value. More...
 
TimestepIters playrho::d2::GetToiCount (const World &world, ContactID id)
 Gets the Time Of Impact (TOI) count. More...
 
ContactCounter playrho::d2::GetTouchingCount (const World &world)
 Gets the touching count for the given world. More...
 
WorldManifold playrho::d2::GetWorldManifold (const World &world, ContactID id)
 Gets the world manifold for the identified contact. More...
 
bool playrho::d2::HasValidToi (const World &world, ContactID id)
 Whether or not the contact has a valid TOI. More...
 
bool playrho::d2::IsAwake (const World &world, ContactID id)
 Gets the awake status of the specified contact. More...
 
bool playrho::d2::IsEnabled (const World &world, ContactID id)
 Gets the enabled status of the identified contact. More...
 
bool playrho::d2::IsTouching (const World &world, ContactID id)
 Is this contact touching? More...
 
auto playrho::d2::MakeTouchingMap (const World &world) -> std::map< std::pair< Contactable, Contactable >, ContactID >
 Makes a map of contacts in the given world that are in the touching state.
 
bool playrho::d2::NeedsFiltering (const World &world, ContactID id)
 Whether or not the contact needs filtering. More...
 
bool playrho::d2::NeedsUpdating (const World &world, ContactID id)
 Whether or not the contact needs updating. More...
 
void playrho::d2::ResetFriction (World &world, ContactID id)
 
void playrho::d2::ResetRestitution (World &world, ContactID id)
 
auto playrho::d2::SameTouching (const World &lhs, const World &rhs) -> bool
 Determines whether the given worlds have the same touching contacts & manifolds.
 
void playrho::d2::SetAwake (World &world, ContactID id)
 Sets awake the bodies of the given contact. More...
 
void playrho::d2::SetEnabled (World &world, ContactID id)
 Sets the enabled status of the identified contact. More...
 
void playrho::d2::SetEnabled (World &world, ContactID id, bool value)
 Convenience function for setting/unsetting the enabled status of the identified contact based on the value parameter. More...
 
void playrho::d2::SetFriction (World &world, ContactID id, NonNegative< Real > friction)
 Sets the friction value for the identified contact. More...
 
void playrho::d2::SetRestitution (World &world, ContactID id, Real restitution)
 Sets the restitution value for the specified contact. More...
 
void playrho::d2::SetTangentSpeed (World &world, ContactID id, LinearVelocity value)
 Sets the desired tangent speed for a conveyor belt behavior. More...
 
void playrho::d2::UnsetEnabled (World &world, ContactID id)
 Unsets the enabled status of the identified contact. More...
 

Detailed Description

Declarations of free functions of World for contacts identified by ContactID.

This is a collection of non-member non-friend functions - also called "free" functions - that are related to contacts 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.

Note
The four basic categories of these functions are "CRUD": create, read, update, and delete.
See also
World, ContactID.
https://en.wikipedia.org/wiki/Create,_read,_update_and_delete.