A potential contact between the children of two body associated shapes. More...
#include <playrho/Contact.hpp>
Public Types | |
using | substep_type = TimestepIters |
Substep type. | |
Public Member Functions | |
constexpr | Contact () noexcept=default |
Default constructor. | |
constexpr | Contact (const Contactable &a, const Contactable &b) noexcept |
Initializing constructor. More... | |
constexpr void | FlagForFiltering () noexcept |
Flags the contact for filtering. More... | |
constexpr void | FlagForUpdating () noexcept |
Flags the contact for updating. More... | |
constexpr const Contactable & | GetContactableA () const noexcept |
Gets contactable A. | |
constexpr const Contactable & | GetContactableB () const noexcept |
Gets contactable B. | |
constexpr NonNegativeFF< Real > | GetFriction () const noexcept |
Gets the coefficient of friction. More... | |
constexpr Real | GetRestitution () const noexcept |
Gets the restitution. | |
constexpr LinearVelocity | GetTangentSpeed () const noexcept |
Gets the desired tangent speed. | |
constexpr std::optional< UnitIntervalFF< Real > > | GetToi () const noexcept |
Gets the time of impact (TOI) as a fraction. More... | |
constexpr substep_type | GetToiCount () const noexcept |
Gets the time of impact count. More... | |
constexpr bool | HasValidToi () const noexcept |
Gets whether a TOI is set. More... | |
constexpr void | IncrementToiCount () noexcept |
Increments the TOI count. More... | |
constexpr bool | IsDestroyed () const noexcept |
Whether or not this contact was destroyed. More... | |
constexpr bool | IsEnabled () const noexcept |
Has this contact been disabled? | |
constexpr bool | IsImpenetrable () const noexcept |
Whether or not this contact is "impenetrable". More... | |
constexpr bool | IsSensor () const noexcept |
Whether or not this contact is a "sensor". More... | |
constexpr bool | IsTouching () const noexcept |
Is this contact touching? More... | |
constexpr bool | NeedsFiltering () const noexcept |
Whether or not the contact needs filtering. | |
constexpr bool | NeedsUpdating () const noexcept |
Whether or not the contact needs updating. | |
constexpr void | SetDestroyed () noexcept |
Sets the destroyed property of this contact. More... | |
constexpr void | SetEnabled () noexcept |
Enables this contact. More... | |
constexpr void | SetFriction (NonNegative< Real > friction) noexcept |
Sets the friction value for this contact. More... | |
constexpr void | SetImpenetrable () noexcept |
Sets the impenetrability of this contact. More... | |
constexpr void | SetRestitution (Real restitution) noexcept |
Sets the restitution. More... | |
constexpr void | SetSensor () noexcept |
Sets the sensor state of this contact. More... | |
constexpr void | SetTangentSpeed (LinearVelocity speed) noexcept |
Sets the desired tangent speed for a conveyor belt behavior. More... | |
constexpr void | SetToi (const std::optional< UnitIntervalFF< Real >> &toi) noexcept |
Sets the time of impact (TOI). More... | |
constexpr void | SetToiCount (substep_type value) noexcept |
Sets the TOI count to the given value. More... | |
constexpr void | SetTouching () noexcept |
Sets the touching flag state. More... | |
constexpr void | UnflagForFiltering () noexcept |
Unflags this contact for filtering. More... | |
constexpr void | UnflagForUpdating () noexcept |
Unflags this contact for updating. More... | |
constexpr void | UnsetDestroyed () noexcept |
Unsets the destroyed property of this contact. More... | |
constexpr void | UnsetEnabled () noexcept |
Disables this contact. More... | |
constexpr void | UnsetImpenetrable () noexcept |
Unsets the impenetrability of this contact. More... | |
constexpr void | UnsetSensor () noexcept |
Unsets the sensor state of this contact. More... | |
constexpr void | UnsetTouching () noexcept |
Unsets the touching flag state. More... | |
Static Public Attributes | |
static constexpr auto | DefaultContactable = Contactable{InvalidBodyID, InvalidShapeID, 0} |
Default contactable value. | |
Related Functions | |
(Note that these are not member functions.) | |
constexpr void | FlagForFiltering (Contact &contact) noexcept |
Flags the contact for filtering. More... | |
constexpr void | FlagForUpdating (Contact &contact) noexcept |
Flags the contact for updating. More... | |
constexpr BodyID | GetBodyA (const Contact &contact) noexcept |
Gets the body A ID of the given contact. | |
constexpr BodyID | GetBodyB (const Contact &contact) noexcept |
Gets the body B ID of the given contact. | |
constexpr ChildCounter | GetChildIndexA (const Contact &contact) noexcept |
Gets the child index A of the given contact. | |
constexpr ChildCounter | GetChildIndexB (const Contact &contact) noexcept |
Gets the child index B of the given contact. | |
constexpr auto | GetFriction (const Contact &contact) noexcept |
Gets the coefficient of friction. More... | |
constexpr auto | GetOtherBody (const Contact &c, BodyID bodyID) noexcept |
Gets the other body ID for the contact than the one given. | |
constexpr auto | GetRestitution (const Contact &contact) noexcept |
Gets the coefficient of restitution. More... | |
constexpr ShapeID | GetShapeA (const Contact &contact) noexcept |
Gets the shape A associated with the given contact. | |
constexpr ShapeID | GetShapeB (const Contact &contact) noexcept |
Gets the shape B associated with the given contact. | |
constexpr auto | GetTangentSpeed (const Contact &contact) noexcept |
Gets the desired tangent speed. More... | |
constexpr auto | GetToi (const Contact &contact) noexcept |
Gets the time of impact (TOI) as a fraction. More... | |
constexpr auto | GetToiCount (const Contact &contact) noexcept |
Gets the time of impact count. More... | |
WorldManifold | GetWorldManifold (const World &world, const Contact &contact, const Manifold &manifold) |
constexpr auto | HasValidToi (const Contact &contact) noexcept |
Gets whether a TOI is set. More... | |
constexpr auto | IsDestroyed (const Contact &c) noexcept -> bool |
Whether or not the given contact was destroyed. More... | |
constexpr bool | IsEnabled (const Contact &contact) noexcept |
Gets whether the given contact is enabled or not. | |
constexpr bool | IsFor (const Contact &c, BodyID bodyID, ShapeID shapeID) noexcept |
Is-for convenience function. More... | |
constexpr bool | IsFor (const Contact &c, ShapeID shapeID) noexcept |
Is-for convenience function. More... | |
constexpr bool | IsImpenetrable (const Contact &contact) noexcept |
Whether the given contact is "impenetrable". More... | |
constexpr bool | IsSensor (const Contact &contact) noexcept |
Gets whether the given contact is for sensors or not. | |
constexpr bool | IsTouching (const Contact &contact) noexcept |
Gets whether the given contact is touching or not. | |
constexpr auto | NeedsFiltering (const Contact &contact) noexcept |
Whether or not the contact needs filtering. | |
constexpr auto | NeedsUpdating (const Contact &contact) noexcept |
Whether or not the contact needs updating. | |
constexpr bool | operator!= (const Contact &lhs, const Contact &rhs) noexcept |
Operator not-equals. | |
constexpr bool | operator== (const Contact &lhs, const Contact &rhs) noexcept |
Operator equals. | |
constexpr void | SetDestroyed (Contact &c) noexcept |
Sets the destroyed property of the given contact. More... | |
constexpr void | SetEnabled (Contact &contact) noexcept |
Enables the contact. More... | |
constexpr void | SetFriction (Contact &contact, NonNegative< Real > value) noexcept |
Sets the friction value for the identified contact. More... | |
constexpr void | SetImpenetrable (Contact &contact) noexcept |
Sets the impenetrability of the given contact. More... | |
constexpr void | SetRestitution (Contact &contact, Real value) |
Sets the restitution value for the identified contact. More... | |
constexpr void | SetSensor (Contact &contact) noexcept |
Sets the sensor state of the given contact. More... | |
constexpr void | SetTangentSpeed (Contact &contact, LinearVelocity value) noexcept |
Sets the desired tangent speed for a conveyor belt behavior. More... | |
constexpr void | SetToi (Contact &contact, const std::optional< UnitIntervalFF< Real >> &toi) noexcept |
Sets the time of impact (TOI). More... | |
constexpr void | SetToiCount (Contact &contact, Contact::substep_type value) noexcept |
Sets the TOI count to the given value. More... | |
constexpr void | UnflagForFiltering (Contact &contact) noexcept |
Unflags this contact for filtering. More... | |
constexpr void | UnflagForUpdating (Contact &contact) noexcept |
Unflags this contact for updating. More... | |
constexpr void | UnsetDestroyed (Contact &c) noexcept |
Unsets the destroyed property of the given contact. More... | |
constexpr void | UnsetImpenetrable (Contact &contact) noexcept |
Unsets the impenetrability of the given contact. More... | |
constexpr void | UnsetSensor (Contact &contact) noexcept |
Unsets the sensor state of the given contact. More... | |
A potential contact between the children of two body associated shapes.
The class manages contact between two shapes. A contact exists for each overlapping AABB in the broad-phase (except if filtered). Therefore a contact object may exist that has no actual contact points.
|
constexprnoexcept |
Initializing constructor.
a | The "a" contactable value. |
b | The "b" contactable value. |
a
or b
is not the value of DefaultContactable
then: IsEnabled()
and NeedsUpdating()
return true, else they return false.
|
constexprnoexcept |
Flags the contact for filtering.
NeedsFiltering()
returns true.
|
constexprnoexcept |
|
constexprnoexcept |
Gets the coefficient of friction.
Gets combined friction of two shapes associated with this.
|
constexprnoexcept |
Gets the time of impact (TOI) as a fraction.
|
constexprnoexcept |
Gets the time of impact count.
|
constexprnoexcept |
Gets whether a TOI is set.
Referenced by GetToi().
|
constexprnoexcept |
Increments the TOI count.
GetToiCount()
is less than numeric_limits<substep_type>::max()
. GetToiCount()
returns one more than before.
|
constexprnoexcept |
Whether or not this contact was destroyed.
|
constexprnoexcept |
Whether or not this contact is "impenetrable".
|
constexprnoexcept |
Whether or not this contact is a "sensor".
|
constexprnoexcept |
Is this contact touching?
Touching is defined as either:
|
constexprnoexcept |
Sets the destroyed property of this contact.
|
constexprnoexcept |
|
constexprnoexcept |
Sets the friction value for this contact.
Override the default friction mixture.
friction | Co-efficient of friction value of zero or greater. |
GetFriction()
returns the value set.
|
constexprnoexcept |
Sets the impenetrability of this contact.
IsImpenetrable()
returns true.
|
constexprnoexcept |
Sets the restitution.
This override the default restitution mixture.
GetRestitution()
returns the value set. Referenced by SetRestitution().
|
constexprnoexcept |
Sets the sensor state of this contact.
IsSensor()
returns true.
|
constexprnoexcept |
Sets the desired tangent speed for a conveyor belt behavior.
GetTangentSpeed()
returns the value set.
|
constexprnoexcept |
Sets the time of impact (TOI).
toi | Time of impact as a fraction between 0 and 1 where 1 indicates no actual impact in the current time slot, or empty. |
GetToi()
returns the value set and HasValidToi()
returns toi.has_value()
.
|
constexprnoexcept |
Sets the TOI count to the given value.
GetToiCount()
returns the value set.
|
constexprnoexcept |
Sets the touching flag state.
IsTouching()
returns true.
|
constexprnoexcept |
Unflags this contact for filtering.
NeedsFiltering()
returns false.
|
constexprnoexcept |
Unflags this contact for updating.
NeedsUpdating()
returns false.
|
constexprnoexcept |
Unsets the destroyed property of this contact.
|
constexprnoexcept |
|
constexprnoexcept |
Unsets the impenetrability of this contact.
IsImpenetrable()
returns false.
|
constexprnoexcept |
|
constexprnoexcept |
|
related |
Flags the contact for filtering.
NeedsFiltering(contact)
returns true.
|
related |
Flags the contact for updating.
NeedsUpdating(contact)
returns true.
|
related |
Gets the coefficient of friction.
|
related |
Gets the coefficient of restitution.
|
related |
Gets the desired tangent speed.
|
related |
Gets the time of impact (TOI) as a fraction.
|
related |
Gets the time of impact count.
|
related |
Gets the world manifold for the given data.
GetWorldManifold(const Manifold&, const Transformation&, const Real, const Transformation& xfB, const Real)
function.world | World that the result is to be relative to. |
contact | Contact to return a world manifold for. |
manifold | The manifold to covert to a world manifold. |
|
related |
Gets whether a TOI is set.
|
related |
Whether or not the given contact was destroyed.
Is-for convenience function.
Is-for convenience function.
|
related |
Whether the given contact is "impenetrable".
|
related |
Sets the destroyed property of the given contact.
|
related |
Enables the contact.
IsEnabled(contact)
returns true.
|
related |
Sets the friction value for the identified contact.
Overrides the default friction mixture.
contact | The contact whose friction should be set. |
value | Co-efficient of friction value of zero or greater. |
friction
must be greater-than or equal-to zero. GetFriction(contact)
returns the value set.
|
related |
Sets the impenetrability of the given contact.
IsImpenetrable(contact)
returns true. Sets the restitution value for the identified contact.
This override the default restitution mixture.
GetRestitution(contact)
returns the value set.
|
related |
Sets the sensor state of the given contact.
IsSensor(contact)
returns true.
|
related |
Sets the desired tangent speed for a conveyor belt behavior.
GetTangentSpeed(contact)
returns the value set.
|
related |
Sets the time of impact (TOI).
contact | The contact to update. |
toi | Optional time of impact as a fraction between 0 and 1 where 1 indicates no actual impact in the current time slot. |
HasValidToi(contact)
returns toi.has_value()
. GetToi(const Contact&)
returns the value set.
|
related |
Sets the TOI count to the given value.
GetToiCount(contact)
returns value
.
|
related |
Unflags this contact for filtering.
NeedsFiltering(contact)
returns false.
|
related |
Unflags this contact for updating.
NeedsUpdating(contact)
returns false.
|
related |
Unsets the destroyed property of the given contact.
|
related |
Unsets the impenetrability of the given contact.
IsImpenetrable(contact)
returns false.
|
related |
Unsets the sensor state of the given contact.
IsSensor(contact)
returns false.