PlayRho  1.1.0
An Interactive Real-Time-Oriented C++ Physics Engine & Library
playrho::d2::FixtureConf Struct Reference

Fixture definition. More...

#include <FixtureConf.hpp>

Collaboration diagram for playrho::d2::FixtureConf:
[legend]

Public Member Functions

FixtureConf & UseShape (Shape value) noexcept
 Uses the given value for the shape member variable.
 
template<typename T , typename Tp = std::decay_t<T>, typename = std::enable_if_t<!std::is_same<Tp, Shape>::value && std::is_copy_constructible<Tp>::value>>
FixtureConf & UseShape (T &&value) noexcept
 Uses the given value for the configuration of the shape member variable. More...
 
FixtureConf & UseBody (BodyID value) noexcept
 Uses the given value for the body member variable.
 
FixtureConf & UseIsSensor (bool value) noexcept
 Uses the given sensor state value.
 
FixtureConf & UseFilter (Filter value) noexcept
 Uses the given filter value.
 

Public Attributes

Shape shape
 Shape to give the fixture.
 
Filter filter
 Contact filtering data.
 
BodyID body = InvalidBodyID
 Identifier of body to associate the fixture with.
 
bool isSensor = false
 A sensor shape collects contact information but never generates a collision response.
 

Related Functions

(Note that these are not member functions.)

bool operator== (const FixtureConf &lhs, const FixtureConf &rhs)
 Operator equals.
 
bool operator!= (const FixtureConf &lhs, const FixtureConf &rhs)
 Operator not-equals.
 
BodyID GetBody (const FixtureConf &conf) noexcept
 Gets the body of the given configuration.
 
const Shape & GetShape (const FixtureConf &conf) noexcept
 Gets the shape of the given configuration.
 
NonNegative< AreaDensity > GetDensity (const FixtureConf &conf) noexcept
 Gets the density of the given configuration.
 
Real GetFriction (const FixtureConf &conf) noexcept
 Gets the friction of the given configuration.
 
Real GetRestitution (const FixtureConf &conf) noexcept
 Gets the restitution of the given configuration.
 
bool IsSensor (const FixtureConf &conf) noexcept
 Gets whether or not the given configuration is a sensor.
 
void SetSensor (FixtureConf &conf, bool value) noexcept
 Sets whether or not the given configuration is a sensor.
 
Filter GetFilterData (const FixtureConf &conf) noexcept
 Gets the filter-data of the given configuration.
 
void SetFilterData (FixtureConf &conf, Filter value) noexcept
 Sets the filter-data of the given configuration.
 
bool ShouldCollide (const FixtureConf &fixtureA, const FixtureConf &fixtureB) noexcept
 Whether contact calculations should be performed between the two fixtures. More...
 
Real GetDefaultFriction (const FixtureConf &fixtureA, const FixtureConf &fixtureB)
 Gets the default friction amount for the given fixtures.
 
Real GetDefaultRestitution (const FixtureConf &fixtureA, const FixtureConf &fixtureB)
 Gets the default restitution amount for the given fixtures.
 

Detailed Description

Fixture definition.

A fixture is used to attach a shape to a body for collision detection. A fixture inherits its transform from its body. Fixtures hold additional non-geometric data such as collision filters, etc.

See also
World::CreateFixture, World::GetFixture, World::SetFixture, World::Destroy.
Examples
HelloWorld.cpp, World.cpp, WorldBody.cpp, and WorldFixture.cpp.

Member Function Documentation

◆ UseShape()

template<typename T , typename Tp = std::decay_t<T>, typename = std::enable_if_t<!std::is_same<Tp, Shape>::value && std::is_copy_constructible<Tp>::value>>
FixtureConf& playrho::d2::FixtureConf::UseShape ( T &&  value)
inlinenoexcept

Uses the given value for the configuration of the shape member variable.

This is a convenience function for allowing limited implicit conversions to shapes.

Friends And Related Function Documentation

◆ ShouldCollide()

bool ShouldCollide ( const FixtureConf &  fixtureA,
const FixtureConf &  fixtureB 
)
related

Whether contact calculations should be performed between the two fixtures.

Returns
true if contact calculations should be performed between these two fixtures; false otherwise.

The documentation for this struct was generated from the following file: