PlayRho
1.1.0
An Interactive Real-Time-Oriented C++ Physics Engine & Library
|
|
- Member playrho::ArrayAllocator< T >::Free (size_type index)
- Consider having this function check if given index already freed.
- Member playrho::CheckedValue< ValueType, CheckerType >::CheckedValue (value_type value) noexcept(noexcept(checker_type{}(value)))
- Consider marking this function "explicit".
- Member playrho::CheckedValue< ValueType, CheckerType >::operator value_type () const noexcept
- Consider marking this function "explicit".
- Member playrho::d2::Body::m_sweep
- Consider refactoring this data out of this class and into the world implementation.
- Member playrho::d2::World::GetBodiesForProxies () const noexcept
- Remove this function from this class - access from implementation instead.
- Member playrho::d2::WorldImpl::m_bodyFixtures
- Consider eliminating this variable since calling
GetFixtures()
isn't done within the World::Step
except by World::Synchronize
which may be replacable with iterating over the entire fixture array.
constexpr Momentum2 GetContactImpulses(size_type index) const noexcept
Gets the contact impulses for the given index.
Definition: Manifold.hpp:344
Length2 rB
Relative B position. 8-bytes (with 4-byte Real).
Definition: DistanceJointConf.hpp:119
UnitVec localYAxisA
The local Y translation axis in body-A.
Definition: WheelJointConf.hpp:112
const Shape & GetShape(const FixtureConf &conf) noexcept
Gets the shape of the given configuration.
Definition: FixtureConf.hpp:126
reverse_iterator rend() noexcept
Gets a reverse "end" iterator.
Definition: Vector.hpp:128
LinearVelocity2 GetLinearVelocityFromWorldPoint(const Body &body, const Length2 worldPoint) noexcept
Gets the linear velocity from a world point attached to this body.
Definition: Body.hpp:1255
const DistanceProxy & proxyB
Distance proxy B.
Definition: SeparationScenario.hpp:53
void UnsetEnabled(Body &body) noexcept
Unsets the enabled state.
Definition: Body.hpp:787
Function object for performing lexicographical less-than comparisons of containers.
Definition: Templates.hpp:278
constexpr auto GetPointA() const noexcept
Gets point A (in world coordinates).
Definition: SimplexEdge.hpp:54
void SetAcceleration(Body &body, Acceleration value) noexcept
Sets the accelerations on the given body.
Definition: Body.hpp:1032
IndexPair3 indices
Indices.
Definition: Simplex.hpp:89
constexpr WheelJointConf()=default
Default constructor.
void SetFixture(FixtureID id, const FixtureConf &value)
Sets the identified fixture's state.
Definition: WorldImpl.cpp:2271
static constexpr value_type GetFromSignedInt(T val) noexcept
Gets the value from a signed integral value.
Definition: Fixed.hpp:127
constexpr bool operator()(const T &lhs, const T &rhs) const
Checks whether the first argument is lexicographically less-than the second argument.
Definition: Templates.hpp:281
constexpr auto Mega
Mega- (1 x 10^6).
Definition: RealConstants.hpp:85
static constexpr auto FractionBits
Fraction bits.
Definition: Fixed.hpp:56
Trait class for checking if type is a matrix type.
Definition: Matrix.hpp:56
constexpr GearJointConf()=default
Default constructor.
Length2 ComputeCentroid(const Span< const Length2 > &vertices)
Computes the centroid of a counter-clockwise array of 3 or more vertices.
Definition: Math.cpp:44
Mass22 GetNormalMass() const noexcept
Gets the normal mass.
Definition: VelocityConstraint.hpp:310
constexpr size_type max_size() const noexcept
Gets the max size.
Definition: UnitVec.hpp:161
value_type * pointer
Pointer type.
Definition: Vector.hpp:66
constexpr auto & UseMaxForce(NonNegative< Force > v) noexcept
Use value for max force.
Definition: TargetJointConf.hpp:80
PROPAGATE_CONST_CONSTEXPR void swap(propagate_const< T > &pt, propagate_const< T > &pu) noexcept(noexcept(swap(std::declval< T & >(), std::declval< T & >())))
Support for swap operation.
Definition: propagate_const.hpp:395
static constexpr Length2 DefaultLocalAnchorA
Default local anchor A.
Definition: PulleyJointConf.hpp:66
void Reserve(Size value)
Reserves at least as much capacity as requested.
Definition: DynamicTree.cpp:452
Size CreateLeaf(const AABB &aabb, const LeafData &data)
Creates a new leaf node.
Definition: DynamicTree.cpp:539
constexpr Interval(const value_type &a, const value_type &b) noexcept
Initializing constructor.
Definition: Interval.hpp:93
const_reverse_iterator rend() const noexcept
Gets a reverse "end" iterator.
Definition: UnitVec.hpp:201
Angle lowerAngle
Lower angle for the joint limit.
Definition: RevoluteJointConf.hpp:140
constexpr Height GetHeight() const noexcept
Gets the node "height".
Definition: DynamicTree.hpp:447
bool ValidateStructure(const DynamicTree &tree, DynamicTree::Size index) noexcept
Validates the structure of the given tree from the given index.
Definition: DynamicTree.cpp:804
std::size_t size_type
Size type.
Definition: AllocatedArray.hpp:36
constexpr auto GetMaxForce(const FrictionJointConf &object) noexcept
Free function for getting the max force value of the given configuration.
Definition: FrictionJointConf.hpp:177
friend const void * GetData(const Shape &shape) noexcept
Gets a pointer to the underlying data.
Definition: Shape.hpp:324
ChainShapeConf GetChainShapeConf(Length2 dimensions)
Gets an enclosing chain shape configuration for an axis aligned rectangle of the given dimensions (wi...
Definition: ChainShapeConf.cpp:158
RotInertia GetRotInertia(const Body &body) noexcept
Gets the rotational inertia of the body.
Definition: Body.hpp:1130
Regular-phase per-step statistics.
Definition: StepStats.hpp:45
constexpr UnitVec GetDirection(const Transformation &value) noexcept
Gets the directional information from the given transformation.
Definition: Transformation.hpp:75
constexpr auto & UseAnchor(Length2 v) noexcept
Use value for the "anchor" (in coordinates local to "body B").
Definition: TargetJointConf.hpp:73
constexpr auto & UseDampingRatio(Real v) noexcept
Uses the given damping ratio.
Definition: DistanceJointConf.hpp:83
static constexpr auto GetLinearSlop() noexcept
Gets the linear slop.
Definition: Settings.hpp:70
Time minStillTimeToSleep
Minimum still time to sleep.
Definition: StepConf.hpp:65
bool blockSolve
Whether to block solve.
Definition: VelocityConstraint.hpp:55
MassData GetMassData(Length r, NonNegative< AreaDensity > density, Length2 location)
Computes the mass data for a circular shape.
Definition: MassData.cpp:31
std::array< IndexPair, MaxSimplexEdges > IndexPair3
Array of three index-pair elements.
Definition: IndexPair.hpp:47
Length2 GetVertexB() const noexcept
Gets vertex B.
Definition: EdgeShapeConf.hpp:78
Frequency GetFrequency(const Joint &object)
Gets the frequency of the joint if it has this property.
Definition: Joint.cpp:407
@ Static
Static body type.
Real GetAlpha0() const noexcept
Gets the alpha 0 for this sweep.
Definition: Sweep.hpp:76
Length2 localAnchorA
Local anchor A.
Definition: GearJointConf.hpp:85
bits_type categoryBits
The collision category bits.
Definition: Filter.hpp:46
constexpr UnitVec GetXAxis(UnitVec rot) noexcept
Gets the "X-axis".
Definition: UnitVec.hpp:306
bool IsLocked(const WorldImpl &world) noexcept
Is the world locked (in the middle of a time step).
Definition: WorldImplMisc.cpp:117
@ e_accelerationFlag
Acceleration flag.
Definition: Body.hpp:105
std::vector< UnitVec > normals
Normals of edges.
Definition: MultiShapeConf.hpp:92
constexpr auto RadianPerSquareSecond
Radian per square second unit of angular acceleration.
Definition: Units.hpp:394
constexpr size_type size() const noexcept
Gets the size.
Definition: Vector.hpp:100
Length sAx
Solver A x location.
Definition: WheelJointConf.hpp:136
TimestepIters iteration_type
Step iterations type.
Definition: StepConf.hpp:46
constexpr auto MeterPerSquareSecond
Meter per square second unit of linear acceleration.
Definition: Units.hpp:345
friend BodyID GetBodyB(const Joint &object) noexcept
Gets the second body attached to this joint.
Definition: Joint.hpp:288
Angle angle
The world angle of the body.
Definition: BodyConf.hpp:115
BodyID CreateBody(World &world, const BodyConf &def)
Creates a rigid body with the given configuration.
Definition: WorldBody.cpp:58
bool IsDestroyed(BodyID id) const noexcept
Gets whether the given identifier is to a body that's been destroyed.
Definition: WorldImpl.cpp:710
PreStepStats::counter_type SynchronizeProxies(const StepConf &conf)
Synchronizes proxies of the bodies for proxies.
Definition: WorldImpl.cpp:2211
std::vector< Length2 > vertices
Array of vertices.
Definition: MultiShapeConf.hpp:86
SimplexEdges::size_type size_type
Size type.
Definition: Simplex.hpp:66
constexpr T GetSize(const Interval< T > &v) noexcept
Gets the size of the given interval.
Definition: Interval.hpp:232
counter_type contactsUpdatedToi
Contacts updated TOI count.
Definition: StepStats.hpp:81
typename std::vector< value_type >::reference reference
Reference type alias.
Definition: ArrayAllocator.hpp:43
constexpr auto Yotta
Yotta- (1 x 10^24).
Definition: RealConstants.hpp:101
void SetTangentImpulses(VelocityConstraint &vc, const Momentum2 impulses)
Sets the tangent impulses of the given velocity constraint.
Definition: VelocityConstraint.hpp:468
constexpr Interval(pair_type pair) noexcept
Internal pair type accepting constructor.
Definition: Interval.hpp:216
ArrayAllocator< Body > m_bodyBuffer
Array of body data both used and freed.
Definition: WorldImpl.hpp:833
ContactCounter GetContactRange() const noexcept
Gets the extent of the currently valid contact range.
Definition: WorldImpl.cpp:629
Unused data of a tree node.
Definition: DynamicTree.hpp:304
friend bool SolveVelocity(Joint &object, std::vector< BodyConstraint > &bodies, const playrho::StepConf &step)
Solves velocity constraint.
Definition: Joint.hpp:310
std::optional< RayCastHit > RayCastOutput
Ray cast output.
Definition: RayCastOutput.hpp:90
constexpr reference UseBodyA(BodyID b) noexcept
Use value for body A setting.
Definition: JointConf.hpp:80
Length2 m_points[MaxManifoldPoints]
Points.
Definition: WorldManifold.hpp:48
Real maxCirclesRatio
Max. circles ratio.
Definition: StepConf.hpp:213
AllocationRecord *const m_entries
Entries.
Definition: StackAllocator.hpp:146
constexpr auto DefaultMaxSubSteps
Default maximum number of sub steps.
Definition: Settings.hpp:188
Position m_position
Position data of body.
Definition: BodyConstraint.hpp:87
Real dampingRatio
Damping ratio.
Definition: DistanceJointConf.hpp:109
constexpr DistanceJointConf()=default
Default constructor.
ManifoldContactListener m_preSolveContactListener
Listener for pre-solving contacts.
Definition: WorldImpl.hpp:875
constexpr BodyConf & UseType(BodyType t) noexcept
Use the given type.
Definition: BodyConf.hpp:166
PLAYRHO_QUANTITY(boost::units::si::length) Length
Length quantity.
Definition: Units.hpp:158
LimitState limitState
Limit state.
Definition: RevoluteJointConf.hpp:158
void SetAngularDamping(NonNegative< Frequency > angularDamping) noexcept
Sets the angular damping of the body.
Definition: Body.hpp:559
bool operator<(const AABB< N > &lhs, const AABB< N > &rhs) noexcept
Less-than operator.
Definition: AABB.hpp:142
BodyID CreateBody(const BodyConf &def=GetDefaultBodyConf())
Creates a rigid body with the given configuration.
Definition: World.cpp:161
const_iterator cbegin() const
Gets the "begin" iterator value for this array.
Definition: AllocatedArray.hpp:159
UnitVec uA
Unit vector A.
Definition: PulleyJointConf.hpp:112
T * AllocArray(std::size_t size)
Allocates memory for an array.
Definition: DynamicMemory.hpp:54
void SetPostSolveContactListener(WorldImpl &world, std::function< void(ContactID, const ContactImpulsesList &, unsigned)> listener) noexcept
Registers a post-solve contact event listener.
Definition: WorldImplMisc.cpp:79
std::vector< KeyedContactPtr > Contacts
Container type for keyed contact identifiers.
Definition: World.hpp:135
Height GetHeight(Size index) const noexcept
Gets the height value for the identified node.
Definition: DynamicTree.hpp:579
constexpr U Secant(T target, U a1, T s1, U a2, T s2) noexcept
Secant method.
Definition: Math.hpp:136
FlagsType m_flags
Flags.
Definition: WorldImpl.hpp:878
SimplexEdges m_simplexEdges
Collection of valid simplex edges.
Definition: Simplex.hpp:149
Length separation
Separation at point or the invalid value.
Definition: WorldManifold.hpp:69
void SetPosition1(const Position value) noexcept
Sets the body sweep's "position 1" value.
Definition: Body.hpp:405
static constexpr UnitVec GetTop() noexcept
Gets the top-ward oriented unit vector.
Definition: UnitVec.hpp:80
BodyID bodyD
Identifier of body D.
Definition: GearJointConf.hpp:76
void AddContactsToIsland(Island &island, BodyStack &stack, const Contacts &contacts, BodyID bodyID)
Adds contacts to the island.
Definition: WorldImpl.cpp:888
constexpr LeafData AsLeaf() const noexcept
Gets the node as a "leaf" value.
Definition: DynamicTree.hpp:490
std::invalid_argument exception_type
Exception type possibly thrown by this checker.
Definition: Finite.hpp:37
static constexpr auto GetMaxVertexRadius() noexcept
Gets the max vertex radius.
Definition: Settings.hpp:57
@ e_newFixture
New fixture.
Definition: WorldImpl.hpp:525
Length a2
Location A-2.
Definition: PrismaticJointConf.hpp:160
BlockAllocator * allocator
Allocator pointer.
Definition: BlockAllocator.hpp:147
const_reverse_iterator rbegin() const noexcept
Gets a reverse "begin" iterator.
Definition: Vector.hpp:143
iteration_type regPositionIterations
Regular position iterations.
Definition: StepConf.hpp:228
RayCastOpcode
Ray cast opcode enumeration.
Definition: RayCastOutput.hpp:47
constexpr auto InvalidIndexPair
Invalid index-pair value.
Definition: IndexPair.hpp:39
Momentum impulse
Impulse.
Definition: RopeJointConf.hpp:88
PolygonShapeConf & SetAsBox(Length hx, Length hy) noexcept
Sets the vertices to represent an axis-aligned box centered on the local origin.
Definition: PolygonShapeConf.cpp:42
typename underlying_type< T >::type underlying_type_t
Underlying-type convenience alias.
Definition: IndexingNamedType.hpp:178
const value_type * const_iterator
Constant iterator type.
Definition: UnitVec.hpp:65
const Contact & GetContact(ContactID id) const
Gets the identified contact.
Definition: WorldImpl.cpp:2646
PLAYRHO_QUANTITY(boost::units::si::torque) Torque
Torque quantity.
Definition: Units.hpp:255
PROPAGATE_CONST_CONSTEXPR element_type * operator->()
Member-of operator support.
Definition: propagate_const.hpp:207
WheelJointConf GetWheelJointConf(const Joint &joint)
Gets the definition data for the given joint.
Definition: WheelJointConf.cpp:73
bool operator()(const ::playrho::propagate_const< T > &pc1, const ::playrho::propagate_const< T > &pc2) const
Equal-to operation functor.
Definition: propagate_const.hpp:429
Real metric
Metric.
Definition: Simplex.hpp:85
std::vector< JointID > Joints
Joints container type.
Definition: WorldImpl.hpp:84
PolygonShapeConf & Transform(Transformation xfm) noexcept
Transforms the vertices by the given transformation.
Definition: PolygonShapeConf.cpp:82
void SetBody(BodyID id, const Body &value)
Sets the state of the identified body.
Definition: World.cpp:171
VertexCounter GetFirstShapeVertexIdx(const detail::SeparationInfo< N > &info) noexcept
Gets first shape vertex index.
Definition: IndexPair.hpp:119
constexpr auto & UseEnableLimit(bool v) noexcept
Uses the given enable limit state value.
Definition: RevoluteJointConf.hpp:76
SizedRange< World::Contacts::const_iterator > GetContacts(BodyID id) const
Gets the container of contacts attached to the identified body.
Definition: World.cpp:191
bool IsSpeedable() const noexcept
Is "speedable".
Definition: Body.hpp:624
const FixtureConf & GetFixture(const WorldImpl &world, FixtureID id)
Gets the identified fixture state.
Definition: WorldImplFixture.cpp:39
@ NullState
point does not exist
Length2 rA
Relative A.
Definition: WeldJointConf.hpp:107
Length2 localAnchorA
Local anchor point relative to body A's origin.
Definition: DistanceJointConf.hpp:91
constexpr auto operator>(const CheckedValue< LhsValueType, LhsCheckerType > &lhs, const CheckedValue< RhsValueType, RhsCheckerType > &rhs) -> decltype(LhsValueType(lhs) > RhsValueType(rhs))
Constrained value greater-than operator.
Definition: CheckedValue.hpp:213
Real displaceMultiplier
Displacement multiplier for directional AABB fattening.
Definition: StepConf.hpp:198
playrho::Real type
Type alias revealing the actual type of the element.
Definition: UnitVec.hpp:416
static constexpr bool IsUnused(Height value) noexcept
Gets whether the given height is the height for an "unused" node.
Definition: DynamicTree.hpp:104
bool operator()(const ::playrho::propagate_const< T > &pc1, const ::playrho::propagate_const< T > &pc2) const
Lesser-than operation functor.
Definition: propagate_const.hpp:485
Length m_separation
Separation.
Definition: PositionSolverManifold.hpp:51
constexpr ContactFeature GetContactFeature(size_type index) const noexcept
Gets the contact feature for the given index.
Definition: Manifold.hpp:335
constexpr Sweep(const Position p, const Length2 lc=Length2{0_m, 0_m})
Initializing constructor.
Definition: Sweep.hpp:60
void NOT_USED(T &&...)
"Not used" annotator.
Definition: Templates.hpp:98
bool IsStepComplete(const WorldImpl &world) noexcept
Whether or not "step" is complete.
Definition: WorldImplMisc.cpp:122
Time m_underActiveTime
Under-active time.
Definition: Body.hpp:511
BodyID bodyA
1st attached body.
Definition: JointConf.hpp:36
constexpr auto Giga
Giga- (1 x 10^9).
Definition: RealConstants.hpp:89
std::invalid_argument exception_type
Exception type possibly thrown by this checker.
Definition: UnitInterval.hpp:36
void SetPreSolveContactListener(ManifoldContactListener listener) noexcept
Register a pre-solve contact event listener.
Definition: WorldImpl.hpp:1024
PROPAGATE_CONST_CONSTEXPR propagate_const & operator=(propagate_const< U > &&pu)
Move assignment operator for compatible propagate_const types.
Definition: propagate_const.hpp:171
Point states.
Definition: Collision.hpp:50
NonNegative< AreaDensity > GetDensity(const Shape &shape) noexcept
Gets the density of the given shape.
Definition: Shape.hpp:304
Non-positive constrained value checker.
Definition: NonPositive.hpp:30
Length GetMinVertexRadius() const noexcept
Gets the minimum vertex radius that shapes in this world can be.
Definition: WorldImpl.hpp:984
std::uint32_t counter_type
Counter type.
Definition: StepStats.hpp:69
UnusedData unused
Unused/free-list specific data.
Definition: DynamicTree.hpp:363
Length2 operator[](std::size_t index) const noexcept
Indexed access.
Definition: VertexSet.hpp:104
Real GetRestitution() const noexcept
Gets the combined restitution of the associated contact.
Definition: VelocityConstraint.hpp:113
constexpr reference UseCollideConnected(bool v) noexcept
Use value for collide connected setting.
Definition: JointConf.hpp:94
FlagGuard(const FlagGuard< T > &value)=delete
Copy constructor is deleted.
Length and vertex counter array of indices.
Definition: IndexPair.hpp:101
constexpr auto MaxBodies
Maximum number of bodies in a world.
Definition: Settings.hpp:212
const value_type & const_reference
Constant reference type.
Definition: ArrayList.hpp:52
Fixed< BT, FB > nextafter(Fixed< BT, FB > from, Fixed< BT, FB > to) noexcept
Next after function for Fixed types.
Definition: FixedMath.hpp:351
bool usedMalloc
Whether malloc was used.
Definition: StackAllocator.hpp:142
Island m_island
Island buffer.
Definition: WorldImpl.hpp:866
constexpr AABB(const Location a, const Location b) noexcept
Initializing constructor for two points.
Definition: AABB.hpp:102
static constexpr playrho::Fixed32 round_error() noexcept
Gets the round error value for the type.
Definition: FixedLimits.hpp:63
constexpr auto SetMaxLength(RopeJointConf &object, Length value) noexcept
Free function for setting the maximum length value of the given configuration.
Definition: RopeJointConf.hpp:172
constexpr size_type GetPointCount() const noexcept
Gets the manifold point count.
Definition: Manifold.hpp:332
Height m_height
Height.
Definition: DynamicTree.hpp:542
friend DistanceProxy GetChild(const Shape &shape, ChildCounter index)
Gets the "child" for the given index.
Definition: Shape.hpp:273
ArrayAllocator< FixtureConf > m_fixtureBuffer
Array of fixture data both used and freed.
Definition: WorldImpl.hpp:844
std::function< void(ContactID, const ContactImpulsesList &, unsigned)> ImpulsesContactListener
Impulses contact listener.
Definition: WorldImpl.hpp:111
constexpr auto operator()(const T &v) -> decltype((v >=static_cast< T >(0) &&v<=static_cast< T >(1)), T(v))
Value checking functor.
Definition: UnitInterval.hpp:48
LinearVelocity GetVelocityBiasAtPoint(size_type index) const noexcept
Gets the velocity bias at the given point.
Definition: VelocityConstraint.hpp:328
std::vector< std::pair< BodyID, JointID > > BodyJoints
Body joints container type.
Definition: WorldImpl.hpp:87
virtual bool GetCollideConnected_() const noexcept=0
Gets whether collision handling should be done for connected bodies.
constexpr bool IsLeaf(const DynamicTree::TreeNode &node) noexcept
Is leaf.
Definition: DynamicTree.hpp:647
auto EraseAll(T &container, const U &value) -> decltype(distance(container.erase(remove(begin(container), end(container), value), end(container)), end(container)))
Convenience template function for erasing specified value from container.
Definition: Templates.hpp:371
Sweep m_sweep
Sweep motion for CCD. 36-bytes.
Definition: Body.hpp:473
Mass22 mass
2-by-2 mass matrix in kilograms.
Definition: TargetJointConf.hpp:129
BodyID GetBodyB() const noexcept
Gets identifier of body B.
Definition: VelocityConstraint.hpp:122
Stack allocator.
Definition: StackAllocator.hpp:35
constexpr Vector< Length, N > GetExtents(const AABB< N > &aabb) noexcept
Gets the extents of the AABB (half-widths).
Definition: AABB.hpp:240
void SetNormalImpulseAtPoint(VelocityConstraint &vc, VelocityConstraint::size_type index, Momentum value)
Sets the normal impulse at the given point of the given velocity constraint.
Definition: VelocityConstraint.hpp:449
char *const m_data
Data.
Definition: StackAllocator.hpp:145
constexpr reference operator[](size_type pos) noexcept
Gets a reference to the requested element.
Definition: Vector.hpp:157
std::vector< FixtureID > Fixtures
Fixtures container type.
Definition: WorldImpl.hpp:90
constexpr BodyConf & UseAngularVelocity(AngularVelocity v) noexcept
Use the given angular velocity.
Definition: BodyConf.hpp:210
std::pair< VertexCounter, VertexCounter > IndexPair
Index pair.
Definition: IndexPair.hpp:36
constexpr AABB< N > & Include(AABB< N > &var, const Vector< Length, N > &value) noexcept
Includes the given location into the given AABB.
Definition: AABB.hpp:270
const value_type * const_pointer
Constant pointer type.
Definition: Vector.hpp:69
SecondMomentOfArea GetPolarMoment(Span< const Length2 > vertices)
Gets the polar moment of the area enclosed by the given vertices.
Definition: Math.cpp:138
void SetBody(BodyID id, const Body &value)
Sets the identified body.
Definition: WorldImpl.cpp:2572
Vector3< InvMass > InvMass3
3-element vector of inverse mass (InvMass) quantities.
Definition: Vector3.hpp:44
size_type m_maxAllocation
Max allocation.
Definition: StackAllocator.hpp:152
VelocityConstraint()=default
Default constructor.
void RotateAboutWorldPoint(World &world, BodyID body, Angle amount, Length2 worldPoint)
Rotates a body a given amount around a point in world coordinates.
Definition: WorldBody.cpp:148
Distance Proxy.
Definition: DistanceProxy.hpp:52
static constexpr UnitVec GetBottomRight() noexcept
Gets the -45 degree unit vector.
Definition: UnitVec.hpp:108
Length2 localAnchorB
Anchor point.
Definition: TargetJointConf.hpp:105
void swap(Joint &other) noexcept
Swap function.
Definition: Joint.hpp:250
friend PROPAGATE_CONST_CONSTEXPR bool operator>=(const propagate_const &pt, const propagate_const< U > &pu)
Greater-than or equal-to operator.
Definition: propagate_const.hpp:300
T * ReallocArray(T *ptr, std::size_t count)
Reallocates memory for an array.
Definition: DynamicMemory.hpp:83
std::remove_const< decltype(MaxManifoldPoints)>::type size_type
Size type.
Definition: Manifold.hpp:69
Length2 GetLocalCenter() const noexcept
Gets the location of the body's center of mass in local coordinates.
Definition: BodyConstraint.hpp:107
2-D unit vector.
Definition: UnitVec.hpp:50
constexpr UnitVec::value_type get< 1 >(UnitVec v) noexcept
Gets element 1 of the given collection.
Definition: UnitVec.hpp:380
constexpr auto Kilogram
Kilogram unit of mass.
Definition: Units.hpp:352
constexpr AABB()=default
Default constructor.
Template for determining if the given type is an equality comparable type.
Definition: Templates.hpp:173
virtual ~Concept()=default
Explicitly declared virtual destructor.
constexpr Mat33 GetSymInverse33(const Mat33 &value) noexcept
Gets the symmetric inverse of this matrix as a 3-by-3.
Definition: Math.hpp:523
auto EraseFirst(T &container, const U &value) -> decltype(container.erase(find(begin(container), end(container), value)) !=end(container))
Convenience template function for erasing first found value from container.
Definition: Templates.hpp:354
friend bool operator!=(const Joint &lhs, const Joint &rhs) noexcept
Inequality operator for joint comparisons.
Definition: Joint.hpp:278
static constexpr NonNegative< Length > GetDefaultVertexRadius() noexcept
Gets the default vertex radius for the MultiShapeConf.
Definition: MultiShapeConf.hpp:114
const_iterator end() const noexcept
Gets an "end" iterator.
Definition: UnitVec.hpp:174
constexpr Transformation Mul(const Transformation &A, const Transformation &B) noexcept
Multiplies a given transformation by another given transformation.
Definition: Math.hpp:860
std::uint8_t TimestepIters
Time step iterations type.
Definition: Settings.hpp:101
bool FindFree(size_type index) const noexcept
Finds whether the given index is in the free list.
Definition: ArrayAllocator.hpp:114
std::remove_const< decltype(DefaultMaxToiIters)>::type toi_iter_type
TOI iteration type.
Definition: TimeOfImpact.hpp:57
void * data
Data.
Definition: StackAllocator.hpp:140
iterator begin() noexcept
Gets a "begin" iterator.
Definition: Vector.hpp:107
UnitVec GetLocalYAxisA(const Joint &object)
Gets the given joint's local Y axis A if its type supports that.
Definition: Joint.cpp:242
UnitVec GetLocalVector(const Body &body, const UnitVec uv) noexcept
Gets a locally oriented unit vector given a world oriented unit vector.
Definition: Body.hpp:1245
Finite< Real > restitution
Restitution (elasticity) of the associated shape.
Definition: ShapeConf.hpp:51
constexpr T ConvertTo() const noexcept
Converts the value to the expressed type.
Definition: Fixed.hpp:237
static constexpr NonNegative< Length > GetDefaultRadius() noexcept
Gets the default radius.
Definition: DiskShapeConf.hpp:44
Positive< Length > m_maxVertexRadius
Maximum vertex radius.
Definition: WorldImpl.hpp:897
Length2 localAnchorB
The local anchor point relative to body B's origin.
Definition: RopeJointConf.hpp:82
std::uint32_t FlagsType
Flags type data type.
Definition: WorldImpl.hpp:519
constexpr VariantData(UnusedData value) noexcept
Initializing constructor.
Definition: DynamicTree.hpp:375
Real correctionFactor
Position correction factor in the range [0,1].
Definition: MotorJointConf.hpp:110
constexpr ToiConf & UseTolerance(NonNegative< Length > value) noexcept
Uses the given tolerance value.
Definition: TimeOfImpact.hpp:121
BodyConstraint & SetPosition(Position value) noexcept
Sets the position of the body.
Definition: BodyConstraint.hpp:122
Block deallocator.
Definition: BlockAllocator.hpp:128
@ e_impenetrableFlag
Impenetrable flag.
Definition: Body.hpp:89
Shape & operator=(Shape &&other)=default
Move assignment operator.
counter_type islandsSolved
Islands solved count.
Definition: StepStats.hpp:78
ChainShapeConf & UseVertexRadius(NonNegative< Length > value) noexcept
Uses the given vertex radius.
Definition: ChainShapeConf.hpp:142
SizedRange< WorldImpl::BodyJoints::const_iterator > GetJoints(BodyID id) const
Definition: WorldImpl.cpp:2310
Weld joint definition.
Definition: WeldJointConf.hpp:51
std::size_t Count(const Island &island, BodyID entry)
Counts the number of occurrences of the given entry in the given island.
Definition: Island.cpp:152
Length2 localAnchorA
Local anchor point relative to body A's origin.
Definition: FrictionJointConf.hpp:77
constexpr auto GetRevPerpendicular(const T vector) noexcept
Gets a vector counter-clockwise (reverse-clockwise) perpendicular to the given vector.
Definition: Math.hpp:552
bool GetSubStepping(const WorldImpl &world) noexcept
Gets whether or not sub-stepping is enabled.
Definition: WorldImplMisc.cpp:127
constexpr bool isfinite() const noexcept
Is finite.
Definition: Fixed.hpp:533
void SetTangentImpulseAtPoint(size_type index, Momentum value)
Sets the tangent impulse at the given point.
Definition: VelocityConstraint.hpp:358
LinearVelocity GetTangentSpeed() const noexcept
Gets the tangent speed of the associated contact.
Definition: VelocityConstraint.hpp:116
Vector2< InvMass > InvMass2
2-element vector of inverse mass (InvMass) quantities.
Definition: Vector2.hpp:61
bool IsFixedRotation() const noexcept
Does this body have fixed rotation?
Definition: Body.hpp:619
UnitVec m_localNormal
Local normal.
Definition: Manifold.hpp:447
constexpr Fixed< BT, FB > trunc(Fixed< BT, FB > arg)
Truncates the given value.
Definition: FixedMath.hpp:343
constexpr Acceleration operator-(const Acceleration &lhs, const Acceleration &rhs)
Subtraction operator.
Definition: Acceleration.hpp:97
void SetJoint(JointID id, const Joint &def)
Sets the identified joint.
Definition: WorldImpl.cpp:715
std::vector< UnitVec > m_normals
Normals of edges.
Definition: PolygonShapeConf.hpp:189
constexpr auto GetAngularError(const MotorJointConf &object) noexcept
Free function for getting the angular error value of the given configuration.
Definition: MotorJointConf.hpp:234
EdgeShapeConf & Set(Length2 vA, Length2 vB) noexcept
Sets both vertices in one call.
Definition: EdgeShapeConf.cpp:33
value_type m_value
Value in internal form.
Definition: Fixed.hpp:575
void SetFrequency(Joint &object, Frequency value)
Sets the frequency of the joint if it has this property.
Definition: Joint.cpp:425
constexpr auto MaxChildCount
Max child count.
Definition: Settings.hpp:91
static constexpr UnitVec GetRight() noexcept
Gets the right-ward oriented unit vector.
Definition: UnitVec.hpp:74
bool IsFixedRotation(const Body &body) noexcept
Does this body have fixed rotation?
Definition: Body.hpp:938
Version numbering scheme.
Definition: Version.hpp:37
void SetType(BodyType value) noexcept
Sets the type of this body.
Definition: Body.cpp:124
detail::IndexingNamedType< ContactCounter, struct ContactIdentifier > ContactID
Contact identifier.
Definition: ContactID.hpp:30
void SetBeginContactListener(ContactListener listener) noexcept
Registers a begin contact event listener.
Definition: World.cpp:56
ElementType * m_stack
Pointer to array of data.
Definition: GrowableStack.hpp:130
bool IsLimitEnabled(const Joint &object)
Gets the specified joint's limit property if it supports one.
Definition: Joint.cpp:534
UnitVec uB
Unit vector B.
Definition: PulleyJointConf.hpp:113
AABB ComputeAABB(const DistanceProxy &proxy, const Transformation &xf) noexcept
Computes the AABB.
Definition: AABB.cpp:36
Length2 m_centroid
Centroid of this shape.
Definition: PolygonShapeConf.hpp:192
BodyConstraint & At(std::vector< BodyConstraint > &container, BodyID key)
Provides referenced access to the identified element of the given container.
Definition: Joint.cpp:57
auto HasValidToi(const Contact &contact) noexcept
Gets whether a TOI is set.
Definition: Contact.hpp:694
auto GetVertexCount() const noexcept
Gets the vertex count.
Definition: DistanceProxy.hpp:149
Position GetNormalized(const Position &val) noexcept
Gets the "normalized" position.
Definition: Math.hpp:807
Length2 rA
Relative A.
Definition: PulleyJointConf.hpp:114
ArrayList< ClipVertex, MaxManifoldPoints > ClipList
Clip list for ClipSegmentToLine.
Definition: Collision.hpp:77
Allocated Array.
Definition: AllocatedArray.hpp:33
constexpr auto operator()(T v) noexcept -> decltype(T(v))
Value checking functor.
Definition: CheckedValue.hpp:51
std::vector< Length2 > m_elements
Elements.
Definition: VertexSet.hpp:110
Length GetSeparation(size_type index) const noexcept
Gets the amount of separation at the given indexed point.
Definition: WorldManifold.hpp:151
bool IsSensor(const Contact &contact) noexcept
Gets whether the given contact is for sensors or not.
Definition: Contact.hpp:665
Momentum toiMinMomentum
TOI-phase minimum momentum.
Definition: StepConf.hpp:118
MassData GetMassData_() const noexcept override
Gets the mass data.
Definition: Shape.hpp:444
virtual const void * GetData_() const noexcept=0
Gets the data for the underlying configuration.
pointer m_array
Pointer to array of data.
Definition: Span.hpp:115
Momentum impulse
Impulse.
Definition: GearJointConf.hpp:104
static constexpr playrho::Fixed< BT, FB > quiet_NaN() noexcept
Gets the quiet NaN value for the type.
Definition: FixedLimits.hpp:89
std::vector< UnitVec > m_normals
Normals.
Definition: ChainShapeConf.hpp:139
constexpr auto InvalidJointID
Invalid joint ID value.
Definition: JointID.hpp:33
PointState state1[MaxManifoldPoints]
State 1.
Definition: Collision.hpp:52
constexpr bool empty() const noexcept
Whether empty.
Definition: UnitVec.hpp:168
Length2 GetLocalAnchorB(const Joint &object)
Get the anchor point on body-B in local coordinates.
Definition: Joint.cpp:96
Length2 GetVertex(VertexCounter index) const
Gets a vertex by index.
Definition: PolygonShapeConf.hpp:134
static constexpr NonNegative< Length > GetDefaultVertexRadius() noexcept
Gets the default vertex radius.
Definition: ChainShapeConf.hpp:53
std::uint32_t counter_type
Counter type.
Definition: StepStats.hpp:47
iterator_type m_begin
Begin iterator.
Definition: Range.hpp:69
UnitVec GetLocalXAxisA(const Joint &object)
Gets the given joint's local X axis A if its type supports that.
Definition: Joint.cpp:230
constexpr UnitVec GetLocalNormal() const noexcept
Gets the local normal for a face-type manifold.
Definition: Manifold.hpp:391
constexpr bool isnan(Fixed< BT, FB > value) noexcept
Gets whether the given value is not-a-number.
Definition: FixedMath.hpp:566
LinearAcceleration2 m_linearAcceleration
Linear acceleration.
Definition: Body.hpp:483
constexpr auto DefaultMaxTranslation
Default maximum translation amount.
Definition: Settings.hpp:165
void SetPreSolveContactListener(WorldImpl &world, std::function< void(ContactID, const Manifold &)> listener) noexcept
Registers a pre-solve contact event listener.
Definition: WorldImplMisc.cpp:73
virtual MassData GetMassData_() const noexcept=0
Gets the mass data.
constexpr size_type size() const noexcept
Gets the size of this range.
Definition: Range.hpp:94
Force2 GetCentripetalForce(const World &world, BodyID id, Length2 axis)
Gets the centripetal force necessary to put the body into an orbit having the given radius.
Definition: WorldBody.cpp:483
auto GetMagnitude(T value)
Gets the magnitude of the given value.
Definition: Math.hpp:329
constexpr auto GetIndexPair() const noexcept
Gets the index pair.
Definition: SimplexEdge.hpp:66
SizedRange< std::vector< std::pair< BodyID, JointID > >::const_iterator > GetJoints(const World &world, BodyID id)
Gets the range of all joints attached to the identified body.
Definition: WorldBody.cpp:407
InvMass m_invMass
Inverse mass of associated body (a non-negative value).
Definition: BodyConstraint.hpp:90
T value_type
Value type.
Definition: Interval.hpp:46
void SetLinearOffset(Joint &object, Length2 value)
Sets the linear offset property of the specified joint if its type has one.
Definition: Joint.cpp:602
constexpr auto SetMaxTorque(FrictionJointConf &object, NonNegative< Torque > value) noexcept
Free function for setting the max force value of the given configuration.
Definition: FrictionJointConf.hpp:198
constexpr Length2 GetPointDelta(const SimplexEdge &sv) noexcept
Gets "w".
Definition: SimplexEdge.hpp:83
constexpr auto DefaultDistanceMultiplier
Default distance multiplier.
Definition: Settings.hpp:146
constexpr SimplexEdge(const SimplexEdge ©)=default
Copy constructor.
bool GetCollideConnected_() const noexcept override
Gets whether collision handling should be done for connected bodies.
Definition: Joint.hpp:439
bool Validate(Span< const Length2 > verts)
Validates the convexity of the given collection of vertices.
Definition: PolygonShapeConf.cpp:166
constexpr TreeNode(Size other=DynamicTree::GetInvalidSize()) noexcept
Initializing constructor.
Definition: DynamicTree.hpp:419
void SetSubStepping(bool flag) noexcept
Enables/disables single stepped continuous physics.
Definition: WorldImpl.hpp:962
std::enable_if_t<!std::is_same_v< DecayedType, Joint >, DecayedType > DecayedTypeIfNotSelf
Decayed type if not same as this class.
Definition: Joint.hpp:151
friend bool operator!=(const Concept &lhs, const Concept &rhs) noexcept
Inequality operator.
Definition: Shape.hpp:413
std::function< void(ContactID)> ContactListener
Contact listener.
Definition: WorldImpl.hpp:105
std::size_t size_type
Size type.
Definition: UnitVec.hpp:56
constexpr Fixed(unsigned int val) noexcept
Initializing constructor.
Definition: Fixed.hpp:184
static constexpr auto WholeBits
Whole value bits.
Definition: Fixed.hpp:59
Joint() noexcept=default
Default constructor.
void clear() noexcept
Clears this instance's free pool and allocated pool.
Definition: ArrayAllocator.hpp:180
Mass GetMass(const Body &body) noexcept
Gets the mass of the body.
Definition: Body.hpp:1082
auto GetMaxAllocation() const noexcept
Gets the max allocation.
Definition: StackAllocator.hpp:94
Length2 rB
Rotated delta of body B's local center from local anchor B.
Definition: RevoluteJointConf.hpp:155
Non-zero constrained value checker.
Definition: NonZero.hpp:30
Momentum GetNormalImpulseAtPoint(const VelocityConstraint &vc, VelocityConstraint::size_type index)
Gets the normal impulse at the given point from the given velocity constraint.
Definition: VelocityConstraint.hpp:423
toi_iter_type maxToiIters
Max TOI iterations.
Definition: StepStats.hpp:100
virtual bool SolveVelocity_(BodyConstraintsMap &bodies, const playrho::StepConf &step)=0
Solves the velocities for this joint.
Template sized range value class.
Definition: Range.hpp:76
auto Atan2(T y, T x)
Computes the arc-tangent of the given y and x values.
Definition: Math.hpp:167
constexpr ConcreteConf & UseRestitution(Finite< Real > value) noexcept
Uses the given restitution.
Definition: ShapeConf.hpp:103
constexpr Position GetPosition(const Position pos0, const Position pos1, const Real beta) noexcept
Gets the position between two positions at a given unit interval.
Definition: Position.hpp:137
void SetInvRotInertia(InvRotInertia v) noexcept
Sets the inverse rotational inertia.
Definition: Body.hpp:228
Bodies m_bodiesForProxies
Bodies for proxies queue.
Definition: WorldImpl.hpp:855
void SetContactImpulses(size_type index, Momentum2 value) noexcept
Sets the contact impulses for the given index.
Definition: Manifold.hpp:353
AABB m_aabb
AABB.
Definition: DynamicTree.hpp:533
DistanceOutput Distance(const DistanceProxy &proxyA, const Transformation &transformA, const DistanceProxy &proxyB, const Transformation &transformB, DistanceConf conf)
Determines the closest points between two shapes.
Definition: Distance.cpp:118
Fixed< BT, FB > hypot(Fixed< BT, FB > x, Fixed< BT, FB > y)
Computes the square root of the sum of the squares.
Definition: FixedMath.hpp:540
constexpr void SetFrequency(DistanceJointConf &object, NonNegative< Frequency > value) noexcept
Free function for setting the frequency value of the given configuration.
Definition: DistanceJointConf.hpp:205
Angle upperAngle
Upper angle for the joint limit.
Definition: RevoluteJointConf.hpp:143
Leaf data of a tree node.
Definition: DynamicTree.hpp:322
AngularAcceleration angular
Angular acceleration.
Definition: Acceleration.hpp:35
PROPAGATE_CONST_CONSTEXPR const element_type * get() const
Gets pointer content.
Definition: propagate_const.hpp:203
constexpr ConstraintSolverConf & UseMaxAngularCorrection(Angle value) noexcept
Uses the given max angular correction.
Definition: ConstraintSolverConf.hpp:63
::playrho::propagate_const< T > second_argument_type
Second argument type.
Definition: propagate_const.hpp:426
dist_sum_type sum_dist_iters
Sum total distance iterations.
Definition: TimeOfImpact.hpp:181
Chunk.
Definition: BlockAllocator.cpp:97
Real resolutionRate
Resolution rate.
Definition: ConstraintSolverConf.hpp:77
constexpr bool IsBranch(const DynamicTree::TreeNode &node) noexcept
Is branch.
Definition: DynamicTree.hpp:655
Length2 localAnchorD
Local anchor D.
Definition: GearJointConf.hpp:88
DistanceConf GetDistanceConf(const ToiConf &conf) noexcept
Gets the distance configuration for the given time of impact configuration.
Definition: Distance.cpp:78
@ e_overlapped
Overlapped.
Definition: TimeOfImpact.hpp:220
void SetStepComplete(bool value) noexcept
Sets the step complete state.
Definition: WorldImpl.hpp:945
constexpr auto InvalidContactIndex
Invalid contact index.
Definition: Settings.hpp:224
IslandStats SolveRegIslandViaGS(const StepConf &conf, const Island &island)
Solves the given island (regularly).
Definition: WorldImpl.cpp:1025
Angle GetAngularUpperLimit(const Joint &object)
Gets the upper joint limit.
Definition: Joint.cpp:515
constexpr CheckedValue() noexcept(noexcept(CheckerType{}()))
Default constructor available for checker types with acceptable nullary functors.
Definition: CheckedValue.hpp:78
ElementType top() const
Accesses the "top" element.
Definition: GrowableStack.hpp:97
bool isSensor
A sensor shape collects contact information but never generates a collision response.
Definition: FixtureConf.hpp:97
bool IsMotorEnabled(const Joint &object)
Gets the specified joint's motor property value if it supports one.
Definition: Joint.cpp:560
constexpr Angle GetRevRotationalAngle(Angle a1, Angle a2) noexcept
Gets the reverse (counter) clockwise rotational angle to go from angle 1 to angle 2.
Definition: Math.hpp:681
void Destroy(BodyID id)
Destroys the given body.
Definition: WorldImpl.cpp:665
SizedRange< World::BodyJoints::const_iterator > GetJoints(BodyID id) const
Gets the range of joints attached to the identified body.
Definition: World.cpp:186
constexpr TreeNode(const TreeNode &other)=default
Copy constructor.
Point elements[MaxManifoldPoints]
Elements.
Definition: Manifold.hpp:424
counter_type islandsFound
Islands found count.
Definition: StepStats.hpp:77
constexpr AABB< N > GetFattenedAABB(AABB< N > aabb, const Length amount)
Gets the fattened AABB result.
Definition: AABB.hpp:333
bool ShouldCollide(const Filter filterA, const Filter filterB) noexcept
Determines whether collision processing should be performed.
Definition: Filter.hpp:80
virtual BodyID GetBodyA_() const noexcept=0
Gets the ID of body-A.
InvMass gamma
Gamma.
Definition: WheelJointConf.hpp:146
std::enable_if_t<!std::is_pointer< T >::value, CheckedValue< T, NonZeroChecker< T > >> NonZero
Non-zero constrained value type.
Definition: NonZero.hpp:48
const_reverse_iterator crbegin() const noexcept
Gets a reverse "begin" iterator.
Definition: UnitVec.hpp:183
void SetAngle(World &world, BodyID body, Angle value)
Sets the body's angular orientation.
Definition: WorldBody.cpp:143
const_iterator cbegin() const noexcept
Gets a "begin" iterator.
Definition: UnitVec.hpp:177
value_type m_elems[2]
Element values.
Definition: UnitVec.hpp:300
bool IsLimitEnabled(const Joint &object)
Gets the specified joint's limit property if it supports one.
Definition: Joint.cpp:534
BodyID body
Identifier of body to associate the fixture with.
Definition: FixtureConf.hpp:93
State state
Termination state.
Definition: Distance.hpp:86
AngularMomentum GetAngularMotorImpulse(const Joint &object)
Gets the angular motor impulse of the joint if it has this property.
Definition: Joint.cpp:447
LinearVelocity velocityBias
Velocity bias.
Definition: VelocityConstraint.hpp:212
::playrho::detail::SeparationInfo< 2 > SeparationInfo
Separation information alias for 2-D space.
Definition: IndexPair.hpp:147
friend PROPAGATE_CONST_CONSTEXPR bool operator>(const U &u, const propagate_const &pu)
Greater-than operator.
Definition: propagate_const.hpp:371
void Remove(BodyID id) noexcept
Removes the given body from this world.
Definition: WorldImpl.cpp:651
static constexpr Length2 DefaultGroundAnchorB
Default ground anchor B.
Definition: PulleyJointConf.hpp:63
bool IsAwake(const Body &body) noexcept
Gets the awake/asleep state of this body.
Definition: Body.hpp:808
void Clear(Island &island) noexcept
Clears the island containers.
Definition: Island.cpp:145
Frequency GetInvDeltaTime() const noexcept
Gets the inverse delta time.
Definition: World.cpp:126
constexpr auto & UseMaxForce(NonNegative< Force > v) noexcept
Uses the given maximum force value.
Definition: MotorJointConf.hpp:74
PLAYRHO_QUANTITY(boost::units::si::force) Force
Force quantity.
Definition: Units.hpp:244
constexpr RevoluteJointConf()=default
Default constructor.
Block allocator.
Definition: BlockAllocator.hpp:35
Essentially a Manifold expressed in world coordinate terms.
Definition: WorldManifold.hpp:41
counter_type updated
Count of contacts updated (during update processing).
Definition: StepStats.hpp:38
void SetFilterData(FixtureConf &conf, Filter value) noexcept
Sets the filter-data of the given configuration.
Definition: FixtureConf.hpp:175
Real alpha0
Fraction of the current time step in the range [0,1].
Definition: Sweep.hpp:111
Flag
Flag enumeration.
Definition: WorldImpl.hpp:523
constexpr Interval(Interval &&other)=default
Move constructor.
Clip vertex.
Definition: Collision.hpp:69
NonNegative< Torque > maxTorque
Maximum motor torque.
Definition: MotorJointConf.hpp:107
Transformation m_xf
Transformation for body origin.
Definition: Body.hpp:468
void * GetData_() noexcept override
Gets the data for the underlying configuration.
Definition: Joint.hpp:411
std::remove_const< decltype(DefaultMaxToiIters)>::type toi_iter_type
TOI iterations type.
Definition: TimeOfImpact.hpp:162
constexpr auto Peta
Peta- (1 x 10^15).
Definition: RealConstants.hpp:97
void ResetAlpha0() noexcept
Resets the alpha 0 value back to zero.
Definition: Sweep.hpp:126
constexpr auto GetLengthA(const PulleyJointConf &object) noexcept
Free function for getting the length A value of the given configuration.
Definition: PulleyJointConf.hpp:197
void SetJoint(JointID id, const Joint &def)
Sets the identified joint to the given value.
Definition: World.cpp:231
std::numeric_limits< value_type > limits
Limits alias for the value_type.
Definition: Interval.hpp:49
std::size_t size_type
Size type.
Definition: BlockAllocator.cpp:98
size_type GetIndex(value_type *ptr) const
Gets the index of the given pointer.
Definition: ArrayAllocator.hpp:51
std::string GetBuildDetails() noexcept
Gets the build details of the library.
Definition: Version.cpp:41
void SetVelocity(const Velocity &velocity) noexcept
Sets the body's velocity (linear and angular velocity).
Definition: Body.cpp:165
constexpr friend bool operator==(const IndexingNamedType &lhs, const IndexingNamedType &rhs)
Equality operator.
Definition: IndexingNamedType.hpp:91
SizedRange< Bodies::const_iterator > GetBodies() const noexcept
Gets the world body range for this constant world.
Definition: World.cpp:151
constexpr ShapeBuilder(const BaseShapeConf &value) noexcept
Initializing constructor.
Definition: ShapeConf.hpp:77
constexpr auto & UseMaxMotorTorque(Torque v) noexcept
Uses the given max motor torque value.
Definition: RevoluteJointConf.hpp:111
size_type Allocate(const value_type ©)
Allocates an entry in the array with the given instance.
Definition: ArrayAllocator.hpp:80
::std::size_t operator()(const ::playrho::detail::IndexingNamedType< T, Tag > &v) const noexcept
Hashing functor operator.
Definition: IndexingNamedType.hpp:198
constexpr bool operator!=(const AABB< N > &lhs, const AABB< N > &rhs) noexcept
Gets whether the two AABB objects are not equal.
Definition: AABB.hpp:134
@ e_autoSleepFlag
Auto sleep flag.
Definition: Body.hpp:84
std::vector< JointID > Joints
Container type for joint identifiers.
Definition: World.hpp:138
friend bool operator==(const Concept &lhs, const Concept &rhs) noexcept
Equality operator.
Definition: Shape.hpp:407
Time deltaTime
Delta time.
Definition: StepConf.hpp:53
Positive< Length > linearSlop
Linear slop.
Definition: StepConf.hpp:71
Length toiMinSeparation
Time of impact minimum separation.
Definition: StepConf.hpp:115
Real dampingRatio
Suspension damping ratio, one indicates critical damping.
Definition: WheelJointConf.hpp:127
UnitVec localAxis2
Local axis 2. Used when type2 is not Revolute.
Definition: GearJointConf.hpp:91
const char * GetName(Manifold::Type type) noexcept
Gets a unique name for the given manifold type.
Definition: Manifold.cpp:788
Length2 CalcSearchDirection(const SimplexEdges &simplexEdges) noexcept
Calculates the "search direction" for the given simplex edge list.
Definition: Simplex.cpp:37
const SimplexEdge & GetSimplexEdge(size_type index) const noexcept
Gets the give indexed simplex edge.
Definition: Simplex.hpp:183
constexpr auto operator()() noexcept -> decltype(static_cast< T >(0))
Valid value supplying functor.
Definition: UnitInterval.hpp:40
void operator()(void *p) noexcept
Functional operator for freeing memory allocated by this object.
Definition: StackAllocator.hpp:88
RayCastOutput RayCast(Length radius, Length2 location, const RayCastInput &input) noexcept
Cast a ray against a circle of a given radius at the given location.
Definition: RayCastOutput.cpp:37
Length linearSlop
Linear slop.
Definition: Manifold.hpp:461
BodyCounter GetBodyRange() const noexcept
Gets the extent of the currently valid body range.
Definition: WorldImpl.cpp:614
std::vector< PositionConstraint > PositionConstraints
Collection of position constraints.
Definition: WorldImpl.cpp:101
State
State of the distance output.
Definition: Distance.hpp:73
std::vector< ContactKey > ContactKeyQueue
Contact key queue type alias.
Definition: WorldImpl.hpp:538
Momentum regMinMomentum
Regular-phase minimum momentum.
Definition: StepConf.hpp:97
static constexpr Conf GetDefaultConf()
Gets the default configuration.
Definition: StackAllocator.hpp:49
bool SolvePosition_(BodyConstraintsMap &bodies, const ConstraintSolverConf &conf) const override
Solves the positions for this joint.
Definition: Joint.hpp:464
Length2 location
Location for the disk shape to be centered at.
Definition: DiskShapeConf.hpp:105
Length GetLength(const Joint &object)
Gets the length property of the specified joint if its type has one.
Definition: Joint.cpp:673
static Cache GetCache(const SimplexEdges &edges) noexcept
Gets the cache value for the given edges.
Definition: Simplex.hpp:161
constexpr DynamicTree::Size GetNext(const DynamicTree::TreeNode &node) noexcept
Gets the next index of the given node.
Definition: DynamicTree.hpp:671
constexpr Fixed< BT, FB > operator%(Fixed< BT, FB > lhs, Fixed< BT, FB > rhs) noexcept
Modulo operator.
Definition: Fixed.hpp:657
Length2 GetPointRelPosA(const VelocityConstraint &vc, VelocityConstraint::size_type index)
Gets the point relative position A data.
Definition: VelocityConstraint.hpp:389
LinearVelocity GetVelocityBiasAtPoint(const VelocityConstraint &vc, VelocityConstraint::size_type index)
Gets the velocity bias at the given point from the given velocity constraint.
Definition: VelocityConstraint.hpp:403
Momentum2 linearImpulse
Linear impulse.
Definition: FrictionJointConf.hpp:89
Shape(Shape &&other) noexcept=default
Move constructor.
DynamicTree & operator=(DynamicTree other) noexcept
Unifying assignment operator.
Definition: DynamicTree.cpp:444
SizedRange< std::vector< KeyedContactPtr >::const_iterator > GetContacts(const World &world, BodyID id)
Gets the container of all contacts attached to the identified body.
Definition: WorldBody.cpp:478
World configuration data.
Definition: WorldConf.hpp:33
static constexpr size_type GetMaxBlockSize() noexcept
Max block size (before using external allocator).
Definition: BlockAllocator.hpp:50
constexpr int getsign() const noexcept
Gets this value's sign.
Definition: Fixed.hpp:546
size_type allocation_records
Allocation records.
Definition: StackAllocator.hpp:45
Constraint for a body.
Definition: BodyConstraint.hpp:36
Block.
Definition: BlockAllocator.cpp:106
Non-negative constrained value checker.
Definition: NonNegative.hpp:30
Template for determining if the given types are divisable.
Definition: Templates.hpp:205
constexpr JointKey(BodyID body1, BodyID body2)
Initializing constructor.
Definition: JointKey.hpp:64
bool enableMotor
Enable/disable the joint motor.
Definition: PrismaticJointConf.hpp:144
constexpr DiskShapeConf & Transform(const Mat22 &m) noexcept
Transforms the location by the given transformation matrix.
Definition: DiskShapeConf.hpp:73
std::remove_const< decltype(DefaultMaxDistanceIters)>::type dist_iter_type
Distance iterations type.
Definition: TimeOfImpact.hpp:165
SizedRange< Joints::const_iterator > GetJoints() const noexcept
Gets the world joint range.
Definition: World.cpp:216
Velocity GetVelocity() const noexcept
Gets the velocity.
Definition: Body.hpp:529
std::int32_t type
Wider type.
Definition: Wider.hpp:51
toi_sum_type sum_finder_iters
Sum total TOI iterations.
Definition: TimeOfImpact.hpp:180
Fixed< BT, FB > log(Fixed< BT, FB > arg)
Computes the natural logarithm.
Definition: FixedMath.hpp:166
constexpr AABB< N > & Fatten(AABB< N > &var, const NonNegative< Length > amount) noexcept
Fattens an AABB by the given amount.
Definition: AABB.hpp:308
bool SolvePosition(const DistanceJointConf &object, std::vector< BodyConstraint > &bodies, const ConstraintSolverConf &conf)
Solves the position constraint.
Definition: DistanceJointConf.cpp:194
PolygonShapeConf & UseVertexRadius(NonNegative< Length > value) noexcept
Uses the given vertex radius.
Definition: PolygonShapeConf.hpp:195
constexpr auto NewtonSecond
Newton second unit of momentum.
Definition: Units.hpp:413
constexpr auto Transform(const Vector< T1, M > v, const Matrix< T2, M, N > &m) noexcept
Multiplies an M-element vector by an M-by-N matrix.
Definition: Math.hpp:575
constexpr auto GetIndexA() const noexcept
Gets index A.
Definition: SimplexEdge.hpp:60
void SetNormalImpulseAtPoint(size_type index, Momentum value)
Sets the normal impulse at the given point.
Definition: VelocityConstraint.hpp:353
Length2 GetCentroid() const noexcept
Gets the centroid.
Definition: PolygonShapeConf.hpp:166
constexpr TreeNode(const BranchData &value, AABB aabb, Height height, Size other=DynamicTree::GetInvalidSize()) noexcept
Initializing constructor.
Definition: DynamicTree.hpp:434
Shape configuration structure.
Definition: ShapeConf.hpp:119
Length2 v
Vertex of edge or polygon. 8-bytes.
Definition: Collision.hpp:70
counter_type contactsAdded
Contacts added count.
Definition: StepStats.hpp:57
static constexpr Fixed GetMax() noexcept
Gets the max value this type is capable of expressing.
Definition: Fixed.hpp:86
BodyID GetBodyA_() const noexcept override
Gets the ID of body-A.
Definition: Joint.hpp:427
UnitVec localXAxisA
The local X translation unit axis in body A.
Definition: PrismaticJointConf.hpp:122
Type m_type
Type of collision this manifold is associated with (1-byte).
Definition: Manifold.hpp:441
constexpr ConstraintSolverConf & UseAngularSlop(Angle value) noexcept
Uses the given angular slop.
Definition: ConstraintSolverConf.hpp:49
ArrayList< T, S > & operator+=(ArrayList< T, S > &lhs, const typename ArrayList< T, S >::data_type &rhs)
ArrayList append operator.
Definition: ArrayList.hpp:197
Length lengthA
The a reference length for the segment attached to body-A.
Definition: PulleyJointConf.hpp:100
std::vector< Length2 > m_vertices
Array of vertices.
Definition: PolygonShapeConf.hpp:184
std::invalid_argument exception_type
Exception type possibly thrown by this checker.
Definition: Negative.hpp:32
friend PROPAGATE_CONST_CONSTEXPR bool operator!=(const propagate_const &pt, const propagate_const< U > &pu)
Not-equals operator.
Definition: propagate_const.hpp:272
typename std::remove_pointer< Angle >::type remove_pointer_type
Remove pointer type.
Definition: CheckedValue.hpp:71
static constexpr playrho::Fixed< BT, FB > signaling_NaN() noexcept
Gets the signaling NaN value for the type.
Definition: FixedLimits.hpp:92
constexpr auto factorial(std::int64_t n)
Computes the factorial.
Definition: FixedMath.hpp:116
constexpr BodyConf & UseAwake(bool value) noexcept
Use the given awake value.
Definition: BodyConf.hpp:246
World & operator=(const World &other)
Assignment operator.
Definition: WorldSpecial.cpp:52
Length targetDepth
Targeted depth of impact.
Definition: Manifold.hpp:465
std::pair< Velocity, Velocity > VelocityPair
Velocity pair.
Definition: Velocity.hpp:144
auto GetNormal(VertexCounter index) const noexcept
Gets the normal for the given index.
Definition: DistanceProxy.hpp:172
constexpr auto & UseFrequency(NonNegative< Frequency > v) noexcept
Uses the given frequency value.
Definition: WeldJointConf.hpp:70
RotInertia angularMass
Angular mass.
Definition: FrictionJointConf.hpp:96
const value_type * const_iterator
Constant iterator type.
Definition: Vector.hpp:75
std::function< void(FixtureID)> FixtureListener
Fixture listener.
Definition: WorldImpl.hpp:99
const_pointer end() const
Gets the "end" iterator value.
Definition: VertexSet.hpp:88
bool IsAccelerable() const noexcept
Is "accelerable".
Definition: Body.hpp:629
constexpr Size GetOther() const noexcept
Gets the node's "other" index.
Definition: DynamicTree.hpp:453
InvRotInertia m_invRotI
Inverse rotational inertia about the center of mass of the associated body (a non-negative value).
Definition: BodyConstraint.hpp:94
void Add(JointID j, bool flagForFiltering=false)
Updates associated bodies and contacts for specified joint's addition.
Definition: WorldImpl.cpp:747
Length2 GetGroundAnchorA(const Joint &object)
Definition: Joint.cpp:646
counter_type sumPosIters
Sum of the position iterations.
Definition: StepStats.hpp:60
Length ComputeTotalPerimeter(const DynamicTree &tree) noexcept
Gets the sum of the perimeters of nodes.
Definition: DynamicTree.cpp:747
constexpr Fixed(int val) noexcept
Initializing constructor.
Definition: Fixed.hpp:205
std::vector< ConvexHull > children
Children.
Definition: MultiShapeConf.hpp:143
void ShiftOrigin(Length2 newOrigin) noexcept
Shifts the world origin.
Definition: DynamicTree.cpp:679
Revnum major
Major version number.
Definition: Version.hpp:47
std::vector< ProxyId > Proxies
Proxy container type alias.
Definition: WorldImpl.hpp:96
Position GetPosition1(const Body &body) noexcept
Gets the "position 1" Position information for the given body.
Definition: Body.hpp:894
constexpr auto Newton
Newton unit of force.
Definition: Units.hpp:403
Length GetCurrentLengthB(const World &world, JointID id)
Get the current length of the segment attached to body-B.
Definition: WorldJoint.cpp:314
constexpr auto Hertz
Hertz unit of Frequency.
Definition: Units.hpp:330
const Manifold & GetManifold(ContactID id) const
Gets the collision manifold for the identified contact.
Definition: World.cpp:256
Transformation GetTransform1(const Sweep &sweep) noexcept
Gets the transform at "time" one.
Definition: Math.hpp:916
friend PROPAGATE_CONST_CONSTEXPR bool operator==(const propagate_const &pt, const propagate_const< U > &pu)
Equals operator.
Definition: propagate_const.hpp:265
constexpr Vector< Length, N > GetUpperBound(const AABB< N > &aabb) noexcept
Gets the upper bound.
Definition: AABB.hpp:370
LeafData GetLeafData(Size index) const noexcept
Gets the leaf data for the node identified by the given identifier.
Definition: DynamicTree.hpp:609
Length2 GetPoint(size_type index) const noexcept
Gets the indexed point's location in world coordinates.
Definition: WorldManifold.hpp:135
MassData ComputeMassData(const World &world, BodyID id)
Computes the identified body's mass data.
Definition: WorldBody.cpp:347
constexpr WorldConf & UseMaxVertexRadius(Positive< Length > value) noexcept
Uses the given max vertex radius value.
Definition: WorldConf.hpp:72
constexpr ConcreteConf & UseDensity(NonNegative< AreaDensity > value) noexcept
Uses the given density.
Definition: ShapeConf.hpp:111
ContactCounter initialTreeSize
Initial tree size.
Definition: WorldConf.hpp:63
Contacts m_contacts
Container of contacts.
Definition: WorldImpl.hpp:864
std::function< void(ContactID, const Manifold &)> ManifoldContactListener
Listener type for some manifold contact events.
Definition: World.hpp:156
constexpr T GetModuloPrev(T value, T count) noexcept
Gets the modulo previous value.
Definition: Math.hpp:666
constexpr Acceleration operator/(const Acceleration &lhs, const Real rhs)
Division operator.
Definition: Acceleration.hpp:132
constexpr auto DefaultStepTime
Default step time.
Definition: Settings.hpp:242
UnitVec m_normal
Normal.
Definition: PositionSolverManifold.hpp:41
static Manifold GetForFaceB(UnitVec ln, Length2 lp) noexcept
Gets a face B typed manifold.
Definition: Manifold.hpp:212
Base configuration for initializing shapes.
Definition: ShapeConf.hpp:35
Separation scenario.
Definition: SeparationScenario.hpp:36
Length GetMaxVertexRadius(const WorldImpl &world) noexcept
Gets the maximum vertex radius that shapes in this world can be.
Definition: WorldImplMisc.cpp:142
constexpr bool IsBranch(const DynamicTree::TreeNode &node) noexcept
Is branch.
Definition: DynamicTree.hpp:655
Length2 localAnchorA
The local anchor point relative to body A's origin.
Definition: WeldJointConf.hpp:84
void SetAwake() noexcept
Awakens this body.
Definition: Body.cpp:145
void SetAngularOffset(Joint &object, Angle value)
Sets the angular offset property of the specified joint if its type has one.
Definition: Joint.cpp:621
void swap(Shape &other) noexcept
Swap support.
Definition: Shape.hpp:257
std::numeric_limits< value_type > numeric_limits
Numeric limits type alias.
Definition: Fixed.hpp:566
Real GetFriction_() const noexcept override
Gets the friction.
Definition: Shape.hpp:459
bool ShouldCollide(const FixtureConf &fixtureA, const FixtureConf &fixtureB) noexcept
Whether contact calculations should be performed between the two fixtures.
Definition: FixtureConf.hpp:184
constexpr auto & GetX(T &value)
Gets the "X" element of the given value - i.e. the first element.
Definition: Math.hpp:66
constexpr Vec2 InverseTransform(const Vec2 v, const Mat22 &A) noexcept
Multiply a matrix transpose times a vector. If a rotation matrix is provided, then this transforms th...
Definition: Math.hpp:591
JointCounter GetJointCount(const World &world) noexcept
Gets the count of joints in the given world.
Definition: WorldJoint.hpp:382
ContactCounter Height
Type for heights.
Definition: DynamicTree.hpp:92
Name space for all PlayRho related names.
Definition: AABB.cpp:33
friend void swap(DynamicTree &lhs, DynamicTree &rhs) noexcept
Customized swap function for DynamicTree objects.
Definition: DynamicTree.cpp:693
value_type & reference
Reference type.
Definition: Vector.hpp:60
Length2 GetWorldVector(const Body &body, const Length2 localVector) noexcept
Gets the world coordinates of a vector given the local coordinates.
Definition: Body.hpp:1218
size_type preallocation_size
Preallocation size.
Definition: StackAllocator.hpp:44
constexpr auto DefaultCirclesRatio
Default circles ratio.
Definition: Settings.hpp:264
iterator_type m_end
End iterator.
Definition: Range.hpp:70
const_pointer data() const
Gets the pointer to the data buffer.
Definition: VertexSet.hpp:82
::playrho::detail::LengthIndices< 2 > LengthIndices
Length and vertex counter array of indices for 2-D space.
Definition: IndexPair.hpp:144
Length2 GetGroundAnchorB(const Joint &object)
Definition: Joint.cpp:655
constexpr Length2 GetClosestPoint(const Simplex &simplex)
Gets the "closest point".
Definition: Simplex.hpp:207
constexpr Acceleration & operator+=(Acceleration &lhs, const Acceleration &rhs)
Addition assignment operator.
Definition: Acceleration.hpp:72
static ConvexHull Get(const VertexSet &pointSet, NonNegative< Length > vertexRadius=NonNegative< Length >{DefaultLinearSlop *Real{2}})
Gets the convex hull for the given set of vertices.
Definition: MultiShapeConf.cpp:54
void SetContact(World &world, ContactID id, const Contact &value)
Sets the identified contact's state.
Definition: WorldContact.cpp:50
PROPAGATE_CONST_CONSTEXPR const element_type & operator*() const
Indirection operator support.
Definition: propagate_const.hpp:200
BodyCounter GetBodyRange(const World &world) noexcept
Gets the extent of the currently valid body range.
Definition: WorldBody.cpp:42
std::remove_const< decltype(DefaultMaxDistanceIters)>::type iteration_type
Iteration type.
Definition: Distance.hpp:82
LinearAcceleration2 GetLinearAcceleration() const noexcept
Gets this body's linear acceleration.
Definition: Body.hpp:651
dist_iter_type maxDistIters
Max distance iterations.
Definition: TimeOfImpact.hpp:106
Joint key.
Definition: JointKey.hpp:42
::playrho::propagate_const< T > second_argument_type
Second argument type.
Definition: propagate_const.hpp:482
static constexpr std::size_t AllocatorBlockSizes[]
Allocator block sizes array data.
Definition: BlockAllocator.hpp:41
A length associated with two vertex counter indices.
Definition: IndexPair.hpp:136
std::vector< KeyedContactPtr > Contacts
Contacts container type.
Definition: WorldImpl.hpp:80
Momentum normalImpulse
Normal impulse.
Definition: VelocityConstraint.hpp:195
void SetType(Body &body, BodyType value) noexcept
Sets the type of this body.
Definition: Body.hpp:699
constexpr TargetJointConf(BodyID b) noexcept
Initializing constructor.
Definition: TargetJointConf.hpp:56
Statistics stats
Statistics.
Definition: TimeOfImpact.hpp:257
friend bool operator!=(const Shape &lhs, const Shape &rhs) noexcept
Inequality operator for shape to shape comparisons.
Definition: Shape.hpp:348
constexpr bool IsEntirelyEnclosing(const Interval< T > &a, const Interval< T > &b)
Determines whether the first range entirely encloses the second.
Definition: Interval.hpp:282
bool IsTouching(const Contact &contact) noexcept
Gets whether the given contact is touching or not.
Definition: Contact.hpp:658
@ e_separated
Separated.
Definition: TimeOfImpact.hpp:211
DynamicTree::Height GetMaxImbalance(const DynamicTree &tree) noexcept
Gets the maximum imbalance.
Definition: DynamicTree.cpp:786
void UnsetEnabled() noexcept
Unsets the enabled flag.
Definition: Body.hpp:681
Block * blocks
Pointer to blocks.
Definition: BlockAllocator.cpp:101
std::uint16_t type
Wider type.
Definition: Wider.hpp:46
std::size_t size() const noexcept
Gets the current size of this set.
Definition: VertexSet.hpp:76
UnitVec GetNormal(ChildCounter index) const
Gets the normal at the given index.
Definition: ChainShapeConf.hpp:103
::playrho::propagate_const< T > first_argument_type
First argument type.
Definition: propagate_const.hpp:425
FixtureConf & UseFilter(Filter value) noexcept
Uses the given filter value.
Definition: FixtureConf.hpp:80
BodyType type
Type of the body: static, kinematic, or dynamic.
Definition: BodyConf.hpp:108
LinearAcceleration2 linear
Linear acceleration.
Definition: Acceleration.hpp:34
FixtureCounter GetFixtureRange(const World &world) noexcept
Gets the extent of the currently valid fixture range.
Definition: WorldFixture.cpp:33
void EnableLimit(Joint &object, bool value)
Enables the specified joint's limit property if it supports one.
Definition: Joint.cpp:546
Vector2< Real > Vec2
Vector with 2 Real elements.
Definition: Vector2.hpp:39
VelocityConstraint::Conf GetRegVelocityConstraintConf(const StepConf &conf) noexcept
Gets the regular phase velocity constraint configuration from the given step configuration.
Definition: VelocityConstraint.cpp:190
std::vector< ContactID > Contacts
Container type for contact identifiers.
Definition: Island.hpp:45
Length minSeparation
Min separation.
Definition: StepStats.hpp:72
Length2 localAnchorB
Local anchor point relative to body B's origin.
Definition: DistanceJointConf.hpp:95
void Clear() noexcept
Clears this world.
Definition: World.cpp:76
std::vector< size_type > m_free
Indices of free elements.
Definition: ArrayAllocator.hpp:188
Constraint solver configuration data.
Definition: ConstraintSolverConf.hpp:33
void SetAwakeFlag() noexcept
Sets the body's awake flag.
Definition: Body.hpp:579
Force maxMotorForce
The maximum motor force.
Definition: PrismaticJointConf.hpp:147
ChildCounter GetProxyCount(const WorldImpl &world, FixtureID id)
Gets the count of proxies of the identified fixture.
Definition: WorldImplFixture.hpp:81
Angle angularSlop
Angular slop.
Definition: ConstraintSolverConf.hpp:86
ArrayAllocator< Contacts > m_bodyContacts
Cache of contacts associated with bodies.
Definition: WorldImpl.hpp:834
constexpr auto RevolutionsPerMinute
Revolutions per minute units of angular velocity.
Definition: Units.hpp:423
WorldManifold GetWorldManifold(const Manifold &manifold, Transformation xfA, Length radiusA, Transformation xfB, Length radiusB)
Gets the world manifold for the given data.
Definition: WorldManifold.cpp:105
Checked value.
Definition: CheckedValue.hpp:62
Real GetDampingRatio(const Joint &object)
Gets the given joint's damping ratio property if it has one.
Definition: Joint.cpp:389
Position pos1
Center world position and world angle at time "1".
Definition: Sweep.hpp:100
constexpr Fixed(value_type val, unsigned int fraction) noexcept
Initializing constructor.
Definition: Fixed.hpp:219
Length maxTranslation
Maximum translation.
Definition: MovementConf.hpp:33
static Bodies::size_type RemoveUnspeedablesFromIslanded(const std::vector< BodyID > &bodies, const ArrayAllocator< Body > &buffer, std::vector< bool > &islanded)
Removes unspeedables from the is is-in-island state.
Definition: WorldImpl.cpp:936
Real m_restitution
Restitution coefficient (4-bytes).
Definition: VelocityConstraint.hpp:288
Force GetMaxMotorForce(const Joint &object)
Gets the given joint's max motor force if its type supports that.
Definition: Joint.cpp:332
Real MixFriction(Real friction1, Real friction2)
Mixes friction.
Definition: Contact.hpp:46
constexpr BodyConf GetDefaultBodyConf() noexcept
Gets the default body definition.
Definition: BodyConf.hpp:272
constexpr UnitVec(value_type x, value_type y) noexcept
Initializing constructor.
Definition: UnitVec.hpp:295
ChildCounter GetChildIndexB(const Contact &contact) noexcept
Gets the child index B of the given contact.
Definition: Contact.hpp:616
bool Unawaken(Body &body) noexcept
Puts the body to sleep if it's awake.
Definition: Body.hpp:1068
const_reverse_iterator rbegin() const noexcept
Gets a reverse "begin" iterator.
Definition: UnitVec.hpp:195
friend PROPAGATE_CONST_CONSTEXPR bool operator==(const propagate_const &pt, const U &u)
Equals operator.
Definition: propagate_const.hpp:308
~World() noexcept
Destructor.
Definition: WorldSpecial.cpp:43
ContactCounter GetTouchingCount(const World &world) noexcept
Gets the touching count for the given world.
Definition: WorldContact.cpp:217
const_reverse_iterator crbegin() const noexcept
Gets a reverse "begin" iterator.
Definition: Vector.hpp:131
constexpr auto & GetZ(T &value)
Gets the "Z" element of the given value - i.e. the third element.
Definition: Math.hpp:80
::playrho::propagate_const< T > first_argument_type
First argument type.
Definition: propagate_const.hpp:495
Allocation record.
Definition: StackAllocator.hpp:139
void swap(DynamicTree &lhs, DynamicTree &rhs) noexcept
Definition: DynamicTree.cpp:693
AngularVelocity motorSpeed
The desired angular motor speed.
Definition: PrismaticJointConf.hpp:150
JointCounter GetJointRange(const WorldImpl &world) noexcept
Gets the extent of the currently valid joint range.
Definition: WorldImplJoint.cpp:42
const Joint & GetJoint(const WorldImpl &world, JointID id)
Gets the identified joint's value.
Definition: WorldImplJoint.cpp:57
constexpr Manifold::Conf GetDefaultManifoldConf() noexcept
Gets the default manifold configuration.
Definition: Manifold.hpp:479
Joint & operator=(T &&other) noexcept
Move assignment support for any valid underlying configuration.
Definition: Joint.hpp:243
friend std::add_pointer_t< std::add_const_t< T > > TypeCast(const Joint *value) noexcept
Converts the given joint into its current configuration value.
Definition: Joint.hpp:569
counter_type bodiesSlept
Bodies slept count.
Definition: StepStats.hpp:58
virtual TypeID GetType_() const noexcept=0
Gets the use type information.
Time of impact statistics.
Definition: TimeOfImpact.hpp:160
iteration_type maxIterations
Max iterations.
Definition: Distance.hpp:57
value_type m_max
Max value.
Definition: Interval.hpp:223
bool IsStepComplete() const noexcept
Whether or not "step" is complete.
Definition: WorldImpl.hpp:940
Length distance
Distance.
Definition: IndexPair.hpp:102
SizedRange< Fixtures::const_iterator > GetFixtures(BodyID id) const
Gets the range of fixtures attached to the identified body.
Definition: World.cpp:181
Span(const Span ©)=default
Copy constructor.
VertexCounter GetSecondShapeVertexIdx(const detail::SeparationInfo< N > &info) noexcept
Gets second shape vertex indices.
Definition: IndexPair.hpp:126
void SetAngularOffset(Joint &object, Angle value)
Sets the angular offset property of the specified joint if its type has one.
Definition: Joint.cpp:621
bool IsActive(const Contact &contact) noexcept
Determines whether the given contact is "active".
Definition: Contact.hpp:630
DestroyContactsStats DestroyContacts(Contacts &contacts)
Processes the narrow phase collision for the contacts collection.
Definition: WorldImpl.cpp:1854
void SetMaxMotorTorque(Joint &object, Torque value)
Sets the given joint's max motor torque if its type supports that.
Definition: Joint.cpp:363
Length lengthB
The a reference length for the segment attached to body-B.
Definition: PulleyJointConf.hpp:103
Momentum2 impulse
Impulse.
Definition: TargetJointConf.hpp:125
friend TypeID GetType(const Joint &object) noexcept
Gets the identifier of the type of data this can be casted to.
Definition: Joint.hpp:261
AngularVelocity GetAngularVelocity(const Body &body) noexcept
Gets the angular velocity.
Definition: Body.hpp:1178
Length maxTranslation
Maximum translation.
Definition: StepConf.hpp:153
Area TestOverlap(const DistanceProxy &proxyA, const Transformation &xfA, const DistanceProxy &proxyB, const Transformation &xfB, DistanceConf conf)
Determine if two generic shapes overlap.
Definition: Distance.cpp:227
Range< ConstNormalIterator > GetNormals() const noexcept
Gets the range of normal.
Definition: DistanceProxy.hpp:140
Length2 GetVertexA() const noexcept
Gets vertex A.
Definition: EdgeShapeConf.hpp:72
void SetBeginContactListener(ContactListener listener) noexcept
Register a begin contact event listener.
Definition: WorldImpl.hpp:1014
reference at(size_type pos)
Bounds checking indexed array accessor.
Definition: ArrayAllocator.hpp:141
Length2 GetLocalAnchorA(const Joint &object)
Get the anchor point on body-A in local coordinates.
Definition: Joint.cpp:62
friend PROPAGATE_CONST_CONSTEXPR bool operator<(const propagate_const &pt, const propagate_const< U > &pu)
Less-than operator.
Definition: propagate_const.hpp:279
void SetImpenetrable() noexcept
Sets the impenetrable status of this body.
Definition: Body.hpp:569
Block * m_freeLists[size(AllocatorBlockSizes)]
Free lists.
Definition: BlockAllocator.hpp:114
constexpr size_type max_size() const noexcept
Gets the max size.
Definition: Vector.hpp:97
Length2 m_point
Point.
Definition: PositionSolverManifold.hpp:46
AngularVelocity m_angularVelocity
Angular velocity.
Definition: Body.hpp:487
void SetMotorSpeed(Joint &object, AngularVelocity value)
Sets the given joint's motor speed if its type supports that.
Definition: Joint.cpp:269
PreStepStats pre
Pre-phase step statistics.
Definition: StepStats.hpp:117
Matrix22< InvMass > InvMass22
2 by 2 matrix of InvMass elements.
Definition: Matrix.hpp:191
Position pos0
Center world position and world angle at time "0".
Definition: Sweep.hpp:97
const Sweep & GetSweep() const noexcept
Gets the body's sweep.
Definition: Body.hpp:524
VelocityConstraint::Conf GetToiVelocityConstraintConf(const StepConf &conf) noexcept
Gets the TOI phase velocity constraint configuration from the given step configuration.
Definition: VelocityConstraint.cpp:199
IT iterator_type
Iterator type.
Definition: Range.hpp:35
static constexpr UnitVec GetDefaultFallback() noexcept
Gets the default fallback.
Definition: UnitVec.hpp:115
void SetLinearOffset(Joint &object, Length2 value)
Sets the linear offset property of the specified joint if its type has one.
Definition: Joint.cpp:602
WorldImpl(const WorldConf &def=GetDefaultWorldConf())
Constructs a world implementation for a world.
Definition: WorldImpl.cpp:563
State
State.
Definition: TimeOfImpact.hpp:192
PROPAGATE_CONST_CONSTEXPR element_type * get()
Gets pointer content.
Definition: propagate_const.hpp:221
constexpr auto MaxFixtures
Maximum number of fixtures in a world.
Definition: Settings.hpp:203
BranchData branch
Branch specific data.
Definition: DynamicTree.hpp:369
NonNegative< Real > dampingRatio
The damping ratio. 0 = no damping, 1 = critical damping.
Definition: TargetJointConf.hpp:121
Positive< Length > maxVertexRadius
Maximum vertex radius.
Definition: WorldConf.hpp:60
virtual bool IsEqual_(const Concept &other) const noexcept=0
Equality checking method.
Length GetJointTranslation(const World &world, JointID id)
Gets the current joint translation.
Definition: WorldJoint.cpp:229
constexpr Fixed< BT, FB > pow(Fixed< BT, FB > value, int n)
Computes the value of the given number raised to the given power.
Definition: FixedMath.hpp:59
void UnsetImpenetrable(Body &body) noexcept
Unsets the impenetrable status of this body.
Definition: Body.hpp:746
size_type const m_size
Size.
Definition: StackAllocator.hpp:147
constexpr auto & UseLength(Length v) noexcept
Uses the given length.
Definition: DistanceJointConf.hpp:69
constexpr auto & UseEnableMotor(bool v) noexcept
Uses the given enable motor state value.
Definition: WheelJointConf.hpp:68
inline ::std::ostream & operator<<(::std::ostream &os, const AABB< N > &value)
Output stream operator.
Definition: AABB.hpp:382
static constexpr NonNegative< Length > GetDefaultVertexRadius() noexcept
Gets the default vertex radius.
Definition: EdgeShapeConf.hpp:45
TypeID type1
Type of the first joint.
Definition: GearJointConf.hpp:79
constexpr void SetAABB(AABB value) noexcept
Sets the node's AABB.
Definition: DynamicTree.hpp:474
std::remove_const< decltype(MaxBodies)>::type BodyCounter
Count type for bodies.
Definition: Settings.hpp:217
Angle angularError
Angular error.
Definition: MotorJointConf.hpp:116
Momentum2 GetLinearReaction(const Joint &object)
Get the linear reaction on body-B at the joint anchor.
Definition: Joint.cpp:133
static FlagsType GetFlags(BodyType type) noexcept
Gets the flags for the given value.
Definition: Body.cpp:41
counter_type contactsSkippedTouching
Contacts skipped touching count.
Definition: StepStats.hpp:83
bool TestPoint(const DistanceProxy &proxy, Length2 point) noexcept
Tests a point for containment in the given distance proxy.
Definition: DistanceProxy.cpp:114
UnitVec u
U direction.
Definition: RopeJointConf.hpp:91
Torque GetMaxTorque(const Joint &object)
Gets the given joint's max torque if its type supports that.
Definition: Joint.cpp:320
Position pos_a
Position A.
Definition: ContactSolver.hpp:41
static constexpr std::false_type check(...)
Declaration of check function for non-supporting types given to template.
Vec3 impulse
Impulse.
Definition: RevoluteJointConf.hpp:126
Sweep()=default
Default constructor.
BodyID GetBodyA() const noexcept
Gets identifier of body A.
Definition: VelocityConstraint.hpp:119
constexpr Interval()=default
Default constructor.
iterator end() noexcept
Gets an "end" iterator.
Definition: Vector.hpp:110
VertexSet(Area minSepSquared=GetDefaultMinSeparationSquared())
Initializing constructor.
Definition: VertexSet.hpp:49
bool enableLimit
Flag to enable joint limits.
Definition: RevoluteJointConf.hpp:137
constexpr WorldManifold(UnitVec normal) noexcept
Initializing constructor.
Definition: WorldManifold.hpp:79
Length2 rA
Relative A position. 8-bytes (with 4-byte Real).
Definition: DistanceJointConf.hpp:118
BodyCounter islandsFound
Islands found count.
Definition: StepStats.hpp:55
ChildCounter GetChildIndexA(const Contact &contact) noexcept
Gets the child index A of the given contact.
Definition: Contact.hpp:609
constexpr auto CubicMeter
Cubic meter unit of volume.
Definition: Units.hpp:359
AngularMomentum GetAngularMotorImpulse(const Joint &object)
Gets the angular motor impulse of the joint if it has this property.
Definition: Joint.cpp:447
constexpr ToiConf & UseMaxRootIters(root_iter_type value) noexcept
Uses the given max root iterations value.
Definition: TimeOfImpact.hpp:127
static PolarCoord< T > Get(const T x, const T y, const UnitVec fallback=GetDefaultFallback()) noexcept
Gets the unit vector & magnitude from the given parameters.
Definition: UnitVec.hpp:126
constexpr auto DefaultVelocityThreshold
Default velocity threshold.
Definition: Settings.hpp:193
Real Normalize(Vec2 &vector)
Converts the given vector into a unit vector and returns its original length.
Definition: Math.hpp:638
size_type free_size() const noexcept
Gets the number of elements currently free.
Definition: ArrayAllocator.hpp:167
constexpr auto & UseMotorSpeed(AngularVelocity v) noexcept
Uses the given motor speed value.
Definition: RevoluteJointConf.hpp:104
Length m_separations[MaxManifoldPoints]
Separations.
Definition: WorldManifold.hpp:56
constexpr bool Contains(const AABB< N > &a, const AABB< N > &b) noexcept
Checks whether the first AABB fully contains the second AABB.
Definition: AABB.hpp:255
Length min_separation
Min separation.
Definition: ContactSolver.hpp:43
Angle maxAngularCorrection
Maximum angular correction.
Definition: StepConf.hpp:187
constexpr auto & UseUpperLength(Length v) noexcept
Uses the given upper translation value.
Definition: PrismaticJointConf.hpp:88
constexpr auto RadianPerSecond
Radian per second unit of angular velocity.
Definition: Units.hpp:384
void FreeNode(Size index) noexcept
Frees the specified node.
Definition: DynamicTree.cpp:483
size_type Allocate(Args &&... args)
Allocates an entry in the array with the given constructor parameters.
Definition: ArrayAllocator.hpp:63
constexpr const Point & operator[](std::size_t i) const
Array indexing operator.
Definition: Manifold.hpp:430
void Update(ContactID id, const ContactUpdateConf &conf)
Updates the touching related state and notifies listener (if one given).
Definition: WorldImpl.cpp:2415
Definition of an independent and simulatable "world".
Definition: World.hpp:129
static constexpr NonNegative< Length > GetDefaultVertexRadius() noexcept
Gets the default vertex radius for the PolygonShapeConf.
Definition: PolygonShapeConf.hpp:45
BodyID m_bodyB
Identifier for body-B.
Definition: VelocityConstraint.hpp:281
constexpr auto InvalidFixtureID
Invalid fixture ID value.
Definition: FixtureID.hpp:33
Vector2< LinearVelocity > LinearVelocity2
2-element vector of linear velocity (LinearVelocity) quantities.
Definition: Vector2.hpp:47
std::uint32_t counter_type
Counter type.
Definition: StepStats.hpp:32
constexpr bool IsOdd(T val) noexcept
Is-odd.
Definition: Math.hpp:153
constexpr BodyConf & UseFixedRotation(bool value) noexcept
Use the given fixed rotation state.
Definition: BodyConf.hpp:252
SeparationScenario GetSeparationScenario(IndexPair3 indices, const DistanceProxy &proxyA, const Transformation &xfA, const DistanceProxy &proxyB, const Transformation &xfB)
Gets a separation finder for the given inputs.
Definition: SeparationScenario.cpp:106
PointStates GetPointStates(const Manifold &manifold1, const Manifold &manifold2) noexcept
Computes the point states given two manifolds.
Definition: Collision.cpp:27
void SetJointDestructionListener(JointListener listener) noexcept
Register a destruction listener for joints.
Definition: WorldImpl.hpp:1009
Constant propagating template wrapper type.
Definition: propagate_const.hpp:47
std::vector< Length2 > m_vertices
Vertices.
Definition: ChainShapeConf.hpp:138
static Manifold GetForFaceA(UnitVec ln, Length2 lp, const Point &mp1) noexcept
Gets a face A typed manifold.
Definition: Manifold.hpp:186
AABB ComputeIntersectingAABB(const World &world, FixtureID fA, ChildCounter iA, FixtureID fB, ChildCounter iB) noexcept
Computes the intersecting AABB for the given pair of fixtures and indexes.
Definition: AABB.cpp:88
value_type & reference
Reference type.
Definition: AllocatedArray.hpp:45
Shape shape
Shape to give the fixture.
Definition: FixtureConf.hpp:87
LimitState limitState
Limit state.
Definition: PrismaticJointConf.hpp:152
::playrho::propagate_const< T > second_argument_type
Second argument type.
Definition: propagate_const.hpp:468
constexpr auto & UseMaxTorque(NonNegative< Torque > v) noexcept
Uses the given max torque value.
Definition: MotorJointConf.hpp:81
~WorldImpl() noexcept
Destructor.
Definition: WorldImpl.cpp:576
Mass mass
Mass.
Definition: RopeJointConf.hpp:94
InvMass3 m_K
Block solver "K" info.
Definition: VelocityConstraint.hpp:271
Chain shape configuration.
Definition: ChainShapeConf.hpp:50
::playrho::propagate_const< T > second_argument_type
Second argument type.
Definition: propagate_const.hpp:496
constexpr Type GetType() const noexcept
Gets the type of this manifold.
Definition: Manifold.hpp:317
bool add(Length2 value)
Adds the given vertex into the set if allowed.
Definition: VertexSet.hpp:59
static constexpr playrho::Fixed< BT, FB > infinity() noexcept
Gets the infinite value for the type.
Definition: FixedLimits.hpp:86
value_type m_min
Min value.
Definition: Interval.hpp:222
bool IsStepComplete() const noexcept
Whether or not "step" is complete.
Definition: World.cpp:86
static constexpr value_type GetHighest() noexcept
Gets the "highest" value supported by the value_type.
Definition: Interval.hpp:62
Length2 GetAnchorB(const World &world, JointID id)
Get the anchor point on body-B in world coordinates.
Definition: WorldJoint.cpp:216
constexpr auto NewtonMeterSecond
Newton meter second unit of angular momentum.
Definition: Units.hpp:418
constexpr underlying_type & get() noexcept
Accesses the underlying value.
Definition: IndexingNamedType.hpp:72
Length2 localAnchorA
Local anchor point relative to body A's origin.
Definition: RevoluteJointConf.hpp:118
friend bool operator!=(const ChainShapeConf &lhs, const ChainShapeConf &rhs) noexcept
Inequality operator.
Definition: ChainShapeConf.hpp:119
PROPAGATE_CONST_CONSTEXPR propagate_const(propagate_const< U > &&pu)
Move constructor.
Definition: propagate_const.hpp:138
constexpr bool operator!() const noexcept
Logical not operator.
Definition: Fixed.hpp:346
@ e_substepping
Sub-stepping.
Definition: WorldImpl.hpp:531
constexpr const_pointer data() const noexcept
Direct access to data.
Definition: Vector.hpp:201
RegStepStats & Update(RegStepStats &lhs, const IslandStats &rhs) noexcept
Updates regular-phase per-step statistics with island statistics.
Definition: StepStats.cpp:29
Angle angularOffset
Angle of body-B minus angle of body-A.
Definition: MotorJointConf.hpp:98
Length2 localAnchorB
The local anchor point relative to body B's origin.
Definition: PulleyJointConf.hpp:97
counter_type sumVelIters
Sum velocity iterations count.
Definition: StepStats.hpp:87
const DynamicTree & GetTree() const noexcept
Gets access to the broad-phase dynamic tree information.
Definition: WorldImpl.hpp:999
size_type size() const noexcept
Gets the size of this instance in number of elements.
Definition: ArrayAllocator.hpp:154
BlockAllocator::size_type size_type
Size type.
Definition: BlockAllocator.hpp:130
void Delete(const T *p, BlockAllocator &allocator)
Deletes the given pointer by calling the pointed-to object's destructor and returning it to the given...
Definition: BlockAllocator.hpp:120
@ e_maxDistIters
Max distance iterations.
Definition: TimeOfImpact.hpp:241
Length2 groundAnchorB
The second ground anchor in world coordinates. This point never moves.
Definition: PulleyJointConf.hpp:91
constexpr const_pointer data() const noexcept
Direct access to data.
Definition: UnitVec.hpp:227
constexpr auto DefaultLinearSleepTolerance
Default linear sleep tolerance.
Definition: Settings.hpp:255
constexpr Acceleration operator+(const Acceleration &lhs, const Acceleration &rhs)
Addition operator.
Definition: Acceleration.hpp:81
DynamicTree() noexcept
Non-throwing default constructor.
size_type GetPointCount() const noexcept
Gets the count of points added to this object.
Definition: VelocityConstraint.hpp:97
void DestroyFixtures(World &world, BodyID id, bool resetMassData)
Destroys fixtures of the identified body.
Definition: WorldBody.cpp:266
constexpr auto operator()(const T &v) -> decltype(!(v<=static_cast< T >(0)), T
Value checking functor.
Definition: NonPositive.hpp:42
Length based logic error.
Definition: LengthError.hpp:33
iteration_type maxToiIters
Max TOI iterations.
Definition: StepConf.hpp:252
Length regMinSeparation
Regular minimum separation.
Definition: StepConf.hpp:94
MovementConf GetMovementConf(const StepConf &conf) noexcept
Gets the movement configuration from the given value.
Definition: MovementConf.cpp:26
constexpr int Compare(const JointKey &lhs, const JointKey &rhs) noexcept
Compares the given joint keys.
Definition: JointKey.hpp:82
constexpr ContactFeature GetVertexVertexContactFeature(ContactFeature::Index a, ContactFeature::Index b) noexcept
Gets the vertex vertex contact feature for the given indices.
Definition: ContactFeature.hpp:60
Length2 localCenter
Local center of mass position.
Definition: Sweep.hpp:105
const_reference operator[](size_type i) const
Indexed operator.
Definition: AllocatedArray.hpp:128
constexpr auto MaxJoints
Maximum number of joints in a world.
Definition: Settings.hpp:234
Trait for detecting that the given type is not this one.
Definition: propagate_const.hpp:94
constexpr UnitVec FlipX() const noexcept
Flips the X value.
Definition: UnitVec.hpp:242
constexpr auto FixedPi
Fixed point pi value.
Definition: FixedMath.hpp:113
std::size_t CountType
Count type.
Definition: GrowableStack.hpp:42
friend bool ShiftOrigin(Joint &object, Length2 value) noexcept
Shifts the origin for any points stored in world coordinates.
Definition: Joint.hpp:298
Length2 GetVertex(ChildCounter index) const
Gets a vertex by index.
Definition: ChainShapeConf.hpp:96
static constexpr playrho::Fixed< BT, FB > max() noexcept
Gets the max value available for the type.
Definition: FixedLimits.hpp:40
void SetTangentSpeed(Contact &contact, LinearVelocity value) noexcept
Sets the desired tangent speed for a conveyor belt behavior.
Definition: Contact.hpp:766
ChainShapeConf()
Default constructor.
InvRotInertia GetInvRotInertia(const Body &body) noexcept
Gets the inverse rotational inertia of the body.
Definition: Body.hpp:979
Frequency GetInvDeltaTime() const noexcept
Gets the inverse delta time.
Definition: WorldImpl.hpp:994
BASE_TYPE value_type
Value type.
Definition: Fixed.hpp:50
void SetImpenetrable(Body &body) noexcept
Sets the impenetrable status of this body.
Definition: Body.hpp:736
constexpr auto NewtonMeter
Newton meter unit of torque.
Definition: Units.hpp:408
bool isfinite(Fixed< BT, FB > value) noexcept
Gets whether the given value is finite.
Definition: FixedMath.hpp:574
constexpr const_reference operator[](size_type pos) const noexcept
Gets a constant reference to the requested element.
Definition: UnitVec.hpp:209
bool RemoveFixture(BodyID id, FixtureID fixture)
Removes the given fixture from the given body.
Definition: WorldImpl.cpp:2331
ContactFeature::Index CfIndex
Contact feature index.
Definition: Manifold.hpp:72
Length2 GetTarget(const Joint &object)
Gets the given joint's target property if it has one.
Definition: Joint.cpp:459
constexpr Point & operator[](std::size_t i)
Array indexing operator.
Definition: Manifold.hpp:427
std::vector< bool > m_islandedContacts
Per contact boolean on whether contact islanded.
Definition: WorldImpl.hpp:868
Per-step statistics.
Definition: StepStats.hpp:116
constexpr auto & UseFrequency(NonNegative< Frequency > v) noexcept
Uses the given frequency.
Definition: DistanceJointConf.hpp:76
friend ::std::size_t hash(const IndexingNamedType &v) noexcept
Hashes the value given.
Definition: IndexingNamedType.hpp:127
Deleter deleter_type
Deleter type.
Definition: AllocatedArray.hpp:60
Unit-interval constrained value checker.
Definition: UnitInterval.hpp:34
Length2 rA
Relative A.
Definition: MotorJointConf.hpp:113
constexpr Fixed & operator/=(Fixed val) noexcept
Division assignment operator.
Definition: Fixed.hpp:476
Positive< Length > minVertexRadius
Minimum vertex radius.
Definition: WorldConf.hpp:53
SizedRange< std::vector< FixtureID >::const_iterator > GetFixtures(const World &world, BodyID id)
Gets the range of all constant fixtures attached to the given body.
Definition: WorldBody.cpp:79
iteration_type toiPositionIterations
TOI position iterations.
Definition: StepConf.hpp:244
FlagGuard(FlagGuard< T > &&value) noexcept=default
Move constructor.
std::uint32_t type
Wider type.
Definition: Wider.hpp:56
constexpr DiskShapeConf(NonNegative< Length > r)
Initializing constructor.
Definition: DiskShapeConf.hpp:52
constexpr UnitVec GetFwdPerpendicular(const UnitVec vector) noexcept
Gets a vector clockwise (forward-clockwise) perpendicular to the given vector.
Definition: UnitVec.hpp:340
AngularVelocity angular
Angular velocity.
Definition: Velocity.hpp:40
Length sAy
Solver A y location.
Definition: WheelJointConf.hpp:138
Template for determining if the given type is an inequality comparable type.
Definition: Templates.hpp:181
dist_iter_type maxDistIters
Max distance iterations.
Definition: StepStats.hpp:99
friend PROPAGATE_CONST_CONSTEXPR bool operator==(const propagate_const &pt, std::nullptr_t)
Equals operator.
Definition: propagate_const.hpp:244
NonNegative< Force > maxForce
Maximum motor force.
Definition: MotorJointConf.hpp:104
AngularAcceleration m_angularAcceleration
Angular acceleration.
Definition: Body.hpp:491
const value_type * const_pointer
Constant pointer type.
Definition: AllocatedArray.hpp:54
static Area GetDefaultMinSeparationSquared()
Gets the default minimum separation squared value.
Definition: VertexSet.hpp:43
size_type m_max_size
Max size. 8-bytes.
Definition: AllocatedArray.hpp:211
constexpr std::enable_if_t<!IsVector< T >::value, Vector< Vector< T, N >, 1 > > GetRowMatrix(Vector< T, N > arg)
Gets the specified row of the given matrix as a row matrix.
Definition: Matrix.hpp:124
Separation information.
Definition: IndexPair.hpp:109
constexpr auto MaxSimplexEdges
Maximum number of supportable edges in a simplex.
Definition: Settings.hpp:88
AABB GetAABB(const RayCastInput &input) noexcept
Gets the AABB for the given ray cast input data. <2>
Definition: AABB.cpp:108
Size m_freeIndex
Free list.
Definition: DynamicTree.hpp:296
std::size_t size_type
Size type.
Definition: StackAllocator.hpp:39
std::remove_const< decltype(DefaultMaxDistanceIters)>::type dist_iter_type
Distance iteration type.
Definition: StepStats.hpp:91
ToiStepStats SolveToi(const StepConf &conf)
Solves the step using successive time of impact (TOI) events.
Definition: WorldImpl.cpp:1255
Fixture definition.
Definition: FixtureConf.hpp:46
void AddPoint(Momentum normalImpulse, Momentum tangentImpulse, Length2 relA, Length2 relB, const std::vector< BodyConstraint > &bodies, Conf conf)
Adds the given point to this contact velocity constraint object.
Definition: VelocityConstraint.cpp:180
friend PROPAGATE_CONST_CONSTEXPR bool operator>=(const U &u, const propagate_const &pu)
Greater-than or equal-to operator.
Definition: propagate_const.hpp:385
T & m_flag
Flag.
Definition: FlagGuard.hpp:67
friend bool operator!=(const PolygonShapeConf &lhs, const PolygonShapeConf &rhs) noexcept
Inequality operator.
Definition: PolygonShapeConf.hpp:119
LinearVelocity bias
Bias.
Definition: WheelJointConf.hpp:145
constexpr Range() noexcept=default
Default constructor.
bool IsMassDataDirty(const Body &body) noexcept
Gets whether the mass data for this body is "dirty".
Definition: Body.hpp:954
FixtureCounter GetShapeCount(const World &world) noexcept
Gets the count of unique shapes in the given world.
Definition: WorldMisc.cpp:125
Size child1
Child 1.
Definition: DynamicTree.hpp:311
virtual BodyID GetBodyB_() const noexcept=0
Gets the ID of body-B.
virtual NonNegative< Length > GetVertexRadius_(ChildCounter idx) const =0
Gets the vertex radius.
constexpr Interval(const std::initializer_list< T > ilist) noexcept
Initializing constructor.
Definition: Interval.hpp:100
size_type m_size
Current size. 8-bytes.
Definition: AllocatedArray.hpp:212
constexpr auto & UseEnableLimit(bool v) noexcept
Uses the given enable limit state value.
Definition: PrismaticJointConf.hpp:74
LinearVelocity2 C
Velocity constant.
Definition: TargetJointConf.hpp:130
constexpr Fixed(double val) noexcept
Initializing constructor.
Definition: Fixed.hpp:156
constexpr T Solve22(const Mat33 &mat, const T b) noexcept
Solves A * x = b, where b is a column vector.
Definition: Math.hpp:499
SizedRange< std::vector< FixtureID >::const_iterator > GetFixturesForProxies(const WorldImpl &world) noexcept
Gets the fixtures-for-proxies range for this world.
Definition: WorldImplMisc.cpp:158
const Point & GetPointAt(size_type index) const
Accesses the point identified by the given index.
Definition: VelocityConstraint.hpp:223
Edge shape configuration.
Definition: EdgeShapeConf.hpp:42
MultiShapeConf & AddConvexHull(const VertexSet &pointSet, NonNegative< Length > vertexRadius=GetDefaultVertexRadius()) noexcept
Creates a convex hull from the given set of local points. The size of the set must be in the range [1...
Definition: MultiShapeConf.cpp:92
void EnableMotor(Joint &object, bool value)
Enables the specified joint's motor property if it supports one.
Definition: Joint.cpp:575
friend NonNegative< Length > GetVertexRadius(const Shape &shape, ChildCounter idx)
Gets the vertex radius of the indexed child of the given shape.
Definition: Shape.hpp:286
AngularMomentum angularMotorImpulse
Motor impulse.
Definition: RevoluteJointConf.hpp:130
constexpr ConstraintSolverConf & UseMaxLinearCorrection(Length value) noexcept
Uses the given max linear correction.
Definition: ConstraintSolverConf.hpp:56
BodyType GetType() const noexcept
Gets the type of this body.
Definition: Body.cpp:111
TimestepIters positionIterations
Position iterations actually performed.
Definition: IslandStats.hpp:38
Length2 GetLinearOffset(const Joint &object)
Gets the linear offset property of the specified joint if its type has one.
Definition: Joint.cpp:593
const_iterator begin() const noexcept
Gets a "begin" iterator.
Definition: Vector.hpp:113
friend bool operator==(const Shape &lhs, const Shape &rhs) noexcept
Equality operator for shape to shape comparisons.
Definition: Shape.hpp:342
const value_type & const_reference
Constant reference type.
Definition: AllocatedArray.hpp:48
void SetUnderActiveTime(Time value) noexcept
Sets the "under-active" time to the given value.
Definition: Body.hpp:602
constexpr TreeNode(TreeNode &&other)=default
Move constructor.
const DynamicTree & GetTree() const noexcept
Gets access to the broad-phase dynamic tree information.
Definition: World.cpp:101
PairLength2 GetWitnessPoints(const Simplex &simplex) noexcept
Gets the witness points of the given simplex.
Definition: Distance.cpp:92
friend Real GetRestitution(const Shape &shape) noexcept
Gets the coefficient of restitution value of the given shape.
Definition: Shape.hpp:299
size_type max_size() const noexcept
Gets the maximum size this array can possibly get to.
Definition: AllocatedArray.hpp:103
Mass22 GetEffectiveMassMatrix(const TargetJointConf &object, const BodyConstraint &body) noexcept
Gets the effective mass matrix for the given configuration and body information.
Definition: TargetJointConf.cpp:51
void ShiftOrigin(Length2 newOrigin)
Shifts the world origin.
Definition: World.cpp:111
PLAYRHO_QUANTITY(boost::units::si::time) Time
Time quantity.
Definition: Units.hpp:140
root_iter_type maxRootIters
Max root iterations.
Definition: StepStats.hpp:101
constexpr UnitVec GetRevPerpendicular() const noexcept
Gets a vector counter-clockwise (reverse-clockwise) perpendicular to this vector.
Definition: UnitVec.hpp:264
LengthIndexPair FindMinSeparation(const SeparationScenario &scenario, const Transformation &xfA, const Transformation &xfB)
Finds the minimum separation.
Definition: SeparationScenario.cpp:169
void EnableMotor(Joint &object, bool value)
Enables the specified joint's motor property if it supports one.
Definition: Joint.cpp:575
size_type m_index
Index.
Definition: StackAllocator.hpp:150
constexpr Mat33 GetInverse22(const Mat33 &value) noexcept
Gets the inverse of the given matrix as a 2-by-2.
Definition: Math.hpp:510
Velocity Cap(Velocity velocity, Time h, const MovementConf &conf) noexcept
Caps velocity.
Definition: Velocity.cpp:28
constexpr auto operator-(const CheckedValue< LhsValueType, LhsCheckerType > &lhs, const CheckedValue< RhsValueType, RhsCheckerType > &rhs) -> decltype(LhsValueType(lhs) - RhsValueType(rhs))
Constrained value subtraction operator.
Definition: CheckedValue.hpp:269
PrismaticJointConf(const PrismaticJointConf ©)=default
Copy constructor.
Fixed< BT, FB > exp(Fixed< BT, FB > arg)
Computes the Euler number raised to the power of the given argument.
Definition: FixedMath.hpp:507
LinearVelocity bias
Bias. 4-bytes (with 4-byte Real).
Definition: DistanceJointConf.hpp:121
const std::vector< ContactCounter > & GetProxies(const WorldImpl &world, FixtureID id)
Gets the dynamic tree leaves awaiting processing for the finding of new contacts.
Definition: WorldImplFixture.cpp:54
constexpr Fixed & operator-=(Fixed val) noexcept
Subtraction assignment operator.
Definition: Fixed.hpp:391
Length GetMaxVertexRadius() const noexcept
Gets the maximum vertex radius that shapes in this world can be.
Definition: World.cpp:121
Wider< BodyCounter >::type ContactCounter
Count type for contacts.
Definition: Settings.hpp:221
NonNegative< Force > maxForce
Maximum friction force.
Definition: FrictionJointConf.hpp:83
T value_type
Element type.
Definition: ArrayAllocator.hpp:37
constexpr bool IsValid(const d2::Manifold &value) noexcept
Gets whether the given manifold is valid.
Definition: Manifold.hpp:624
Length GetTotalRadius() const noexcept
Gets total radius - i.e. combined radius of shapes of fixtures A and B.
Definition: PositionConstraint.hpp:59
Length2 m_wB
Point B in world coordinates. This is the support point in proxy B. 8-bytes.
Definition: SimplexEdge.hpp:70
constexpr bool ShiftOrigin(DistanceJointConf &, Length2) noexcept
Shifts the origin notion of the given configuration.
Definition: DistanceJointConf.hpp:177
auto Average(const T &span)
Computes the average of the given values.
Definition: Math.hpp:176
std::remove_const< decltype(MaxSimplexEdges)>::type size_type
Size type.
Definition: ArrayList.hpp:43
const_reference operator[](size_type pos) const
Constant array index operator.
Definition: ArrayAllocator.hpp:135
void SetSweep(Body &body, const Sweep &value) noexcept
Sets the sweep value of the given body.
Definition: Body.hpp:887
void AddJointsToIsland(Island &island, BodyStack &stack, const BodyJoints &joints)
Adds joints to the island.
Definition: WorldImpl.cpp:912
Manifold GetManifold(bool flipped, const DistanceProxy &shape0, const Transformation &xf0, const VertexCounter idx0, const DistanceProxy &shape1, const Transformation &xf1, const VertexCounter2 indices1, const Manifold::Conf conf)
Gets a face-to-face based manifold.
Definition: Manifold.cpp:114
constexpr BodyConstraint(InvMass invMass, InvRotInertia invRotI, Length2 localCenter, Position position, Velocity velocity) noexcept
Initializing constructor.
Definition: BodyConstraint.hpp:44
auto ModuloViaFmod(T dividend, T divisor) noexcept
Modulo operation using std::fmod.
Definition: Math.hpp:254
Manifold CollideShapes(const DistanceProxy &shapeA, const Transformation &xfA, const DistanceProxy &shapeB, const Transformation &xfB, Manifold::Conf conf)
Calculates the relevant collision manifold.
Definition: Manifold.cpp:402
static void noop_deleter(void *)
No-op deleter method.
Definition: AllocatedArray.hpp:209
ContactCounter GetContactRange() const noexcept
Gets the extent of the currently valid contact range.
Definition: World.cpp:146
void SetMassDataDirty() noexcept
Sets this body to have the mass data dirty state.
Definition: Body.hpp:661
void SetBeginContactListener(WorldImpl &world, std::function< void(ContactID)> listener) noexcept
Registers a begin contact event listener.
Definition: WorldImplMisc.cpp:63
NonNegative< Length > tolerance
Tolerance.
Definition: TimeOfImpact.hpp:93
void SetPostSolveContactListener(ImpulsesContactListener listener) noexcept
Registers a post-solve contact event listener.
Definition: World.cpp:71
const Area m_minSepSquared
Minimum length squared. sizeof(Vec2)/2 or 4-bytes.
Definition: VertexSet.hpp:111
std::remove_const< decltype(DefaultMaxToiIters)>::type toi_iter_type
TOI iteration type.
Definition: StepStats.hpp:94
void SetEndContactListener(ContactListener listener) noexcept
Registers an end contact event listener.
Definition: World.cpp:61
constexpr Vector()=default
Default constructor.
counter_type contactsAtMaxSubSteps
Contacts at max substeps count.
Definition: StepStats.hpp:80
Real time
Time factor in range of [0,1] into the future.
Definition: TimeOfImpact.hpp:256
Fixed< BT, FB > log(Fixed< BT, FB > arg)
Computes the natural logarithm of the given argument.
Definition: FixedMath.hpp:499
AngularVelocity bias
Bias.
Definition: WeldJointConf.hpp:106
Gear joint definition.
Definition: GearJointConf.hpp:55
Real GetFriction(const Shape &shape) noexcept
Gets the coefficient of friction.
Definition: Shape.hpp:294
constexpr auto DefaultMaxToiRootIters
Default maximum time of impact root iterator count.
Definition: Settings.hpp:177
size_type const m_max_entries
Max entries.
Definition: StackAllocator.hpp:148
Configuration data for velocity constraints.
Definition: VelocityConstraint.hpp:52
Momentum2 m_impulses[MaxManifoldPoints]
Impulses.
Definition: WorldManifold.hpp:52
std::remove_const< decltype(DefaultMaxToiRootIters)>::type root_iter_type
Root iterations type.
Definition: TimeOfImpact.hpp:168
Vector2< Momentum > Momentum2
2-element vector of Momentum quantities.
Definition: Vector2.hpp:65
Mass GetTangentMassAtPoint(const VelocityConstraint &vc, VelocityConstraint::size_type index)
Gets the tangent mass at the given point from the given velocity constraint.
Definition: VelocityConstraint.hpp:416
std::pair< value_type, value_type > pair_type
Internal pair type.
Definition: Interval.hpp:213
FixtureConf & UseShape(Shape value) noexcept
Uses the given value for the shape member variable.
Definition: FixtureConf.hpp:48
T * AllocateArray(size_type size)
Allocates and array of the given size number of elements.
Definition: StackAllocator.hpp:80
Block * next
Next block.
Definition: BlockAllocator.cpp:107
LinearVelocity velocityThreshold
Velocity threshold.
Definition: VelocityConstraint.hpp:54
static element_type * get_pointer(U &u)
Gets pointer.
Definition: propagate_const.hpp:76
bool enabled
Whether or not the body is enabled.
Definition: BodyConf.hpp:163
static constexpr Length2 DefaultGroundAnchorA
Default ground anchor A.
Definition: PulleyJointConf.hpp:60
Velocity GetVelocity() const noexcept
Gets the velocity of the body.
Definition: BodyConstraint.hpp:117
std::function< RayCastOpcode(BodyID body, FixtureID fixture, ChildCounter child, Length2 point, UnitVec normal)> FixtureRayCastCB
Ray cast callback function signature.
Definition: RayCastOutput.hpp:104
Mass data.
Definition: MassData.hpp:41
auto GetTangentSpeed(const Contact &contact) noexcept
Gets the desired tangent speed.
Definition: Contact.hpp:757
Length2 GetPointRelPosB(size_type index) const noexcept
Gets the point relative position of B.
Definition: VelocityConstraint.hpp:323
constexpr auto GetType1(const GearJointConf &object) noexcept
Free function for getting joint 1 type value of the given configuration.
Definition: GearJointConf.hpp:226
ContactID GetContactPtr(KeyedContactPtr value)
Gets the contact ID for the given value.
Definition: KeyedContactID.hpp:37
bool IsAwake() const noexcept
Gets the awake/asleep state of this body.
Definition: Body.hpp:592
constexpr auto Cross(T1 a, T2 b) noexcept
Performs the 2-element analog of the cross product of two vectors.
Definition: Math.hpp:404
Has-type trait template class.
Definition: Templates.hpp:232
bool IsMaxTranslationWithinTolerance(const StepConf &conf) noexcept
Determines whether the maximum translation is within tolerance.
Definition: StepConf.cpp:27
std::int16_t type
Wider type.
Definition: Wider.hpp:41
const FixtureConf & GetFixture(FixtureID id) const
Gets the identified fixture state.
Definition: World.cpp:201
NonNegative< RotInertia > I
Rotational inertia, a.k.a. moment of inertia.
Definition: MassData.hpp:51
constexpr Acceleration & operator/=(Acceleration &lhs, const Real rhs)
Division assignment operator.
Definition: Acceleration.hpp:63
decltype(check< Type >(0)) type
Type alias for given template parameters.
Definition: Templates.hpp:408
Wider< toi_iter_type >::type toi_sum_type
TOI iterations sum type.
Definition: TimeOfImpact.hpp:171
NonNegative< Torque > maxTorque
Maximum friction torque.
Definition: FrictionJointConf.hpp:86
constexpr auto DegreePerSquareSecond
Degree per square second unit of angular acceleration.
Definition: Units.hpp:399
constexpr CountType size() const noexcept
Gets the current size in numbers of elements.
Definition: GrowableStack.hpp:111
Size GetNodeCapacity() const noexcept
Gets the current node capacity of this tree.
Definition: DynamicTree.hpp:562
data_type data
Data.
Definition: Joint.hpp:470
Length2 m_wA
Point A in world coordinates. This is the support point in proxy A. 8-bytes.
Definition: SimplexEdge.hpp:69
std::size_t size(const DynamicTree &tree) noexcept
Gets the "size" of the given tree.
Definition: DynamicTree.hpp:773
virtual bool IsEqual_(const Concept &other) const noexcept=0
Equality checking method.
Force GetMotorForce(const World &world, JointID id, Frequency inv_dt)
Gets the current motor force for the given joint, given the inverse time step.
Definition: WorldJoint.hpp:272
Length sBx
Solver B x location.
Definition: WheelJointConf.hpp:137
PolygonShapeConf & UseVertices(const std::vector< Length2 > &verts) noexcept
Uses the given vertices.
Definition: PolygonShapeConf.cpp:69
auto GetAllocation() const noexcept
Gets the total number of bytes that this object has currently allocated.
Definition: StackAllocator.hpp:118
std::vector< bool > m_islandedBodies
Per body boolean on whether body islanded.
Definition: WorldImpl.hpp:867
friend PROPAGATE_CONST_CONSTEXPR bool operator>(const propagate_const &pt, const U &u)
Greater-than operator.
Definition: propagate_const.hpp:329
void InternalDestroy(ContactID contact, const Body *from=nullptr)
Destroys the given contact.
Definition: WorldImpl.cpp:1801
constexpr auto operator()() noexcept(noexcept(static_cast< T >(0))) -> decltype(static_cast< T >(0))
Valid value supplying functor.
Definition: Finite.hpp:40
Angle referenceAngle2
Reference angle of joint 2. Used when type2 is Revolute.
Definition: GearJointConf.hpp:94
constexpr auto & UseFrequency(NonNegative< Frequency > v) noexcept
Uses the given frequency value.
Definition: WheelJointConf.hpp:89
constexpr BodyConf & UseBullet(bool value) noexcept
Use the given bullet state.
Definition: BodyConf.hpp:258
constexpr std::enable_if_t< std::is_pointer< U >::value, U > operator->() const
Member of pointer operator available for pointer ValueType.
Definition: CheckedValue.hpp:104
constexpr bool TestOverlap(const AABB< N > &a, const AABB< N > &b) noexcept
Tests for overlap between two axis aligned bounding boxes.
Definition: AABB.hpp:187
PROPAGATE_CONST_CONSTEXPR const element_type * operator->() const
Member-of operator support.
Definition: propagate_const.hpp:189
PROPAGATE_CONST_CONSTEXPR element_type & operator*()
Indirection operator support.
Definition: propagate_const.hpp:218
Mass3 m_normalMass
Normal mass information.
Definition: VelocityConstraint.hpp:278
UnitVec GetNormal(const VelocityConstraint &vc) noexcept
Gets the normal of the velocity constraint contact in world coordinates.
Definition: VelocityConstraint.hpp:377
void SetMassData(World &world, BodyID id, const MassData &massData)
Sets the mass properties to override the mass properties of the fixtures.
Definition: WorldBody.cpp:365
Base joint definition class.
Definition: JointConf.hpp:34
Size AllocateNode() noexcept
Allocates a node.
Definition: DynamicTree.cpp:473
void SetEndContactListener(WorldImpl &world, std::function< void(ContactID)> listener) noexcept
Registers an end contact event listener.
Definition: WorldImplMisc.cpp:68
root_iter_type max_root_iters
Max. root finder iterations for all TOI iterations.
Definition: TimeOfImpact.hpp:187
constexpr auto DefaultLinearSlop
Default linear slop.
Definition: Settings.hpp:134
CountType m_capacity
Capacity for storing elements.
Definition: GrowableStack.hpp:132
void SetMass(Body &body, Mass mass)
Sets the mass of the given body.
Definition: Body.hpp:1090
constexpr bool IsIntersecting(const Interval< T > &a, const Interval< T > &b) noexcept
Checks whether two value ranges have any intersection/overlap at all.
Definition: Interval.hpp:251
bool enableLimit
Enable/disable the joint limit.
Definition: PrismaticJointConf.hpp:135
static constexpr auto GetLinearSlop() noexcept
Gets the linear slop.
Definition: Settings.hpp:50
BodyID body
Identifier of the associated body.
Definition: DynamicTree.hpp:333
Torque GetMotorTorque(const Joint &joint, Frequency inv_dt)
Gets the current motor torque for the given joint given the inverse time step.
Definition: Joint.hpp:791
constexpr Fixed(long val) noexcept
Initializing constructor.
Definition: Fixed.hpp:198
bool Awaken(Body &body) noexcept
Awakens the body if it's asleep.
Definition: Body.hpp:1056
RopeJointConf GetRopeJointConf(const Joint &joint) noexcept
Gets the definition data for the given joint.
Definition: RopeJointConf.cpp:46
const Contact & GetContact(ContactID id) const
Gets the identified contact.
Definition: World.cpp:246
ChildCounter childIndex
Child index of related Shape.
Definition: DynamicTree.hpp:339
constexpr BodyConf & UseLinearVelocity(LinearVelocity2 v) noexcept
Use the given linear velocity.
Definition: BodyConf.hpp:198
constexpr Interval< T > GetIntersection(Interval< T > a, const Interval< T > &b) noexcept
Gets the intersecting interval of two given ranges.
Definition: Interval.hpp:261
constexpr const_reference operator[](size_type pos) const noexcept
Gets a constant reference to the requested element.
Definition: Vector.hpp:166
bool empty() const noexcept
Determines whether this array is empty.
Definition: AllocatedArray.hpp:109
Mass22 linearMass
2-by-2 linear mass matrix in kilograms.
Definition: FrictionJointConf.hpp:95
const_iterator cend() const noexcept
Gets an "end" iterator.
Definition: UnitVec.hpp:180
constexpr Fixed(unsigned long long val) noexcept
Initializing constructor.
Definition: Fixed.hpp:170
void clear() noexcept
Clears this array.
Definition: AllocatedArray.hpp:187
void SetFixture(WorldImpl &world, FixtureID id, const FixtureConf &value)
Sets the identified fixture's state.
Definition: WorldImplFixture.cpp:44
Solution for position constraint.
Definition: ContactSolver.hpp:40
static constexpr value_type GetLowest() noexcept
Gets the "lowest" value supported by the value_type.
Definition: Interval.hpp:54
constexpr Interval & ExpandEqually(const NonNegative< value_type > &v) noexcept
Expands equally both ends of this interval.
Definition: Interval.hpp:201
ContactFeature contactFeature
Contact feature.
Definition: Manifold.hpp:143
friend PROPAGATE_CONST_CONSTEXPR bool operator!=(std::nullptr_t, const propagate_const &pu)
Not-equals operator.
Definition: propagate_const.hpp:259
Island solver statistics.
Definition: IslandStats.hpp:31
BodyID GetBodyB(const Contact &contact) noexcept
Gets the body B ID of the given contact.
Definition: Contact.hpp:588
Length upperTranslation
The upper translation limit.
Definition: PrismaticJointConf.hpp:141
Physical entity that exists within a World.
Definition: Body.hpp:71
size_type max_size() const noexcept
Gets the maximum theoretical size this instance can have in number of elements.
Definition: ArrayAllocator.hpp:160
Type
Manifold type.
Definition: Manifold.hpp:82
constexpr auto StripUnit(const T &v) -> decltype(StripUnit(v.get()))
Strips the unit from the given value.
Definition: Math.hpp:121
constexpr size_type size() const noexcept
Gets the size in number of simplex edges that this instance is made up of.
Definition: Simplex.hpp:195
Frequency GetLinearDamping(const Body &body) noexcept
Gets the linear damping of the body.
Definition: Body.hpp:987
RotInertia GetLocalRotInertia(const Body &body) noexcept
Gets the rotational inertia of the body about the local origin.
Definition: Body.hpp:1139
static constexpr auto TotalBits
Total number of bits.
Definition: Fixed.hpp:53
void SetMaxMotorForce(Joint &object, Force value)
Sets the given joint's max motor force if its type supports that.
Definition: Joint.cpp:341
NonNegative< Frequency > m_linearDamping
Linear damping. 4-bytes.
Definition: Body.hpp:504
BodyID GetBodyB_() const noexcept override
Gets the ID of body-B.
Definition: Joint.hpp:433
@ e_faceB
Face-B type.
Definition: Manifold.hpp:112
constexpr auto DefaultMaxToiIters
Default maximum time of impact iterations.
Definition: Settings.hpp:174
constexpr auto Degree
Degree unit of angle quantity.
Definition: Units.hpp:374
std::vector< BodyConstraint > BodyConstraints
Collection of body constraints.
Definition: WorldImpl.cpp:98
void SetPreSolveContactListener(ManifoldContactListener listener) noexcept
Registers a pre-solve contact event listener.
Definition: World.cpp:66
constexpr Sweep(const Position p0, const Position p1, const Length2 lc=Length2{0_m, 0_m}, Real a0=0) noexcept
Initializing constructor.
Definition: Sweep.hpp:51
BodyID GetBodyA() const noexcept
Gets body A.
Definition: PositionConstraint.hpp:47
constexpr Fixed< BT, FB > cos(Fixed< BT, FB > arg)
Computes the cosine of the given argument via Maclaurin series approximation.
Definition: FixedMath.hpp:247
constexpr auto Solve(const Matrix22< U > mat, const Vector2< T > b) noexcept
Solves A * x = b, where b is a column vector.
Definition: Math.hpp:456
Wider< root_iter_type >::type root_sum_type
Root iterations sum type.
Definition: TimeOfImpact.hpp:177
const_pointer cbegin() const noexcept
Gets the "begin" iterator value.
Definition: Span.hpp:83
constexpr AABB< N > GetIntersectingAABB(const AABB< N > &a, const AABB< N > &b) noexcept
Gets the intersecting AABB of the two given AABBs'.
Definition: AABB.hpp:201
Position solver manifold.
Definition: PositionSolverManifold.hpp:36
FixtureID fixture
Identifier of the associated Fixture.
Definition: DynamicTree.hpp:336
auto GetChunkCount() const noexcept
Gets the chunk count.
Definition: BlockAllocator.hpp:102
Real GetRestitution_() const noexcept override
Gets the restitution.
Definition: Shape.hpp:464
std::enable_if_t<!std::is_same_v< DecayedType, Shape >, DecayedType > DecayedTypeIfNotSelf
Decayed type if not same as this class.
Definition: Shape.hpp:190
void UnsetImpenetrable() noexcept
Unsets the impenetrable status of this body.
Definition: Body.hpp:574
Simplex simplex
Simplex.
Definition: Distance.hpp:84
bool GetCollideConnected(const Joint &object) noexcept
Gets collide connected.
Definition: Joint.hpp:293
constexpr BodyConf & UseUnderActiveTime(Time v) noexcept
Use the given under active time.
Definition: BodyConf.hpp:234
constexpr auto MaxManifoldPoints
Maximum manifold points. This is the maximum number of contact points between two convex shapes....
Definition: Settings.hpp:112
LengthInterval ranges[N]
Holds the value range of each dimension from 0 to N-1.
Definition: AABB.hpp:111
LinearVelocity2 m_linearVelocity
Linear velocity.
Definition: Body.hpp:479
RotInertia GetAngularMass(const Joint &object)
Gets the given joint's angular mass.
Definition: Joint.cpp:287
Simplex::Cache cache
Cache.
Definition: Distance.hpp:56
constexpr bool AlmostEqual(Fixed< BT, FB > x, Fixed< BT, FB > y, int ulp=2)
Determines whether the given two values are "almost equal".
Definition: Fixed.hpp:675
Model(T &&arg) noexcept(std::is_nothrow_move_constructible_v< T >)
Initializing constructor.
Definition: Joint.hpp:385
std::vector< bool > m_islandedJoints
Per joint boolean on whether joint islanded.
Definition: WorldImpl.hpp:869
constexpr Span(pointer array, size_type size) noexcept
Initializing constructor.
Definition: Span.hpp:61
value_type & reference
Reference type.
Definition: ArrayList.hpp:49
void SetFixedRotation(Body &body, bool value)
Sets this body to have fixed rotation.
Definition: Body.hpp:947
Function object for performing lexicographical greater-than or equal-to comparisons of containers.
Definition: Templates.hpp:335
bool GetSubStepping() const noexcept
Gets whether or not sub-stepping is enabled.
Definition: WorldImpl.hpp:957
constexpr std::enable_if_t<!IsVector< T >::value, Matrix< T, N, N > > GetIdentityMatrix()
Gets the identity matrix of the template type and size.
Definition: Matrix.hpp:102
DistanceJointConf GetDistanceJointConf(const Joint &joint) noexcept
Gets the definition data for the given joint.
Definition: DistanceJointConf.cpp:68
Angle value_type
Value type.
Definition: CheckedValue.hpp:68
ContactFeature cf
Contact feature information. 4-bytes.
Definition: Collision.hpp:71
constexpr auto operator()() noexcept -> decltype(T())
Valid value supplying functor.
Definition: CheckedValue.hpp:42
Length2 localAnchorB
Local anchor B.
Definition: GearJointConf.hpp:86
void Clear() noexcept
Clears the dynamic tree.
Definition: DynamicTree.cpp:497
reference back() noexcept
Gets a reference to the "back" element of this array.
Definition: AllocatedArray.hpp:172
BodyID GetBodyA(const Contact &contact) noexcept
Gets the body A ID of the given contact.
Definition: Contact.hpp:581
const_iterator cbegin() const noexcept
Gets a "begin" iterator.
Definition: Vector.hpp:119
const value_type * const_pointer
Constant pointer type.
Definition: ArrayList.hpp:58
void SetTangentImpulseAtPoint(VelocityConstraint &vc, VelocityConstraint::size_type index, Momentum value)
Sets the tangent impulse at the given point of the given velocity constraint.
Definition: VelocityConstraint.hpp:455
void UnsetAwake(Body &body) noexcept
Sets this body to asleep if sleeping is allowed.
Definition: Body.hpp:837
@ e_faceA
Face-A type.
Definition: Manifold.hpp:104
void SetFriction(Contact &contact, Real value) noexcept
Sets the friction value for the identified contact.
Definition: Contact.hpp:728
constexpr auto GetMagnitudeSquared(T value) noexcept
Gets the square of the magnitude of the given iterable value.
Definition: Math.hpp:314
Frequency GetAngularDamping() const noexcept
Gets the angular damping of the body.
Definition: Body.hpp:554
std::enable_if_t< IsArithmetic< T >::value, T > RoundOff(T value, unsigned precision=100000)
Computes the rounded value of the given value.
Definition: Math.hpp:193
T type
Type alias revealing the actual element type of the given Vector.
Definition: Vector.hpp:567
constexpr void Assign(const BranchData &v, const AABB &bb, Height h) noexcept
Assigns the node as a "branch" value.
Definition: DynamicTree.hpp:519
Angle GetReferenceAngle(const Joint &object)
Gets the reference angle of the joint if it has one.
Definition: Joint.cpp:215
void SetSleepingAllowed(bool flag) noexcept
Sets whether or not this body is allowed to sleep.
Definition: Body.hpp:639
Builder configuration structure.
Definition: ShapeConf.hpp:70
Size m_other
Index to "other" node.
Definition: DynamicTree.hpp:547
void ResetRestitution(World &world, ContactID id)
Resets the restitution to the default value.
Definition: WorldContact.hpp:233
~DynamicTree() noexcept
Destroys the tree, freeing the node pool.
Definition: DynamicTree.cpp:438
constexpr AABB GetAABB() const noexcept
Gets the node's AABB.
Definition: DynamicTree.hpp:466
const Length2 * m_vertices
Vertices.
Definition: DistanceProxy.hpp:184
counter_type sumPosIters
Sum position iterations count.
Definition: StepStats.hpp:86
ChainShapeConf & Add(Length2 vertex)
Adds the given vertex.
Definition: ChainShapeConf.cpp:84
constexpr BodyConf & UseLocation(Length2 l) noexcept
Use the given location.
Definition: BodyConf.hpp:172
void Free(void *p) noexcept
Frees the given pointer.
Definition: StackAllocator.cpp:90
bool IsEnabled(const Body &body) noexcept
Gets the enabled/disabled state of the body.
Definition: Body.hpp:771
static constexpr value_type GetFromUnsignedInt(T val) noexcept
Gets the value from an unsigned integral value.
Definition: Fixed.hpp:138
bool signbit(Fixed< BT, FB > value) noexcept
Determines whether the given value is negative.
Definition: FixedMath.hpp:558
Length s2
Location S-2.
Definition: PrismaticJointConf.hpp:158
void SetInvMass(InvMass v) noexcept
Sets the inverse mass.
Definition: Body.hpp:212
constexpr UnitVec operator-() const noexcept
Negation operator.
Definition: UnitVec.hpp:281
PLAYRHO_QUANTITY(boost::units::si::angular_acceleration) AngularAcceleration
Angular acceleration quantity.
Definition: Units.hpp:235
Length2 relA
Position of body A relative to world manifold point.
Definition: VelocityConstraint.hpp:189
data_type data
Data.
Definition: Shape.hpp:503
constexpr Fixed(long long val) noexcept
Initializing constructor.
Definition: Fixed.hpp:191
void CreateAndDestroyProxies(Length extension)
Creates and destroys proxies.
Definition: WorldImpl.cpp:2174
ArrayAllocator< Fixtures > m_bodyFixtures
Cache of fixtures associated with bodies.
Definition: WorldImpl.hpp:842
constexpr friend bool operator>(const IndexingNamedType &lhs, const IndexingNamedType &rhs)
Greater-than operator.
Definition: IndexingNamedType.hpp:109
constexpr IndexingNamedType(const underlying_type &value) noexcept(std::is_nothrow_copy_constructible< underlying_type >::value)
Copy initializing constructor.
Definition: IndexingNamedType.hpp:51
Angle angular
Angular position.
Definition: Position.hpp:39
constexpr Span(U &value) noexcept
Initializing constructor.
Definition: Span.hpp:72
LimitState GetLimitState(const Joint &object)
Definition: Joint.cpp:631
PolygonShapeConf & Set(Span< const Length2 > verts) noexcept
Sets the vertices to a convex hull of the given ones.
Definition: PolygonShapeConf.cpp:104
Matrix33< Real > Mat33
3 by 3 matrix of Real elements.
Definition: Matrix.hpp:194
friend BodyID GetBodyA(const Joint &object) noexcept
Gets the first body attached to this joint.
Definition: Joint.hpp:283
ElementType m_array[N]
Array data.
Definition: GrowableStack.hpp:129
bool operator>(const AABB< N > &lhs, const AABB< N > &rhs) noexcept
Greater-than operator.
Definition: AABB.hpp:164
std::vector< BodyConstraint > BodyConstraintsMap
Type alias for body constraints mapping.
Definition: Joint.hpp:155
Polygon shape configuration.
Definition: PolygonShapeConf.hpp:42
virtual Real GetFriction_() const noexcept=0
Gets the friction.
constexpr WeldJointConf()=default
Default constructor.
Real GetDefaultFriction(const FixtureConf &fixtureA, const FixtureConf &fixtureB)
Gets the default friction amount for the given fixtures.
Definition: FixtureConf.cpp:41
Momentum maxIncImpulse
Maximum incremental impulse.
Definition: IslandStats.hpp:33
Template for determining if the given types are multipliable.
Definition: Templates.hpp:197
bool IsMotorEnabled(const Joint &object)
Gets the specified joint's motor property value if it supports one.
Definition: Joint.cpp:560
counter_type proxiesMoved
Proxies moved count.
Definition: StepStats.hpp:85
Fixed< BT, FB > round(Fixed< BT, FB > value) noexcept
Rounds the given value.
Definition: FixedMath.hpp:548
Internal model configuration concept.
Definition: Joint.hpp:375
Time of impact configuration.
Definition: TimeOfImpact.hpp:52
static Manifold GetForFaceA(UnitVec ln, Length2 lp, const Point &mp1, const Point &mp2) noexcept
Gets a face A typed manifold.
Definition: Manifold.hpp:198
bool isnormal(Fixed< BT, FB > arg)
Gets whether the given value is normal - i.e. not 0 nor infinite.
Definition: FixedMath.hpp:401
StackAllocator(Conf config=GetDefaultConf())
Initializing constructor.
Definition: StackAllocator.cpp:39
constexpr ConcreteConf & UseFriction(NonNegative< Real > value) noexcept
Uses the given friction.
Definition: ShapeConf.hpp:95
constexpr auto Meter
Meter unit of Length.
Definition: Units.hpp:337
Momentum impulse
Impulse. 4-bytes (with 4-byte Real).
Definition: DistanceJointConf.hpp:113
DistanceProxy GetChild(ChildCounter index) const
Gets the "child" shape at the given index.
Definition: ChainShapeConf.cpp:142
Has-functor trait template fallback class.
Definition: Templates.hpp:386
const_iterator begin() const
Gets the "begin" iterator value for this array.
Definition: AllocatedArray.hpp:147
static constexpr auto ChunkSize
Chunk size.
Definition: BlockAllocator.hpp:47
@ e_maxRootIters
Max root iterations.
Definition: TimeOfImpact.hpp:226
FlagGuard< T > & operator=(const FlagGuard< T > &value)=delete
Copy assignment operator is deleted.
Length distance
Separation.
Definition: IndexPair.hpp:137
Real value_type
Value type.
Definition: ArrayList.hpp:46
Array list.
Definition: ArrayList.hpp:40
ContactCounter Size
Size type.
Definition: DynamicTree.hpp:75
Length2 GetPointRelPosA(size_type index) const noexcept
Gets the point relative position of A.
Definition: VelocityConstraint.hpp:318
Variant data.
Definition: DynamicTree.hpp:361
TypeID GetType_() const noexcept override
Gets the use type information.
Definition: Shape.hpp:482
void SetPointImpulses(size_type index, Momentum n, Momentum t)
Sets the point impulses for the given index.
Definition: Manifold.hpp:368
ChildCounter GetNextIndex(const ChainShapeConf &shape, ChildCounter index) noexcept
Gets the next index after the given index for the given shape.
Definition: ChainShapeConf.hpp:176
constexpr auto & UseMaxForce(NonNegative< Force > v) noexcept
Uses the given maximum force value.
Definition: FrictionJointConf.hpp:63
constexpr auto & UseMaxMotorTorque(Torque v) noexcept
Uses the given max motor toque value.
Definition: WheelJointConf.hpp:75
bool SolveVelocity(DistanceJointConf &object, std::vector< BodyConstraint > &bodies, const StepConf &)
Solves velocity constraint.
Definition: DistanceJointConf.cpp:164
virtual void InitVelocity_(BodyConstraintsMap &bodies, const playrho::StepConf &step, const ConstraintSolverConf &conf)=0
Initializes the velocities for this joint.
constexpr auto DegreePerSecond
Degree per second unit of angular velocity.
Definition: Units.hpp:389
Angle referenceAngle1
Reference angle of joint 1. Used when type1 is Revolute.
Definition: GearJointConf.hpp:93
constexpr bool operator==(const AABB< N > &lhs, const AABB< N > &rhs) noexcept
Gets whether the two AABB objects are equal.
Definition: AABB.hpp:118
bool has_value() const noexcept
Checks whether this instance contains a value.
Definition: Joint.hpp:256
constexpr auto SquareMeter
Square meter unit of area.
Definition: Units.hpp:356
constexpr BodyConf & UseAllowSleep(bool value) noexcept
Use the given allow sleep value.
Definition: BodyConf.hpp:240
friend NonNegative< AreaDensity > GetDensity(const Shape &shape) noexcept
Gets the density of the given shape.
Definition: Shape.hpp:304
constexpr Vec2 GetVec2(const Vector2< Real > value)
Gets the given value as a 2-element vector of reals (Vec2).
Definition: Vector2.hpp:68
static Manifold GetForCircles(Length2 vA, CfIndex iA, Length2 vB, CfIndex iB) noexcept
Gets a circles-typed manifold with one point.
Definition: Manifold.hpp:165
IndexPair3 GetIndexPairs(const SimplexEdges &collection) noexcept
Gets index pairs for the given edges collection.
Definition: Simplex.cpp:25
Momentum GetTangentImpulseAtPoint(size_type index) const noexcept
Gets the tangent impulse at the given point.
Definition: VelocityConstraint.hpp:348
friend std::add_pointer_t< std::add_const_t< T > > TypeCast(const Shape *value) noexcept
Converts the given shape into its current configuration value.
Definition: Shape.hpp:610
constexpr auto MaxContacts
Maximum number of contacts in a world (2147319811).
Definition: Settings.hpp:230
Length GetLinearUpperLimit(const Joint &object)
Gets the upper linear joint limit.
Definition: Joint.cpp:487
constexpr bool empty(IndexPair3 pairs) noexcept
Checks whether the given collection of index pairs is empty.
Definition: IndexPair.hpp:69
iteration_type regVelocityIterations
Regular velocity iterations.
Definition: StepConf.hpp:218
static constexpr UnitVec GetTopRight() noexcept
Gets the 45 degree unit vector.
Definition: UnitVec.hpp:99
Length2 localAnchorB
The local anchor point relative to body B's origin.
Definition: WheelJointConf.hpp:106
Size child2
Child 2.
Definition: DynamicTree.hpp:312
constexpr auto to_underlying(T value) noexcept -> underlying_type_t< T >
Converts the given value to the value as the underlying type.
Definition: IndexingNamedType.hpp:183
constexpr auto DefaultStepFrequency
Default step frequency.
Definition: Settings.hpp:245
Data for a point of collision in a Manifold.
Definition: Manifold.hpp:126
constexpr T GetCenter(const Interval< T > &v) noexcept
Gets the center of the given interval.
Definition: Interval.hpp:242
Length2 m_localCenter
Local center of the associated body's sweep.
Definition: BodyConstraint.hpp:89
UnitVec m_normal
world vector pointing from A to B
Definition: WorldManifold.hpp:43
Length2 linearOffset
Position of body-B minus the position of body-A, in body-A's frame.
Definition: MotorJointConf.hpp:95
constexpr AABB< N > GetEnclosingAABB(AABB< N > a, const AABB< N > &b)
Gets the AABB that minimally encloses the given AABBs.
Definition: AABB.hpp:349
constexpr value_type GetMin() const noexcept
Gets the minimum value of this range.
Definition: Interval.hpp:129
static constexpr bool IsLeaf(Height value) noexcept
Gets whether the given height is the height for a "leaf" node.
Definition: DynamicTree.hpp:110
Array allocator.
Definition: ArrayAllocator.hpp:34
static constexpr Length2 DefaultLocalAnchorB
Default local anchor B.
Definition: PulleyJointConf.hpp:69
UnitVec GetLocalXAxisA(const Joint &object)
Gets the given joint's local X axis A if its type supports that.
Definition: Joint.cpp:230
data_type * pointer
Pointer type.
Definition: Span.hpp:47
std::unique_ptr< Concept > Clone_() const override
Clones this concept and returns a pointer to a mutable copy.
Definition: Joint.hpp:391
constexpr auto DefaultRegMinMomentum
Default regular-phase minimum momentum.
Definition: Settings.hpp:196
pointer iterator
Iterator alias.
Definition: AllocatedArray.hpp:63
constexpr auto operator<(const CheckedValue< LhsValueType, LhsCheckerType > &lhs, const CheckedValue< RhsValueType, RhsCheckerType > &rhs) -> decltype(LhsValueType(lhs)< RhsValueType(rhs))
Constrained value less-than operator.
Definition: CheckedValue.hpp:199
Angle referenceAngle
The body-B angle minus body-A angle in the reference state (radians).
Definition: WeldJointConf.hpp:90
void SetLinearLimits(Joint &object, Length lower, Length upper)
Sets the joint limits.
Definition: Joint.cpp:496
An "is valid joint type" trait.
Definition: Joint.hpp:481
::playrho::propagate_const< T > second_argument_type
Second argument type.
Definition: propagate_const.hpp:440
DistanceProxy(const NonNegative< Length > vertexRadius, const VertexCounter count, const Length2 *vertices, const UnitVec *normals) noexcept
Initializing constructor.
Definition: DistanceProxy.hpp:104
JointID CreateJoint(const Joint &def)
Creates a joint to constrain one or more bodies.
Definition: WorldImpl.cpp:729
Shape(T &&arg)
Initializing constructor.
Definition: Shape.hpp:219
TOIOutput(Real t, Statistics s, State z) noexcept
Initializing constructor.
Definition: TimeOfImpact.hpp:254
static constexpr auto GetMaxVertexRadius() noexcept
Gets the max vertex radius.
Definition: Settings.hpp:78
Mat33 K
K matrix.
Definition: PrismaticJointConf.hpp:161
UnitVec GetTangent() const noexcept
Gets the tangent.
Definition: VelocityConstraint.hpp:91
Filter GetFilterData(const FixtureConf &conf) noexcept
Gets the filter-data of the given configuration.
Definition: FixtureConf.hpp:168
inline ::std::ostream & operator<<(::std::ostream &os, const ContactFeature &value)
Stream output operator.
Definition: ContactFeature.hpp:124
PROPAGATE_CONST_CONSTEXPR propagate_const & operator=(propagate_const &&p)=default
Move assignment operator.
virtual NonNegative< AreaDensity > GetDensity_() const noexcept=0
Gets the density.
Vec3 impulse
Impulse.
Definition: WeldJointConf.hpp:102
constexpr UnitVec::value_type get(UnitVec v) noexcept
Gets the specified element of the given collection.
Definition: UnitVec.hpp:361
Joint & operator=(const Joint &other)
Copy assignment.
Definition: Joint.hpp:222
UnitVec m_normals[2]
Normals.
Definition: EdgeShapeConf.hpp:104
toi_iter_type toi_iters
Time of impact iterations.
Definition: TimeOfImpact.hpp:185
Momentum GetNormalImpulseAtPoint(size_type index) const noexcept
Gets the normal impulse at the given point.
Definition: VelocityConstraint.hpp:343
constexpr size_type size() const noexcept
Gets the size of this span.
Definition: Span.hpp:106
constexpr std::enable_if_t<!IsVector< T >::value, Vector< Vector< T, 1 >, N > > GetColumnMatrix(Vector< T, N > arg)
Gets the specified column of the given matrix as a column matrix.
Definition: Matrix.hpp:132
CmpResult
Compare result enumeration.
Definition: Fixed.hpp:66
std::invalid_argument exception_type
Exception type possibly thrown by this checker.
Definition: NonNegative.hpp:32
static constexpr auto InvalidHeight
Invalid height constant value.
Definition: DynamicTree.hpp:95
constexpr auto operator>=(const CheckedValue< LhsValueType, LhsCheckerType > &lhs, const CheckedValue< RhsValueType, RhsCheckerType > &rhs) -> decltype(LhsValueType(lhs) >=RhsValueType(rhs))
Constrained value greater-than or equal-to operator.
Definition: CheckedValue.hpp:185
counter_type contactsFound
Contacts found count.
Definition: StepStats.hpp:79
constexpr RopeJointConf(BodyID bodyA, BodyID bodyB) noexcept
Initializing constructor.
Definition: RopeJointConf.hpp:65
auto ModuloViaTrunc(T dividend, T divisor) noexcept
Modulo operation using std::trunc.
Definition: Math.hpp:264
SizedRange< Joints::const_iterator > GetJoints() const noexcept
Gets the world joint range.
Definition: WorldImpl.hpp:925
static ContactToiData GetSoonestContact(const Contacts &contacts, const ArrayAllocator< Contact > &buffer) noexcept
Gets the soonest contact.
Definition: WorldImpl.cpp:1226
std::stack< BodyID, std::vector< BodyID > > BodyStack
Body stack.
Definition: WorldImpl.hpp:578
Angle GetAngularLowerLimit(const Joint &object)
Gets the lower joint limit.
Definition: Joint.cpp:506
propagate_const & operator=(const propagate_const &p)=delete
Explicitly deleted copy assignment.
FlagGuard(T &flag, T value)
Initializing constructor.
Definition: FlagGuard.hpp:40
Time GetUnderActiveTime() const noexcept
Gets this body's under-active time value.
Definition: Body.hpp:597
A C++ encapsulation of an array and its size.
Definition: Span.hpp:40
NonNegative< Frequency > frequency
Mass-spring-damper frequency.
Definition: WeldJointConf.hpp:95
const Point & GetPoint(size_type index) const noexcept
Gets the point identified by the given index.
Definition: Manifold.hpp:361
::playrho::propagate_const< T > first_argument_type
First argument type.
Definition: propagate_const.hpp:439
DistanceProxy GetChild(const ChainShapeConf &arg, ChildCounter index)
Gets the "child" shape for a given chain shape configuration.
Definition: ChainShapeConf.hpp:157
ContactCounter Synchronize(const Fixtures &fixtures, const Transformation &xfm1, const Transformation &xfm2, Real multiplier, Length extension)
Synchronizes the given body.
Definition: WorldImpl.cpp:2388
auto AngularNormalize(Fixed< BT, FB > angleInRadians)
Normalizes the given angular argument.
Definition: FixedMath.hpp:410
const void * GetData(const Shape &shape) noexcept
Gets a pointer to the underlying data.
Definition: Shape.hpp:324
Type
Separation finder type.
Definition: SeparationScenario.hpp:39
constexpr AABB< N > GetMovedAABB(AABB< N > aabb, const Vector< Length, N > value) noexcept
Gets the result of moving the given AABB by the given value.
Definition: AABB.hpp:341
Length linearSlop
Linear slop.
Definition: ConstraintSolverConf.hpp:82
Torque GetMaxMotorTorque(const Joint &object)
Gets the given joint's max motor torque if its type supports that.
Definition: Joint.cpp:351
std::invalid_argument exception_type
Exception type possibly thrown by this checker.
Definition: NonZero.hpp:32
constexpr auto MaxShapeVertices
Maximum number of vertices for any shape type.
Definition: Settings.hpp:117
Real dtRatio
Delta time ratio.
Definition: StepConf.hpp:59
friend ChildCounter GetChildCount(const Shape &shape) noexcept
Gets the number of child primitives of the shape.
Definition: Shape.hpp:268
Definition of a self-contained constraint "island".
Definition: Island.hpp:40
Interval template type.
Definition: Interval.hpp:40
Size GetRootIndex() const noexcept
Gets the index of the "root" node if this tree has one.
Definition: DynamicTree.hpp:550
constexpr Fixed< BT, FB > exp(Fixed< BT, FB > arg)
Computes Euler's number raised to the given power argument.
Definition: FixedMath.hpp:134
bool doToi
Do time of impact (TOI) calculations.
Definition: StepConf.hpp:278
static constexpr auto ScaleFactor
Scale factor.
Definition: Fixed.hpp:62
constexpr BodyConf & UseLinearAcceleration(LinearAcceleration2 v) noexcept
Use the given linear acceleration.
Definition: BodyConf.hpp:204
std::remove_const< decltype(DefaultMaxToiRootIters)>::type root_iter_type
Root iteration type.
Definition: TimeOfImpact.hpp:54
SizedRange< std::vector< BodyID >::const_iterator > GetBodiesForProxies(const World &world) noexcept
Gets the bodies-for-proxies range for the given world.
Definition: WorldBody.cpp:53
bool IsEnabled() const noexcept
Gets the enabled/disabled state of the body.
Definition: Body.hpp:614
std::vector< BodyID > Bodies
Container type for body identifiers.
Definition: Island.hpp:42
constexpr auto DefaultMinVertexRadius
Default minimum vertex radius.
Definition: Settings.hpp:137
std::add_pointer_t< std::add_const_t< T > > TypeCast(const Shape *value) noexcept
Converts the given shape into its current configuration value.
Definition: Shape.hpp:610
Length2 target
The initial world target point. This is assumed to coincide with the body anchor initially.
Definition: TargetJointConf.hpp:102
constexpr Span(std::initializer_list< T > list) noexcept
Initializing constructor.
Definition: Span.hpp:76
Joints joints
Container of joint identifiers.
Definition: Island.hpp:52
VertexCounterArray< 2 > VertexCounter2
2-element vertex counter array.
Definition: IndexPair.hpp:94
constexpr Vec3 Solve33(const Mat33 &mat, const Vec3 b) noexcept
Solves A * x = b, where b is a column vector.
Definition: Math.hpp:485
void RotateAboutLocalPoint(World &world, BodyID body, Angle amount, Length2 localPoint)
Rotates a body a given amount around a point in body local coordinates.
Definition: WorldBody.cpp:161
friend PROPAGATE_CONST_CONSTEXPR bool operator<=(const U &u, const propagate_const &pu)
Less-than or equal-to operator.
Definition: propagate_const.hpp:378
constexpr auto DefaultMaxLinearCorrection
Default maximum linear correction.
Definition: Settings.hpp:158
AngularMomentum angularImpulse
Angular impulse.
Definition: WheelJointConf.hpp:130
bool ValidateMetrics(const DynamicTree &tree, DynamicTree::Size index) noexcept
Validates the metrics of the given tree from the given index.
Definition: DynamicTree.cpp:841
Length2 rB
Relative B.
Definition: MotorJointConf.hpp:114
InvMass GetEffectiveInvMass(const InvRotInertia invRotI, const Length2 p, const UnitVec q)
Gets the "effective" inverse mass.
Definition: Math.hpp:937
constexpr Real GetCoefficient(size_type index) const noexcept
Gets the coefficient for the given index.
Definition: Simplex.hpp:188
static PolygonShapeConf GetDefaultConf() noexcept
Gets the default configuration for a PolygonShapeConf.
Definition: PolygonShapeConf.hpp:51
constexpr T & UnderlyingValue(IndexingNamedType< T, Tag > &o) noexcept
Gets the underlying value.
Definition: IndexingNamedType.hpp:143
constexpr auto Rotate(const Vector2< T > vector, const UnitVec &angle) noexcept
Rotates a vector by a given angle.
Definition: Math.hpp:770
bool doBlocksolve
Do the block-solve algorithm.
Definition: StepConf.hpp:281
data_type & operator[](size_type index) noexcept
Accesses the indexed element.
Definition: Span.hpp:92
Mass22 linearMass
2-by-2 linear mass matrix in kilograms.
Definition: MotorJointConf.hpp:117
InvMass gamma
Gamma.
Definition: TargetJointConf.hpp:123
const UnitVec * ConstNormalPointer
Constant normal pointer.
Definition: DistanceProxy.hpp:61
void * Realloc(void *ptr, std::size_t size)
Reallocates memory.
Definition: DynamicMemory.cpp:41
void SetContact(ContactID id, const Contact &value)
Sets the identified contact's state.
Definition: WorldImpl.cpp:2631
ConvexHull(std::vector< Length2 > verts, std::vector< UnitVec > norms, NonNegative< Length > vr)
Initializing constructor.
Definition: MultiShapeConf.hpp:79
Length2 rB
Relative B.
Definition: PulleyJointConf.hpp:115
LeafData leaf
Leaf specific data.
Definition: DynamicTree.hpp:366
JointID CreateJoint(WorldImpl &world, const Joint &def)
Creates a new joint.
Definition: WorldImplJoint.cpp:47
NonNegative< Length > vertexRadius
Vertex radius.
Definition: ChainShapeConf.hpp:135
Distance Configuration.
Definition: Distance.hpp:52
detail::IndexingNamedType< FixtureCounter, struct FixtureIdentifier > FixtureID
Fixture identifier.
Definition: FixtureID.hpp:30
Frequency GetAngularDamping(const Body &body) noexcept
Gets the angular damping of the body.
Definition: Body.hpp:1003
World(const WorldConf &def=GetDefaultWorldConf())
Constructs a world object.
Definition: WorldSpecial.cpp:35
constexpr SimplexEdges GetEdges() const noexcept
Gets the edges.
Definition: Simplex.hpp:178
void UnsetAllowSleeping() noexcept
Unsets the allow sleeping state.
Simplex edge.
Definition: SimplexEdge.hpp:37
const Contact & GetContact(const World &world, ContactID id)
Gets the identified contact.
Definition: WorldContact.cpp:45
Momentum GetLinearMotorImpulse(const Joint &object)
Definition: Joint.cpp:664
static const element_type * get_pointer(const U *u)
Gets pointer.
Definition: propagate_const.hpp:82
void Destroy(World &world, BodyID id)
Destroys the identified body.
Definition: WorldBody.cpp:73
void Restore(const Sweep &value) noexcept
Restores the given body's sweep to the given sweep value.
Definition: Body.hpp:420
ArrayAllocator< Proxies > m_fixtureProxies
Array of arrays of dynamic tree leaves.
Definition: WorldImpl.hpp:845
constexpr void Assign(const LeafData &v) noexcept
Gets the node as a "leaf" value.
Definition: DynamicTree.hpp:512
virtual std::unique_ptr< Concept > Clone_() const =0
Clones this concept and returns a pointer to a mutable copy.
UpdateContactsStats UpdateContacts(const StepConf &conf)
Update contacts.
Definition: WorldImpl.cpp:1899
void SetJoint(WorldImpl &world, JointID id, const Joint &def)
Sets the identified joint's new value.
Definition: WorldImplJoint.cpp:62
static Manifold GetForFaceB(UnitVec nb, CfIndex ib, Length2 pb, CfType ta0, CfIndex ia0, Length2 pa0) noexcept
Gets the face B manifold for the given data.
Definition: Manifold.hpp:271
constexpr auto GetFwdPerpendicular(const T vector) noexcept
Gets a vector clockwise (forward-clockwise) perpendicular to the given vector.
Definition: Math.hpp:564
static constexpr playrho::Fixed< BT, FB > denorm_min() noexcept
Gets the denorm value for the type.
Definition: FixedLimits.hpp:95
Angle GetAngularLowerLimit(const Joint &object)
Gets the lower joint limit.
Definition: Joint.cpp:506
const value_type & const_reference
Constant reference type.
Definition: Vector.hpp:63
VertexCounter GetSupportIndex(const DistanceProxy &proxy, T dir) noexcept
Gets the supporting vertex index in the given direction for the given distance proxy.
Definition: DistanceProxy.hpp:221
ContactCounter FindNewContacts()
Finds new contacts.
Definition: WorldImpl.cpp:2011
Template class for fixed-point numbers.
Definition: Fixed.hpp:46
Real value_type
Value type used for the coordinate values of this vector.
Definition: UnitVec.hpp:53
constexpr ConstraintSolverConf GetDefaultPositionSolverConf() noexcept
Gets the default position solver configuration.
Definition: ConstraintSolverConf.hpp:102
auto GetEntryCount() const noexcept
Gets the current allocation record entry usage count.
Definition: StackAllocator.hpp:102
Function object for performing lexicographical greater-than comparisons of containers.
Definition: Templates.hpp:296
pointer end() const noexcept
Gets the "end" iterator value.
Definition: Span.hpp:86
Length2 localAnchorB
Local anchor point relative to body B's origin.
Definition: RevoluteJointConf.hpp:121
Real m_friction
Friction coefficient (4-bytes). Usually in the range of [0,1].
Definition: VelocityConstraint.hpp:286
NonNegative< Area > GetAreaOfPolygon(Span< const Length2 > vertices)
Gets the area of a polygon.
Definition: Math.cpp:118
Ray-cast hit data.
Definition: RayCastOutput.hpp:78
friend bool operator==(const Joint &lhs, const Joint &rhs) noexcept
Equality operator for joint comparisons.
Definition: Joint.hpp:272
void ResetAlpha0() noexcept
Resets the given body's "alpha-0" value.
Definition: Body.hpp:413
Size m_rootIndex
Index of root element in m_nodes or GetInvalidSize().
Definition: DynamicTree.hpp:295
Torque GetMaxMotorTorque(const Joint &object)
Gets the given joint's max motor torque if its type supports that.
Definition: Joint.cpp:351
ConstraintSolverConf GetToiConstraintSolverConf(const StepConf &conf) noexcept
Gets the TOI phase constraint solver configuration for the given step configuration.
Definition: ConstraintSolverConf.cpp:37
Length2 GetLocalAnchorB(const Joint &object)
Get the anchor point on body-B in local coordinates.
Definition: Joint.cpp:96
Template for determining if the given types are addable.
Definition: Templates.hpp:189
NonNegative< Force > maxForce
Max force.
Definition: TargetJointConf.hpp:113
constexpr auto operator()() noexcept -> decltype(static_cast< T >(0))
Valid value supplying functor.
Definition: NonPositive.hpp:35
IslandStats SolveToiViaGS(const Island &island, const StepConf &conf)
Solves the time of impact for bodies 0 and 1 of the given island.
Definition: WorldImpl.cpp:1510
constexpr auto SetCorrectionFactor(MotorJointConf &object, Real value) noexcept
Free function for setting the correction factor value of the given configuration.
Definition: MotorJointConf.hpp:276
Angle GetAngle(const UnitVec value)
Gets the angle of the given unit vector.
Definition: Math.hpp:718
auto GetPreallocatedSize() const noexcept
Gets the preallocated size.
Definition: StackAllocator.hpp:124
TOIOutput GetToiViaSat(const DistanceProxy &proxyA, const Sweep &sweepA, const DistanceProxy &proxyB, const Sweep &sweepB, ToiConf conf)
Gets the time of impact for two disjoint convex sets using the Separating Axis Theorem.
Definition: TimeOfImpact.cpp:66
Real GetFriction() const noexcept
Gets the combined friction of the associated contact.
Definition: VelocityConstraint.hpp:110
constexpr auto GetLengthB(const PulleyJointConf &object) noexcept
Free function for getting the length B value of the given configuration.
Definition: PulleyJointConf.hpp:204
constexpr auto GetCorrectionFactor(const MotorJointConf &object) noexcept
Free function for getting the correction factor value of the given configuration.
Definition: MotorJointConf.hpp:269
BodyCounter GetAwakeCount(const World &world) noexcept
Gets the count of awake bodies in the given world.
Definition: WorldBody.cpp:536
TreeNode & operator=(const TreeNode &other)=default
Copy assignment operator.
constexpr void Assign(const UnusedData &v) noexcept
Gets the node as an "unused" value.
Definition: DynamicTree.hpp:505
Length2 localAnchorA
The local anchor point relative to body A's origin.
Definition: PulleyJointConf.hpp:94
ChildCounter GetChildCount() const noexcept
Gets the "child" shape count.
Definition: ChainShapeConf.hpp:73
constexpr Fixed & operator%=(Fixed val) noexcept
Modulo operator.
Definition: Fixed.hpp:523
Length2 GetWorldPoint(const Body &body, const Length2 localPoint) noexcept
Gets the world coordinates of a point given in coordinates relative to the body's origin.
Definition: Body.hpp:1208
constexpr UnitVec::value_type get< 0 >(UnitVec v) noexcept
Gets element 0 of the given collection.
Definition: UnitVec.hpp:373
Length2 GetLocalCenter(const Body &body) noexcept
Gets the local position of the center of mass.
Definition: Body.hpp:914
constexpr AABB< N > GetDisplacedAABB(AABB< N > aabb, const Vector< Length, N > displacement)
Gets the AABB that the result of displacing the given AABB by the given displacement amount.
Definition: AABB.hpp:321
iterator begin()
Gets the "begin" iterator value for this array.
Definition: AllocatedArray.hpp:135
Vertex Set.
Definition: VertexSet.hpp:36
Element type detecting trait.
Definition: propagate_const.hpp:52
static constexpr const char * name
The name of the templated type.
Definition: TypeInfo.hpp:63
FixtureCounter GetFixtureRange() const noexcept
Gets the extent of the currently valid fixture range.
Definition: WorldImpl.cpp:619
void Advance0(Real alpha) noexcept
Advances the sweep by a factor of the difference between the given time alpha and the sweep's alpha 0...
Definition: Sweep.hpp:114
UnitVec m_normal
Normal of the world manifold. 8-bytes.
Definition: VelocityConstraint.hpp:283
UnitVec localAxis1
Local axis 1. Used when type1 is not Revolute.
Definition: GearJointConf.hpp:90
void SetAcceleration(LinearAcceleration2 linear, AngularAcceleration angular) noexcept
Sets the linear and rotational accelerations on this body.
Definition: Body.cpp:177
PLAYRHO_QUANTITY(boost::units::si::momentum) Momentum
Momentum quantity.
Definition: Units.hpp:293
bool doWarmStart
Do warm start.
Definition: StepConf.hpp:269
JointListener m_jointDestructionListener
Listener for joint destruction.
Definition: WorldImpl.hpp:872
static constexpr playrho::Fixed< BT, FB > lowest() noexcept
Gets the lowest value available for the type.
Definition: FixedLimits.hpp:43
bool enableMotor
Flag to enable the joint motor.
Definition: RevoluteJointConf.hpp:146
iteration_type toiVelocityIterations
TOI velocity iterations.
Definition: StepConf.hpp:234
constexpr auto DefaultMaxRotation
Default maximum rotation per world step.
Definition: Settings.hpp:171
ArrayList< SimplexEdge, MaxSimplexEdges, std::remove_const< decltype(MaxSimplexEdges)>::type > SimplexEdges
Simplex edge collection.
Definition: Simplex.hpp:34
constexpr auto & UseFrequency(NonNegative< Frequency > v) noexcept
Use value for frequency.
Definition: TargetJointConf.hpp:87
constexpr ShapeBuilder()=default
Default constructor.
constexpr auto & UseLowerAngle(Angle v) noexcept
Uses the given lower angle value.
Definition: RevoluteJointConf.hpp:83
InvMass GetInvMass() const noexcept
Gets the inverse mass of this body representation.
Definition: BodyConstraint.hpp:97
constexpr ConstraintSolverConf GetDefaultToiPositionSolverConf() noexcept
Gets the default TOI position solver configuration.
Definition: ConstraintSolverConf.hpp:108
Point & PointAt(size_type index)
Accesses the point identified by the given index.
Definition: VelocityConstraint.hpp:257
static auto Data(T &v)
Internal helper template function to avoid confusion for use within classes that define their own dat...
Definition: Templates.hpp:80
constexpr auto MaxFloat
Maximum float value.
Definition: Settings.hpp:104
Length2 localAnchorB
Local anchor point relative to body B's origin.
Definition: FrictionJointConf.hpp:80
void SetEnabled(Body &body) noexcept
Sets the enabled state.
Definition: Body.hpp:779
std::function< void(ContactID, const Manifold &)> ManifoldContactListener
Manifold contact listener.
Definition: WorldImpl.hpp:108
Length2 GetTarget(const Joint &object)
Gets the given joint's target property if it has one.
Definition: Joint.cpp:459
Length2 localPoint
Local point.
Definition: Manifold.hpp:137
friend Real GetFriction(const Shape &shape) noexcept
Gets the coefficient of friction.
Definition: Shape.hpp:294
constexpr auto GetType2(const GearJointConf &object) noexcept
Free function for getting joint 2 type value of the given configuration.
Definition: GearJointConf.hpp:233
Internal configuration concept.
Definition: Shape.hpp:356
A collision response oriented description of the intersection of two convex shapes.
Definition: Manifold.hpp:65
Length2 GetLinearOffset(const Joint &object)
Gets the linear offset property of the specified joint if its type has one.
Definition: Joint.cpp:593
constexpr auto & UseDampingRatio(Real v) noexcept
Uses the given damping ratio.
Definition: WeldJointConf.hpp:77
constexpr VariantData(LeafData value) noexcept
Initializing constructor.
Definition: DynamicTree.hpp:378
static constexpr Height GetInvalidHeight() noexcept
Gets the invalid height value.
Definition: DynamicTree.hpp:98
Manifold()=default
Default constructor.
PulleyJointConf GetPulleyJointConf(const Joint &joint)
Gets the definition data for the given joint.
Definition: PulleyJointConf.cpp:71
bool HasNewFixtures() const noexcept
Determines whether this world has new fixtures.
Definition: WorldImpl.hpp:974
SizedRange< Contacts::const_iterator > GetContacts() const noexcept
Gets the world contact range.
Definition: World.cpp:241
UnitVec GetNormal(VertexCounter index) const
Gets a normal by index.
Definition: PolygonShapeConf.hpp:146
constexpr bool AlmostZero(Fixed< BT, FB > value)
Gets whether a given value is almost zero.
Definition: Fixed.hpp:668
constexpr auto DefaultMinStillTimeToSleep
Default minimum still time to sleep.
Definition: Settings.hpp:251
U type
Detected element type alias.
Definition: propagate_const.hpp:61
Wheel joint definition.
Definition: WheelJointConf.hpp:55
constexpr Fixed< BT, FB > abs(Fixed< BT, FB > arg)
Computes the absolute value.
Definition: FixedMath.hpp:48
void SetLocation(World &world, BodyID body, Length2 value)
Sets the body's location.
Definition: WorldBody.cpp:138
constexpr bool operator()(const T &lhs, const T &rhs) const
Checks whether the first argument is lexicographically less-than or equal-to the second argument.
Definition: Templates.hpp:317
LinearVelocity2 GetContactRelVelocity(const Velocity velA, const Length2 relA, const Velocity velB, const Length2 relB) noexcept
Gets the contact relative velocity.
Definition: Math.cpp:173
BodyID CreateBody(const BodyConf &def=GetDefaultBodyConf())
Creates a rigid body with the given configuration.
Definition: WorldImpl.cpp:634
NonNegative< Frequency > frequency
Frequency.
Definition: TargetJointConf.hpp:118
constexpr auto InvalidBodyID
Invalid body ID value.
Definition: BodyID.hpp:33
constexpr UnitVec GetRevPerpendicular(const UnitVec vector) noexcept
Gets a vector counter-clockwise (reverse-clockwise) perpendicular to the given vector.
Definition: UnitVec.hpp:330
void operator()(void *p) noexcept
Default operator.
Definition: BlockAllocator.hpp:142
virtual bool SolvePosition_(BodyConstraintsMap &bodies, const ConstraintSolverConf &conf) const =0
Solves the positions for this joint.
std::function< void(JointID)> JointListener
Listener type for some joint related events.
Definition: World.hpp:150
Model(T arg)
Initializing constructor.
Definition: Shape.hpp:427
static constexpr UnitVec GetLeft() noexcept
Gets the left-ward oriented unit vector.
Definition: UnitVec.hpp:86
constexpr auto Square(TYPE t) noexcept
Squares the given value.
Definition: Math.hpp:161
ConstraintSolverConf GetRegConstraintSolverConf(const StepConf &conf) noexcept
Gets the regular phase constraint solver configuration for the given step configuration.
Definition: ConstraintSolverConf.cpp:27
PLAYRHO_QUANTITY(boost::units::si::angular_momentum) AngularMomentum
Angular momentum quantity.
Definition: Units.hpp:304
value_type value
Value.
Definition: Fixed.hpp:562
AngularVelocity angularVelocity
The angular velocity of the body.
Definition: BodyConf.hpp:121
::playrho::detail::MassData< 2 > MassData
Mass data alias for 2-D objects.
Definition: MassData.hpp:77
std::remove_const< decltype(MaxChildCount)>::type ChildCounter
Child counter type.
Definition: Settings.hpp:97
constexpr auto GetPointB() const noexcept
Gets point B (in world coordinates).
Definition: SimplexEdge.hpp:57
VelocityConstraint(const VelocityConstraint ©)=default
Copy constructor.
typename std::vector< value_type >::const_reference const_reference
Constant reference type alias.
Definition: ArrayAllocator.hpp:46
Point m_points[MaxManifoldPoints]
Velocity constraint points array (at least 72-bytes).
Definition: VelocityConstraint.hpp:263
Momentum2 GetNormalImpulses(const VelocityConstraint &vc)
Gets the normal impulses of the given velocity constraint.
Definition: VelocityConstraint.hpp:437
Size GetFreeIndex() const noexcept
Gets the free index.
Definition: DynamicTree.hpp:557
void SetFixtureDestructionListener(const FixtureListener &listener) noexcept
Registers a destruction listener for fixtures.
Definition: World.cpp:46
Step configuration.
Definition: StepConf.hpp:42
::playrho::detail::AABB< 2 > AABB
2-Dimensional Axis Aligned Bounding Box.
Definition: AABB.hpp:417
Length2 GetLocation() const noexcept
Gets the location.
Definition: DiskShapeConf.hpp:86
const FixtureConf & GetFixture(FixtureID id) const
Gets the identified fixture state.
Definition: WorldImpl.cpp:2297
SizedRange< Bodies::const_iterator > GetBodiesForProxies() const noexcept
Gets the bodies-for-proxies range for this world.
Definition: World.cpp:156
void SetTransform(World &world, BodyID id, Length2 location, Angle angle)
Sets the position of the body's origin and rotation.
Definition: WorldBody.hpp:213
bool operator<=(const AABB< N > &lhs, const AABB< N > &rhs) noexcept
Less-than or equal-to operator.
Definition: AABB.hpp:152
std::reverse_iterator< const_iterator > const_reverse_iterator
Constant reverse iterator type.
Definition: UnitVec.hpp:68
FixtureCounter GetFixtureRange() const noexcept
Gets the extent of the currently valid fixture range.
Definition: World.cpp:136
friend PROPAGATE_CONST_CONSTEXPR bool operator>(const propagate_const &pt, const propagate_const< U > &pu)
Greater-than operator.
Definition: propagate_const.hpp:286
constexpr PrismaticJointConf()=default
Default constructor.
Mass mass
Mass.
Definition: WheelJointConf.hpp:141
Mass springMass
Spring mass.
Definition: WheelJointConf.hpp:143
void Destroy(BodyID id)
Destroys the identified body.
Definition: World.cpp:176
typename std::make_unsigned< wider_type >::type unsigned_wider_type
Unsigned widened type alias.
Definition: Fixed.hpp:557
void push_back(const_reference value)
Push "back" the given value.
Definition: AllocatedArray.hpp:193
bool IsAccelerable(BodyType type)
Is "accelerable".
Definition: BodyType.hpp:75
Fixed< BT, FB > cos(Fixed< BT, FB > arg)
Computes the cosine of the argument for Fixed types.
Definition: FixedMath.hpp:442
Low-level implementation of the is-iterable default value trait.
Definition: Templates.hpp:50
Point data for world manifold.
Definition: WorldManifold.hpp:66
constexpr auto GetY() const noexcept
Gets the "Y" value.
Definition: UnitVec.hpp:236
LinearVelocity2 linear
Linear velocity.
Definition: Velocity.hpp:39
AngularVelocity GetMotorSpeed(const Joint &object)
Gets the given joint's motor speed if its type supports that.
Definition: Joint.cpp:254
Length tolerance
Tolerance.
Definition: Manifold.hpp:468
constexpr auto EarthlyGravity
Earthly gravity in 2-dimensions.
Definition: Vector2.hpp:154
constexpr Interval & Expand(const value_type &v) noexcept
Expands this interval.
Definition: Interval.hpp:181
underlying_type value_
Underlying value.
Definition: IndexingNamedType.hpp:133
constexpr auto MeterPerSecond
Meter per second unit of linear velocity.
Definition: Units.hpp:341
bool IsFullOfContacts(const Island &island)
Determines whether the given island is full of contacts.
Definition: Island.hpp:72
@ e_unknown
Unknown.
Definition: TimeOfImpact.hpp:196
Length length
Length.
Definition: RopeJointConf.hpp:87
Frequency m_inv_dt0
Inverse delta-t from previous step.
Definition: WorldImpl.hpp:884
static constexpr bool IsBranch(Height value) noexcept
Gets whether the given height is a height for a "branch" node.
Definition: DynamicTree.hpp:116
const data_type * const_pointer
Constant pointer type.
Definition: Span.hpp:50
FixtureConf & UseBody(BodyID value) noexcept
Uses the given value for the body member variable.
Definition: FixtureConf.hpp:66
constexpr friend bool operator<(const IndexingNamedType &lhs, const IndexingNamedType &rhs)
Less-than operator.
Definition: IndexingNamedType.hpp:103
Momentum2 GetImpulses(size_type index) const noexcept
Gets the given index contact impulses.
Definition: WorldManifold.hpp:159
ArrayAllocator< Contact > m_contactBuffer
Array of contact data both used and freed.
Definition: WorldImpl.hpp:847
constexpr Fixed & operator+=(Fixed val) noexcept
Addition assignment operator.
Definition: Fixed.hpp:352
Position pos_b
Position B.
Definition: ContactSolver.hpp:42
constexpr UnitVec FlipY() const noexcept
Flips the Y value.
Definition: UnitVec.hpp:245
bool IsSleepingAllowed(const Body &body) noexcept
Gets whether or not this body allowed to sleep.
Definition: Body.hpp:754
constexpr std::enable_if_t< std::is_pointer< U >::value, remove_pointer_type > & operator*() const
Indirection operator available for pointer ValueType.
Definition: CheckedValue.hpp:112
Length targetDepth
Targeted depth of impact.
Definition: TimeOfImpact.hpp:85
RegStepStats reg
Reg-phase step statistics.
Definition: StepStats.hpp:118
counter_type added
Count of contacts added.
Definition: StepStats.hpp:36
UnitVec ax
Solver A X directional.
Definition: WheelJointConf.hpp:133
static constexpr auto check(T *) -> typename std::is_same< decltype(std::declval< T >()(std::declval< Args >()...)), Return >::type
Declaration of check function for supporting types given to template.
constexpr auto BigG
Big "G".
Definition: Units.hpp:850
void Free(void *p, size_type n)
Frees memory.
Definition: BlockAllocator.cpp:183
Angle GetAngularOffset(const Joint &object)
Gets the angular offset property of the specified joint if its type has one.
Definition: Joint.cpp:612
Torque maxMotorTorque
Maximum motor torque used to achieve the desired motor speed.
Definition: RevoluteJointConf.hpp:152
std::unique_ptr< Concept > Clone_() const override
Clones this concept and returns a pointer to a mutable copy.
Definition: Shape.hpp:429
constexpr bool IsEntirelyBefore(const Interval< T > &a, const Interval< T > &b)
Determines whether the first range is entirely before the second range.
Definition: Interval.hpp:268
constexpr auto GetRatio(const GearJointConf &object) noexcept
Free function for getting the ratio value of the given configuration.
Definition: GearJointConf.hpp:205
typename U::element_type type
Detected element type alias.
Definition: propagate_const.hpp:54
constexpr AABB< N > & Move(AABB< N > &var, const Vector< Length, N > value) noexcept
Moves the given AABB by the given value.
Definition: AABB.hpp:296
constexpr auto DefaultMaxDistanceIters
Default max number of distance iterations.
Definition: Settings.hpp:180
auto GetToiCount(const Contact &contact) noexcept
Gets the time of impact count.
Definition: Contact.hpp:672
static constexpr Fixed GetInfinity() noexcept
Gets an infinite value for this type.
Definition: Fixed.hpp:80
BodyCounter GetBodyCount(const World &world) noexcept
Gets the body count in the given world.
Definition: WorldBody.hpp:808
Positive< Angle > angularSlop
Angular slop.
Definition: StepConf.hpp:76
const UnitVec axis
Axis.
Definition: SeparationScenario.hpp:54
NonNegative< Frequency > angularDamping
Angular damping is use to reduce the angular velocity. The damping parameter can be larger than 1 but...
Definition: BodyConf.hpp:139
BranchData GetBranchData(Size index) const noexcept
Gets the branch data for the identified node.
Definition: DynamicTree.hpp:601
BodyID m_bodyB
Identifier for body-B.
Definition: PositionConstraint.hpp:67
static Real CalcMetric(const SimplexEdges &simplexEdges)
Gets the given simplex's "metric".
Definition: Simplex.cpp:223
Frequency GetFrequency(const Joint &object)
Gets the frequency of the joint if it has this property.
Definition: Joint.cpp:407
std::invalid_argument exception_type
Exception type possibly thrown by this checker.
Definition: NonPositive.hpp:32
constexpr Length2 GetOpposingPoint(size_type index) const noexcept
Gets the opposing point.
Definition: Manifold.hpp:413
void SetAngularLimits(Joint &object, Angle lower, Angle upper)
Sets the joint limits.
Definition: Joint.cpp:524
constexpr bool operator!=(ContactFeature lhs, ContactFeature rhs) noexcept
Determines if the given two contact features are not equal.
Definition: ContactFeature.hpp:107
void reserve(size_type value)
Reserves the given number of elements from dynamic memory.
Definition: ArrayAllocator.hpp:174
void UpdateLeaf(Size index, const AABB &aabb)
Updates a leaf node with a new AABB value.
Definition: DynamicTree.cpp:591
SizedRange< Contacts::const_iterator > GetContacts() const noexcept
Gets the world contact range.
Definition: WorldImpl.hpp:930
Velocity constraint point.
Definition: VelocityConstraint.hpp:187
iterator end()
Gets the "end" iterator value for this array.
Definition: AllocatedArray.hpp:141
NonNegative< Length > GetVertexRadius(const DistanceProxy &arg) noexcept
Gets the vertex radius property of a given distance proxy.
Definition: DistanceProxy.hpp:205
Movement configuration.
Definition: MovementConf.hpp:32
value_type elements[N? N:1]
Elements.
Definition: Vector.hpp:211
constexpr auto & UseMaxLength(Length v) noexcept
Uses the given max length value.
Definition: RopeJointConf.hpp:72
size_type m_size
Size in number of elements in the range.
Definition: Range.hpp:100
inline ::std::ostream & operator<<(::std::ostream &os, const UnitVec &value)
Output stream operator.
Definition: UnitVec.hpp:386
Length GetMinVertexRadius() const noexcept
Gets the minimum vertex radius that shapes in this world can be.
Definition: World.cpp:116
constexpr const_reference at(size_type pos) const
Gets a constant reference to the requested element.
Definition: Vector.hpp:185
BodyConf GetBodyConf(const Body &body) noexcept
Gets the body definition for the given body.
Definition: BodyConf.cpp:29
Shape() noexcept=default
Default constructor.
void Set(JointConf &def, const Joint &joint) noexcept
Sets the joint definition data for the given joint.
Definition: JointConf.cpp:40
Mass mass
Mass.
Definition: PulleyJointConf.hpp:116
virtual TypeID GetType_() const noexcept=0
Gets the use type information.
RotInertia GetAngularMass(const Joint &object)
Gets the given joint's angular mass.
Definition: Joint.cpp:287
constexpr auto & UseMaxMotorForce(Force v) noexcept
Uses the given max motor force value.
Definition: PrismaticJointConf.hpp:109
void Clear() noexcept
Clears this world.
Definition: WorldImpl.cpp:581
Description of a "sweep" of motion in 2-D space.
Definition: Sweep.hpp:42
JointKey GetJointKey(const Joint &joint) noexcept
Gets the JointKey for the given joint.
Definition: JointKey.cpp:27
PLAYRHO_QUANTITY(playrho::units::si::inverse_moment_of_inertia) InvRotInertia
Inverse rotational inertia quantity.
Definition: Units.hpp:282
InvMass22 GetK() const noexcept
Gets the "K" value.
Definition: VelocityConstraint.hpp:302
constexpr value_type GetMax() const noexcept
Gets the maximum value of this range.
Definition: Interval.hpp:135
constexpr auto DefaultAngularSleepTolerance
Default angular sleep tolerance.
Definition: Settings.hpp:259
Length2 relB
Position of body B relative to world manifold point.
Definition: VelocityConstraint.hpp:192
Mass motorMass
Motor mass.
Definition: PrismaticJointConf.hpp:162
constexpr auto & UseEnableMotor(bool v) noexcept
Uses the given enable motor state value.
Definition: PrismaticJointConf.hpp:95
Mass tangentMass
Tangent mass.
Definition: VelocityConstraint.hpp:208
VertexCounter firstShape
First shape vertex index.
Definition: IndexPair.hpp:111
Momentum impulse
Impulse.
Definition: PulleyJointConf.hpp:109
virtual void Transform_(const Mat22 &m)=0
Transforms all of the shape's vertices by the given transformation matrix.
@ e_stepComplete
Step complete.
Definition: WorldImpl.hpp:534
Real toiResolutionRate
Time of impact resolution rate.
Definition: StepConf.hpp:106
An encapsulation of a point, line segment, or triangle.
Definition: Simplex.hpp:60
Length2 GetGroundAnchorB(const Joint &object)
Definition: Joint.cpp:655
Real GetToi(const Contact &contact) noexcept
Gets the time of impact (TOI) as a fraction.
Definition: Contact.hpp:706
constexpr TypeID GetTypeID()
Gets the type ID for the template parameter type.
Definition: TypeInfo.hpp:113
VertexCounter m_count
Count of valid elements of m_vertices.
Definition: DistanceProxy.hpp:187
Position GetPosition() const noexcept
Gets the position of the body.
Definition: BodyConstraint.hpp:112
Mat22 abs(const Mat22 &A)
Gets the absolute value of the given value.
Definition: Math.hpp:605
std::uint16_t bits_type
Bits type definition.
Definition: Filter.hpp:36
constexpr bool operator()(const T &lhs, const T &rhs) const
Checks whether the first argument is lexicographically greater-than or equal-to the second argument.
Definition: Templates.hpp:338
static Simplex Get(const SimplexEdge &s0) noexcept
Gets the Simplex for the given simplex edge.
Definition: Simplex.cpp:60
Invalid argument logic error.
Definition: InvalidArgument.hpp:33
Length2 rB
Relative B.
Definition: RopeJointConf.hpp:93
::playrho::propagate_const< T > argument_type
Argument type.
Definition: propagate_const.hpp:411
std::size_t size_type
Size type.
Definition: BlockAllocator.hpp:38
NonNegative< Frequency > frequency
Mass-spring-damper frequency.
Definition: DistanceJointConf.hpp:104
typename Wider< value_type >::type wider_type
Widened type alias.
Definition: Fixed.hpp:554
Area GetMinSeparationSquared() const noexcept
Gets the min separation squared.
Definition: VertexSet.hpp:56
static constexpr playrho::Fixed< BT, FB > min() noexcept
Gets the min value available for the type.
Definition: FixedLimits.hpp:37
Length2 GetLocalPoint(const Body &body, const Length2 worldPoint) noexcept
Gets a local point relative to the body's origin given a world point.
Definition: Body.hpp:1235
static constexpr CountType GetInitialCapacity() noexcept
Gets the initial capacity.
Definition: GrowableStack.hpp:45
friend bool operator!=(const ConvexHull &lhs, const ConvexHull &rhs) noexcept
Inequality operator.
Definition: MultiShapeConf.hpp:72
LinearVelocity m_tangentSpeed
Tangent speed (4-bytes).
Definition: VelocityConstraint.hpp:290
MultiShapeConf & Transform(const Mat22 &m) noexcept
Transforms the vertices of all the children by the given transformation matrix.
Definition: MultiShapeConf.cpp:99
constexpr AngularMomentum GetAngularReaction(const DistanceJointConf &) noexcept
Gets the current angular reaction for the given configuration.
Definition: DistanceJointConf.hpp:170
constexpr auto GetIndexB() const noexcept
Gets index B.
Definition: SimplexEdge.hpp:63
static Manifold GetForFaceB(UnitVec ln, Length2 lp, const Point &mp1) noexcept
Gets a face B typed manifold.
Definition: Manifold.hpp:221
DynamicTreeOpcode
Opcodes for dynamic tree callbacks.
Definition: DynamicTree.hpp:745
bool operator()(const ::playrho::propagate_const< T > &pc1, const ::playrho::propagate_const< T > &pc2) const
Not-equal-to operation functor.
Definition: propagate_const.hpp:443
constexpr Interval & Include(const value_type &v) noexcept
Includes the given value into this interval.
Definition: Interval.hpp:145
NonNegative< Length > GetRadius() const noexcept
Gets the radius property.
Definition: DiskShapeConf.hpp:80
void SetLeafData(Size index, LeafData value) noexcept
Sets the leaf data for the element at the given index to the given value.
Definition: DynamicTree.hpp:617
void push(const ElementType &element)
Pushes the given elements onto this stack.
Definition: GrowableStack.hpp:76
FixtureID CreateFixture(World &world, FixtureConf def, bool resetMassData)
Creates a fixture within the specified world.
Definition: WorldFixture.cpp:48
reference operator[](size_type pos)
Array index operator.
Definition: ArrayAllocator.hpp:127
An "is valid shape type" trait.
Definition: Shape.hpp:518
VariantData() noexcept
Default constructor.
Definition: DynamicTree.hpp:372
constexpr BodyConf & UseAngularAcceleration(AngularAcceleration v) noexcept
Use the given angular acceleration.
Definition: BodyConf.hpp:216
RotInertia angularMass
Angular mass.
Definition: MotorJointConf.hpp:118
Momentum maxIncImpulse
Max incremental impulse.
Definition: StepStats.hpp:75
constexpr DynamicTree::BranchData ReplaceChild(DynamicTree::BranchData bd, DynamicTree::Size oldChild, DynamicTree::Size newChild)
Replaces the old child with the new child.
Definition: DynamicTree.hpp:629
Contacts contacts
Container of contact identifiers.
Definition: Island.hpp:51
constexpr ToiConf & UseTimeMax(Real value) noexcept
Uses the given time max value.
Definition: TimeOfImpact.hpp:109
Length GetLinearUpperLimit(const Joint &object)
Gets the upper linear joint limit.
Definition: Joint.cpp:487
Fixed< BT, FB > sin(Fixed< BT, FB > arg)
Computes the sine of the argument for Fixed types.
Definition: FixedMath.hpp:433
static EdgeShapeConf GetDefaultConf() noexcept
Gets the default configuration.
Definition: EdgeShapeConf.hpp:51
float Real
Real-number type.
Definition: Real.hpp:69
@ e_touching
Touching.
Definition: TimeOfImpact.hpp:204
NonNegative< Length > vertexRadius
Vertex radius.
Definition: EdgeShapeConf.hpp:100
Shape & operator=(const Shape &other)=default
Copy assignment operator.
reference operator[](size_type i)
Indexed operator.
Definition: AllocatedArray.hpp:121
constexpr auto GetReflectionMatrix(UnitVec axis)
Gets the reflection matrix for the given unit vector that defines the normal of the line through the ...
Definition: Math.hpp:946
PROPAGATE_CONST_CONSTEXPR propagate_const(U &&u)
Move constructor.
Definition: propagate_const.hpp:152
SizedRange< Fixtures::const_iterator > GetFixturesForProxies() const noexcept
Gets the fixtures-for-proxies range for this world.
Definition: WorldImpl.hpp:920
void SetLinearLimits(Joint &object, Length lower, Length upper)
Sets the joint limits.
Definition: Joint.cpp:496
PROPAGATE_CONST_CONSTEXPR void swap(propagate_const &pt) noexcept(noexcept(swap(std::declval< T & >(), std::declval< T & >())))
Swap support.
Definition: propagate_const.hpp:225
constexpr auto ComputeSqrt(Fixed< BT, FB > arg)
Computes the square root of a non-negative value.
Definition: FixedMath.hpp:310
void SetRestitution(Contact &contact, Real value)
Sets the restitution value for the identified contact.
Definition: Contact.hpp:748
Branch data of a tree node.
Definition: DynamicTree.hpp:310
constexpr DiskShapeConf & UseRadius(NonNegative< Length > r) noexcept
Uses the given value as the radius.
Definition: DiskShapeConf.hpp:65
std::function< DynamicTreeOpcode(DynamicTree::Size)> DynamicTreeSizeCB
Query callback type.
Definition: DynamicTree.hpp:751
AngularMomentum angularImpulse
Angular impulse.
Definition: FrictionJointConf.hpp:90
ContactCounter contactsUpdated
Contacts updated.
Definition: IslandStats.hpp:35
constexpr Fixed(unsigned long val) noexcept
Initializing constructor.
Definition: Fixed.hpp:177
BodyCounter underlying_type
Underlying type alias.
Definition: IndexingNamedType.hpp:43
NonNegative< Length > GetVertexRadius() const noexcept
Gets the vertex radius of this convex hull.
Definition: MultiShapeConf.hpp:55
constexpr auto size(IndexPair3 pairs) -> decltype(GetNumValidIndices(pairs))
Gets the dynamic size of the given collection of index pairs.
Definition: IndexPair.hpp:77
auto GetVertexRadius() const noexcept
Gets the vertex radius of the vertices of the associated shape.
Definition: DistanceProxy.hpp:131
Real ComputePerimeterRatio(const DynamicTree &tree) noexcept
Gets the ratio of the sum of the perimeters of nodes to the root perimeter.
Definition: DynamicTree.cpp:761
friend PROPAGATE_CONST_CONSTEXPR bool operator!=(const propagate_const &pt, const U &u)
Not-equals operator.
Definition: propagate_const.hpp:315
constexpr AABB(const Location p) noexcept
Initializing constructor for a single point.
Definition: AABB.hpp:91
void SetJointDestructionListener(const JointListener &listener) noexcept
Registers a destruction listener for joints.
Definition: World.cpp:51
T value_type
Value type.
Definition: AllocatedArray.hpp:39
Force GetMaxMotorForce(const Joint &object)
Gets the given joint's max motor force if its type supports that.
Definition: Joint.cpp:332
Configuration for a body.
Definition: BodyConf.hpp:50
SimplexEdge()=default
Default constructor.
constexpr Length2 GetLocation(const Transformation &value) noexcept
Gets the location information from the given transformation.
Definition: Transformation.hpp:69
::playrho::propagate_const< T > first_argument_type
First argument type.
Definition: propagate_const.hpp:481
InvMass invGamma
Inverse gamma. 4-bytes (with 4-byte Real).
Definition: DistanceJointConf.hpp:120
UnitVec localYAxisA
The local Y translation unit axis in body A.
Definition: PrismaticJointConf.hpp:125
const Transformation & GetTransformation() const noexcept
Gets the body transform for the body's origin.
Definition: Body.hpp:514
constexpr ToiConf & UseTargetDepth(Length value) noexcept
Uses the given target depth value.
Definition: TimeOfImpact.hpp:115
UnitVec GetUnitVector(Vector2< T > value, UnitVec fallback=UnitVec::GetDefaultFallback())
Gets the unit vector for the given value.
Definition: Math.hpp:799
typename HasType< T, Tuple >::type TupleContainsType
Tuple contains type alias.
Definition: Templates.hpp:262
void SetFixture(FixtureID id, const FixtureConf &value)
Sets the identified fixture's state.
Definition: World.cpp:206
void ResetUnderActiveTime() noexcept
Resets the under-active time for this body.
Definition: Body.hpp:609
const char * ToString(LimitState val) noexcept
Provides a human readable C-style string uniquely identifying the given limit state.
Definition: LimitState.cpp:29
std::vector< Length2 > GetConvexHullAsVector(Span< const Length2 > vertices)
Gets the convex hull for the given collection of vertices as a vector.
Definition: DistanceProxy.cpp:61
bool bullet
Is this a fast moving body that should be prevented from tunneling through other moving bodies?...
Definition: BodyConf.hpp:160
Length2 localAnchorA
The local anchor point relative to body A's origin.
Definition: WheelJointConf.hpp:103
constexpr Span(data_type(&array)[SIZE]) noexcept
Initializing constructor.
Definition: Span.hpp:68
constexpr Fixed operator-() const noexcept
Negation operator.
Definition: Fixed.hpp:328
const value_type & const_reference
Constant reference type.
Definition: UnitVec.hpp:59
Joint(Joint &&other) noexcept
Move constructor.
Definition: Joint.hpp:173
constexpr UnitVec operator+() const noexcept
Positive operator.
Definition: UnitVec.hpp:284
void SetTarget(Joint &object, Length2 value)
Sets the given joint's target property if it has one.
Definition: Joint.cpp:468
Vec2 JvBD
BD Jv data.
Definition: GearJointConf.hpp:108
constexpr TreeNode(const LeafData &value, AABB aabb, Size other=DynamicTree::GetInvalidSize()) noexcept
Initializing constructor.
Definition: DynamicTree.hpp:426
std::vector< value_type > m_data
Array data (both used & free).
Definition: ArrayAllocator.hpp:187
constexpr Fixed(value_type val, scalar_type scalar) noexcept
Initializing constructor.
Definition: Fixed.hpp:569
PLAYRHO_QUANTITY(boost::units::si::frequency) Frequency
Frequency quantity.
Definition: Units.hpp:150
SizedRange< WorldImpl::Fixtures::const_iterator > GetFixtures(BodyID id) const
Gets the range of all constant fixtures attached to this body.
Definition: WorldImpl.cpp:2318
constexpr auto & UseRatio(Real v) noexcept
Uses the given ratio value.
Definition: PulleyJointConf.hpp:81
Point array structure.
Definition: Manifold.hpp:423
Length2 groundAnchorA
The first ground anchor in world coordinates. This point never moves.
Definition: PulleyJointConf.hpp:88
TargetJointConf GetTargetJointConf(const Joint &joint)
Gets the definition data for the given joint.
Definition: TargetJointConf.cpp:46
std::uint16_t FlagsType
Flags type.
Definition: Body.hpp:75
Acceleration CalcGravitationalAcceleration(const World &world, BodyID body)
Calculates the gravitationally associated acceleration for the given body within its world.
Definition: WorldBody.cpp:166
constexpr ConstraintSolverConf & UseResolutionRate(Real value) noexcept
Uses the given resolution rate.
Definition: ConstraintSolverConf.hpp:35
Underlying-type template class.
Definition: IndexingNamedType.hpp:160
constexpr CheckedValue(value_type value) noexcept(noexcept(checker_type{}(value)))
Initializing constructor.
Definition: CheckedValue.hpp:84
IndexPair m_indexPair
Index pair.
Definition: SimplexEdge.hpp:71
@ e_maxToiIters
Max TOI iterations.
Definition: TimeOfImpact.hpp:233
bool operator!=(const DistanceProxy &lhs, const DistanceProxy &rhs) noexcept
Determines with the two given distance proxies are not equal.
Definition: DistanceProxy.hpp:199
constexpr auto DefaultAngularSlop
Default angular slop.
Definition: Settings.hpp:152
Rope joint definition.
Definition: RopeJointConf.hpp:57
constexpr auto InverseRotate(const Vector2< T > vector, const UnitVec &angle) noexcept
Inverse rotates a vector.
Definition: Math.hpp:785
friend PROPAGATE_CONST_CONSTEXPR bool operator<=(const propagate_const &pt, const U &u)
Less-than or equal-to operator.
Definition: propagate_const.hpp:336
constexpr auto GetDefaultToiConf()
Gets the default time of impact configuration.
Definition: TimeOfImpact.hpp:147
EdgeShapeConf & UseVertexRadius(NonNegative< Length > value) noexcept
Uses the given vertex radius.
Definition: EdgeShapeConf.hpp:107
void * Allocate(size_type n)
Allocates memory.
Definition: BlockAllocator.cpp:128
std::int64_t type
Wider type.
Definition: Wider.hpp:61
Momentum2 impulse
"Normal" and "tangent" impulses at the point.
Definition: WorldManifold.hpp:68
value_type * pointer
Pointer type.
Definition: ArrayList.hpp:55
std::remove_const< decltype(MaxManifoldPoints)>::type size_type
Size type.
Definition: WorldManifold.hpp:61
@ e_circles
Circles type.
Definition: Manifold.hpp:96
static constexpr CountType GetBufferGrowthRate() noexcept
Gets the buffer growth rate.
Definition: GrowableStack.hpp:51
constexpr WorldManifold(UnitVec normal, PointData ps0, PointData ps1) noexcept
Initializing constructor.
Definition: WorldManifold.hpp:98
BodyID m_bodyA
Identifier for body-A.
Definition: VelocityConstraint.hpp:280
Momentum GetTangentImpulseAtPoint(const VelocityConstraint &vc, VelocityConstraint::size_type index)
Gets the tangent impulse at the given point from the given velocity constraint.
Definition: VelocityConstraint.hpp:430
A node in the dynamic tree.
Definition: DynamicTree.hpp:408
~FlagGuard() noexcept
Destructor.
Definition: FlagGuard.hpp:59
const_iterator cend() const
Gets the "end" iterator value for this array.
Definition: AllocatedArray.hpp:165
detail::IndexingNamedType< BodyCounter, struct BodyIdentifier > BodyID
Identifier for bodies.
Definition: BodyID.hpp:30
EdgeShapeConf & Transform(const Mat22 &m) noexcept
Transforms both vertices by the given transformation matrix.
Definition: EdgeShapeConf.cpp:43
const_reverse_iterator rend() const noexcept
Gets a reverse "end" iterator.
Definition: Vector.hpp:149
constexpr bool IsLeaf(const DynamicTree::TreeNode &node) noexcept
Is leaf.
Definition: DynamicTree.hpp:647
ArrayAllocator< T >::size_type used(const ArrayAllocator< T > &array) noexcept
Gets the number of elements that are used in the specified structure.
Definition: ArrayAllocator.hpp:194
2-D velocity related data structure.
Definition: Velocity.hpp:38
auto sqrt(Fixed< BT, FB > arg)
Square root's the given value.
Definition: FixedMath.hpp:384
bool IsFullOfBodies(const Island &island)
Determines whether the given island is full of bodies.
Definition: Island.hpp:65
IndexPair indices
Index pair.
Definition: IndexPair.hpp:138
friend MassData GetMassData(const Shape &shape) noexcept
Gets the mass properties of this shape using its dimensions and density.
Definition: Shape.hpp:281
constexpr iterator_type begin() const noexcept
Gets the "begin" index value.
Definition: Range.hpp:51
iteration_type maxToiRootIters
Max TOI root finder iterations.
Definition: StepConf.hpp:248
JointCounter GetJointRange() const noexcept
Gets the extent of the currently valid joint range.
Definition: World.cpp:141
@ e_belowMinTarget
Below minimum target.
Definition: TimeOfImpact.hpp:236
constexpr auto SquareSecond
Square second unit.
Definition: Units.hpp:324
The per-contact position constraint data structure.
Definition: PositionConstraint.hpp:31
Angle GetDelta(Angle a1, Angle a2) noexcept
Gets the shortest angular distance to go from angle 1 to angle 2.
Definition: Math.cpp:26
std::array< VertexCounter, N > VertexCounterArray
Vertex counter array template alias.
Definition: IndexPair.hpp:91
T data_type
Type alias for the type of the data held.
Definition: Shape.hpp:424
void SetPostSolveContactListener(ImpulsesContactListener listener) noexcept
Register a post-solve contact event listener.
Definition: WorldImpl.hpp:1029
ClipList ClipSegmentToLine(const ClipList &vIn, const UnitVec &normal, Length offset, ContactFeature::Index indexA)
Clipping for contact manifolds.
Definition: Collision.cpp:68
auto GetIndex() const noexcept
Gets the current index location.
Definition: StackAllocator.hpp:112
constexpr friend bool operator<=(const IndexingNamedType &lhs, const IndexingNamedType &rhs)
Less-than-or-equal-to operator.
Definition: IndexingNamedType.hpp:115
bool IsMassDataDirty() const noexcept
Gets whether the mass data for this body is "dirty".
Definition: Body.hpp:671
Revnum minor
Minor version number.
Definition: Version.hpp:54
FixtureConf & UseShape(T &&value) noexcept
Uses the given value for the configuration of the shape member variable.
Definition: FixtureConf.hpp:59
NonNegative< Length > m_vertexRadius
Radius of the vertices of the associated shape.
Definition: DistanceProxy.hpp:188
std::remove_const< decltype(MaxShapeVertices)>::type VertexCounter
Vertex count type.
Definition: Settings.hpp:122
void SetVelocity(Body &body, const Velocity &value) noexcept
Sets the body's velocity (linear and angular velocity).
Definition: Body.hpp:1158
void SetTorque(World &world, BodyID id, Torque torque) noexcept
Sets the given amount of torque to the given body.
Definition: WorldBody.hpp:763
@ Terminate
End the ray-cast search for fixtures.
constexpr Mat22 MulT(const Mat22 &A, const Mat22 &B) noexcept
Computes A^T * B.
Definition: Math.hpp:597
friend PROPAGATE_CONST_CONSTEXPR bool operator!=(const propagate_const &pt, std::nullptr_t)
Not-equals operator.
Definition: propagate_const.hpp:254
constexpr auto Deci
Deci- (1 x 10^-1).
Definition: RealConstants.hpp:77
void pop_back() noexcept
Pop "back".
Definition: AllocatedArray.hpp:201
constexpr BodyConf & UseAngularDamping(NonNegative< Frequency > v) noexcept
Use the given angular damping.
Definition: BodyConf.hpp:228
propagate_const(const propagate_const &p)=delete
Explicityly deleted copy constructor.
std::size_t size_type
Size type.
Definition: Span.hpp:53
BodyID GetBodyB() const noexcept
Gets body B.
Definition: PositionConstraint.hpp:53
value_type * iterator
Iterator type.
Definition: Vector.hpp:72
iteration_type maxSubSteps
Maximum sub steps.
Definition: StepConf.hpp:264
void ApplyLinearImpulse(Body &body, Momentum2 impulse, Length2 point) noexcept
Applies an impulse at a point.
Definition: Body.cpp:242
constexpr auto & UseMaxTorque(NonNegative< Torque > v) noexcept
Uses the given maximum torque value.
Definition: FrictionJointConf.hpp:70
constexpr WorldConf GetDefaultWorldConf() noexcept
Gets the default definitions value.
Definition: WorldConf.hpp:90
constexpr ToiConf & UseMaxDistIters(dist_iter_type value) noexcept
Uses the given max distance iterations value.
Definition: TimeOfImpact.hpp:139
constexpr Fixed< BT, FB > sin(Fixed< BT, FB > arg)
Computes the sine of the given argument via Maclaurin series approximation.
Definition: FixedMath.hpp:218
SizedRange< Bodies::const_iterator > GetBodiesForProxies() const noexcept
Gets the bodies-for-proxies range for this world.
Definition: WorldImpl.hpp:915
constexpr BodyID GetBody2() const
Gets body 2.
Definition: JointKey.hpp:57
constexpr auto GetLength(const DistanceJointConf &object) noexcept
Free function for getting the length value of the given configuration.
Definition: DistanceJointConf.hpp:219
const DistanceProxy & proxyA
Distance proxy A.
Definition: SeparationScenario.hpp:52
Length2 rB
Relative B.
Definition: WeldJointConf.hpp:108
const_reverse_iterator crend() const noexcept
Gets a reverse "end" iterator.
Definition: UnitVec.hpp:189
NonNegative< AreaDensity > GetDensity_() const noexcept override
Gets the density.
Definition: Shape.hpp:454
Real MixRestitution(Real restitution1, Real restitution2) noexcept
Mixes restitution.
Definition: Contact.hpp:57
void SetEnabled() noexcept
Sets the enabled state.
Definition: Body.hpp:676
bool IsLocked() const noexcept
Is the world locked (in the middle of a time step).
Definition: World.cpp:106
std::function< void(FixtureID)> FixtureListener
Listener type for some fixture related events.
Definition: World.hpp:147
const_pointer find(Length2 value) const
Finds contained point whose delta with the given point has a squared length less than or equal to thi...
Definition: VertexSet.hpp:92
constexpr Fixed & operator*=(Fixed val) noexcept
Multiplication assignment operator.
Definition: Fixed.hpp:430
friend void InitVelocity(Joint &object, std::vector< BodyConstraint > &bodies, const playrho::StepConf &step, const ConstraintSolverConf &conf)
Initializes velocity constraint data based on the given solver data.
Definition: Joint.hpp:303
bool operator()(const ::playrho::propagate_const< T > &pc) const
Hash operation functor.
Definition: propagate_const.hpp:414
Real GetRestitution(const Shape &shape) noexcept
Gets the coefficient of restitution value of the given shape.
Definition: Shape.hpp:299
LinearAcceleration2 linearAcceleration
Initial linear acceleration of the body.
Definition: BodyConf.hpp:125
pointer data() const noexcept
Direct access to data.
Definition: Span.hpp:109
bool enableMotor
Enable/disable the joint motor.
Definition: WheelJointConf.hpp:115
PositionConstraint(const Manifold &m, BodyID bA, BodyID bB, Length radius)
Initializing constructor.
Definition: PositionConstraint.hpp:36
UnitVec normal
Surface normal in world coordinates at the point of contact.
Definition: RayCastOutput.hpp:80
@ e_velocityFlag
Velocity flag.
Definition: Body.hpp:100
void Advance0(Real value) noexcept
Calls the body sweep's Advance0 method to advance to the given value.
Definition: Body.hpp:429
counter_type maxSimulContacts
Max contacts occurring simultaneously.
Definition: StepStats.hpp:88
Real mass
Either linear mass or angular mass.
Definition: GearJointConf.hpp:113
T data_type
Data type.
Definition: Span.hpp:44
Coefficients m_normalizedWeights
Normalized weights.
Definition: Simplex.hpp:158
NonNegative< Length > vertexRadius
Vertex radius.
Definition: PolygonShapeConf.hpp:179
NonNegative< Length > vertexRadius
Vertex radius.
Definition: MultiShapeConf.hpp:105
InvRotInertia gamma
Gamma.
Definition: WeldJointConf.hpp:105
constexpr bool IsUnused(const DynamicTree::TreeNode &node) noexcept
Is unused.
Definition: DynamicTree.hpp:638
Length GetMinVertexRadius(const WorldImpl &world) noexcept
Gets the minimum vertex radius that shapes in this world can be.
Definition: WorldImplMisc.cpp:137
ContactListener m_beginContactListener
Listener for beginning contact events.
Definition: WorldImpl.hpp:873
VelocityConstraint & operator=(const VelocityConstraint ©)=default
Assignment operator.
void SetTransformation(const Transformation &value) noexcept
Sets the body's transformation.
Definition: Body.hpp:519
void SetForce(World &world, BodyID id, Force2 force, Length2 point) noexcept
Sets the given amount of force at the given point to the given body.
Definition: WorldBody.hpp:750
constexpr Interval & Intersect(const Interval &v) noexcept
Intersects this interval with the given interval.
Definition: Interval.hpp:166
Prismatic joint definition.
Definition: PrismaticJointConf.hpp:57
std::vector< Length2 > GetCircleVertices(Length radius, unsigned slices, Angle start, Real turns)
Gets the vertices for a circle described by the given parameters.
Definition: Math.cpp:80
Vec2 JvAC
AC Jv data.
Definition: GearJointConf.hpp:107
constexpr WorldConf & UseMinVertexRadius(Positive< Length > value) noexcept
Uses the given min vertex radius value.
Definition: WorldConf.hpp:66
void * Allocate(size_type size)
Allocates an aligned block of memory of the given size.
Definition: StackAllocator.cpp:56
Real GetDampingRatio(const Joint &object)
Gets the given joint's damping ratio property if it has one.
Definition: Joint.cpp:389
Length2 linearError
Linear error.
Definition: MotorJointConf.hpp:115
Joint & operator=(Joint &&other) noexcept
Move assignment.
Definition: Joint.hpp:231
friend PROPAGATE_CONST_CONSTEXPR bool operator==(std::nullptr_t, const propagate_const &pu)
Equals operator.
Definition: propagate_const.hpp:249
Angle maxRotation
Maximum rotation.
Definition: MovementConf.hpp:34
Distance joint definition.
Definition: DistanceJointConf.hpp:52
WeldJointConf GetWeldJointConf(const Joint &joint)
Gets the definition data for the given joint.
Definition: WeldJointConf.cpp:101
constexpr auto SquareRadian
Square radian unit type.
Definition: Units.hpp:379
constexpr UnitVec GetYAxis(UnitVec rot) noexcept
Gets the "Y-axis".
Definition: UnitVec.hpp:310
Frequency GetLinearDamping() const noexcept
Gets the linear damping of the body.
Definition: Body.hpp:544
constexpr Transformation MulT(const Transformation &A, const Transformation &B) noexcept
Inverse multiplies a given transformation by another given transformation.
Definition: Math.hpp:868
Length GetCurrentLengthA(const World &world, JointID id)
Get the current length of the segment attached to body-A.
Definition: WorldJoint.cpp:309
constexpr Fixed operator+() const noexcept
Positive operator.
Definition: Fixed.hpp:334
virtual Real GetRestitution_() const noexcept=0
Gets the restitution.
root_iter_type maxRootIters
Maximum number of root finder iterations.
Definition: TimeOfImpact.hpp:102
static UpdateContactsData UpdateContactTOIs(ArrayAllocator< Contact > &contactBuffer, ArrayAllocator< Body > &bodyBuffer, const ArrayAllocator< FixtureConf > &fixtureBuffer, const Contacts &contacts, const StepConf &conf)
Updates the contact times of impact.
Definition: WorldImpl.cpp:1150
ToiStepStats toi
TOI-phase step statistics.
Definition: StepStats.hpp:119
Simplex cache.
Definition: Simplex.hpp:82
PLAYRHO_QUANTITY(playrho::units::si::second_moment_of_area) SecondMomentOfArea
Second moment of area quantity.
Definition: Units.hpp:263
Length JwC
C Jw data.
Definition: GearJointConf.hpp:111
Acceleration GetAcceleration(const Body &body) noexcept
Gets the given body's acceleration.
Definition: Body.hpp:1020
Vec3 impulse
Impulse.
Definition: PrismaticJointConf.hpp:130
Manifold::Conf GetManifoldConf(const StepConf &conf) noexcept
Gets the manifold configuration for the given step configuration.
Definition: Manifold.cpp:104
::playrho::propagate_const< T > first_argument_type
First argument type.
Definition: propagate_const.hpp:453
Time GetUnderActiveTime(const Body &body) noexcept
Gets the given body's under-active time.
Definition: Body.hpp:930
void SetMotorSpeed(Joint &object, AngularVelocity value)
Sets the given joint's motor speed if its type supports that.
Definition: Joint.cpp:269
constexpr Fixed(const Fixed< BT, FB > val) noexcept
Initializing constructor.
Definition: Fixed.hpp:227
constexpr auto & UseLowerLength(Length v) noexcept
Uses the given lower translation value.
Definition: PrismaticJointConf.hpp:81
This is a growable LIFO stack with an initial capacity of N. If the stack size exceeds the initial ca...
Definition: GrowableStack.hpp:35
Length2 GetLocalAnchorA(const Joint &object)
Get the anchor point on body-A in local coordinates.
Definition: Joint.cpp:62
constexpr const char * GetTypeName() noexcept
Gets the name associated with the given template parameter type.
Definition: TypeInfo.hpp:133
const data_type & operator[](size_type index) const noexcept
Accesses the indexed element.
Definition: Span.hpp:99
constexpr ToiConf & UseMaxToiIters(toi_iter_type value) noexcept
Uses the given max TOI iterations value.
Definition: TimeOfImpact.hpp:133
PROPAGATE_CONST_CONSTEXPR propagate_const & operator=(U &&u)
Move assignment operator for compatible types.
Definition: propagate_const.hpp:179
friend PROPAGATE_CONST_CONSTEXPR bool operator!=(const U &u, const propagate_const &pu)
Not-equals operator.
Definition: propagate_const.hpp:357
Length a1
Location A-1.
Definition: PrismaticJointConf.hpp:159
2-D positional data structure.
Definition: Position.hpp:37
void ResetMassData(World &world, BodyID id)
Resets the mass data properties.
Definition: WorldBody.hpp:611
constexpr auto Dot(const T1 a, const T2 b) noexcept
Performs the dot product on two vectors (A and B).
Definition: Math.hpp:359
constexpr auto IsFull(const T &arg) -> decltype(size(arg)==max_size(arg))
Checks whether the given container is full.
Definition: Templates.hpp:72
Wrong state logic error.
Definition: WrongState.hpp:33
constexpr std::enable_if_t< std::is_signed< T >::value, std::make_unsigned_t< T > > MakeUnsigned(const T &arg) noexcept
Makes the given value into an unsigned value.
Definition: Math.hpp:114
constexpr BranchData AsBranch() const noexcept
Gets the node as a "branch" value.
Definition: DynamicTree.hpp:498
size_type m_size
Size of array of data.
Definition: Span.hpp:116
Length maxLinearCorrection
Maximum linear correction.
Definition: ConstraintSolverConf.hpp:92
const_pointer cend() const noexcept
Gets the "end" iterator value.
Definition: Span.hpp:89
UnitVec ay
Solver A Y directional.
Definition: WheelJointConf.hpp:134
ContactFeature::Type CfType
Contact feature type.
Definition: Manifold.hpp:75
constexpr Sweep(const Sweep ©)=default
Copy constructor.
static constexpr Fixed GetMin() noexcept
Gets the min value this type is capable of expressing.
Definition: Fixed.hpp:74
Torque maxMotorTorque
The maximum motor torque.
Definition: WheelJointConf.hpp:118
AngularMomentum GetAngularReaction(const Joint &object)
Get the angular reaction on body-B.
Definition: Joint.cpp:174
void RemovePoint() noexcept
Removes the last point added.
Definition: VelocityConstraint.hpp:295
const_iterator cend() const noexcept
Gets an "end" iterator.
Definition: Vector.hpp:122
Momentum impulse
Impulse.
Definition: WheelJointConf.hpp:129
constexpr ContactFeature GetVertexFaceContactFeature(ContactFeature::Index a, ContactFeature::Index b) noexcept
Gets the vertex face contact feature for the given indices.
Definition: ContactFeature.hpp:68
constexpr T GetModuloNext(T value, T count) noexcept
Gets the modulo next value.
Definition: Math.hpp:658
constexpr auto EarthlyLinearAcceleration
Earthly gravity.
Definition: Units.hpp:844
constexpr underlying_type const & get() const noexcept
Accesses the underlying value.
Definition: IndexingNamedType.hpp:78
Negative constrained value checker.
Definition: Negative.hpp:30
constexpr Interval(const value_type &v) noexcept
Initializing constructor.
Definition: Interval.hpp:86
T data_type
Type alias for the type of the data held.
Definition: Joint.hpp:377
std::ptrdiff_t difference_type
Difference type.
Definition: AllocatedArray.hpp:57
static Manifold GetForFaceB(UnitVec nb, CfIndex ib, Length2 pb, CfType ta0, CfIndex ia0, Length2 pa0, CfType ta1, CfIndex ia1, Length2 pa1) noexcept
Gets the face B manifold for the given data.
Definition: Manifold.hpp:292
constexpr auto GetMaxTorque(const FrictionJointConf &object) noexcept
Free function for getting the max torque value of the given configuration.
Definition: FrictionJointConf.hpp:191
constexpr WorldManifold(UnitVec normal, PointData ps0) noexcept
Initializing constructor.
Definition: WorldManifold.hpp:87
const void * GetData_() const noexcept override
Gets the data for the underlying configuration.
Definition: Shape.hpp:487
const Type type
The type of this scenario.
Definition: SeparationScenario.hpp:60
static Manifold GetForFaceA(UnitVec normalA, Length2 faceA) noexcept
Gets a face A typed manifold.
Definition: Manifold.hpp:177
bool ShiftOrigin_(Length2 value) noexcept override
Call to notify joint of a shift in the world origin.
Definition: Joint.hpp:445
static constexpr const char * GetNameForTypeInfo() noexcept
Gets a null-terminated byte string identifying this function.
Definition: TypeInfo.hpp:37
constexpr const_reference at(size_type pos) const
Gets a constant reference to the requested element.
Definition: UnitVec.hpp:217
const Manifold & GetManifold(ContactID id) const
Gets the identified manifold.
Definition: WorldImpl.cpp:2651
::playrho::propagate_const< T > second_argument_type
Second argument type.
Definition: propagate_const.hpp:454
static constexpr Fixed GetNaN() noexcept
Gets a NaN value for this type.
Definition: Fixed.hpp:93
constexpr auto & get(Vector< T, N > &v) noexcept
Gets the specified element of the given collection.
Definition: Vector.hpp:521
Length2 localAnchorC
Local anchor C.
Definition: GearJointConf.hpp:87
Length2 GetAnchorA(const World &world, JointID id)
Get the anchor point on body-A in world coordinates.
Definition: WorldJoint.cpp:208
void SetAllowSleeping() noexcept
Sets the allow sleeping state.
void ResetFriction(World &world, ContactID id)
Resets the friction mixture to the default value.
Definition: WorldContact.hpp:225
constexpr ConstraintSolverConf & UseLinearSlop(Length value) noexcept
Uses the given linear slop.
Definition: ConstraintSolverConf.hpp:42
constexpr auto operator()(const T &v) -> decltype(!(v >=static_cast< T >(0)), T
Value checking functor.
Definition: NonNegative.hpp:42
Length GetMaxRegLinearCorrection(const StepConf &conf) noexcept
Gets the maximum regular linear correction from the given value.
Definition: StepConf.hpp:286
Force GetMaxForce(const Joint &object)
Gets the given joint's max force if its type supports that.
Definition: Joint.cpp:305
void SetLinearDamping(NonNegative< Frequency > linearDamping) noexcept
Sets the linear damping of the body.
Definition: Body.hpp:549
Pre-phase per-step statistics.
Definition: StepStats.hpp:30
Length2 linear
Linear position.
Definition: Position.hpp:38
constexpr bool IsUnused(const DynamicTree::TreeNode &node) noexcept
Is unused.
Definition: DynamicTree.hpp:638
static MultiShapeConf GetDefaultConf() noexcept
Gets the default configuration for a MultiShapeConf.
Definition: MultiShapeConf.hpp:120
Momentum tangentImpulse
Tangent impulse.
Definition: VelocityConstraint.hpp:198
LinearVelocity linearSleepTolerance
Linear sleep tolerance.
Definition: StepConf.hpp:191
void AddPoint(const Point &mp) noexcept
Adds a new point.
Definition: Manifold.hpp:499
const Joint & GetJoint(JointID id) const
Gets the identified joint.
Definition: WorldImpl.cpp:2641
NonNegative< AreaDensity > density
Area density of the associated shape.
Definition: ShapeConf.hpp:58
Length2 GetWorldCenter(const Body &body) noexcept
Get the world position of the center of mass.
Definition: Body.hpp:908
decltype(*std::declval< iterator_type >()) value_type
Value type alias.
Definition: Range.hpp:38
iteration_type iterations
Count of iterations performed to return result.
Definition: Distance.hpp:85
constexpr auto InvalidIndexPair3
Invalid array of three index-pair elements.
Definition: IndexPair.hpp:50
constexpr UnitVec Rotate(UnitVec amount) const noexcept
Rotates the unit vector by the given amount.
Definition: UnitVec.hpp:254
Version GetVersion() noexcept
Gets the version information of the library.
Definition: Version.cpp:36
size_type size() const noexcept
Gets the current size of this array.
Definition: AllocatedArray.hpp:97
InvRotInertia m_invRotI
Inverse rotational inertia about the center of mass.
Definition: Body.hpp:502
detail::IndexingNamedType< const char *const *, struct TypeIdentifier > TypeID
Type identifier.
Definition: TypeInfo.hpp:91
FixtureCounter GetFixtureCount(const World &world, BodyID id)
Gets the count of fixtures associated with the identified body.
Definition: WorldBody.hpp:129
void SetAwake(Body &body) noexcept
Awakens this body.
Definition: Body.hpp:822
Angle GetAngularOffset(const Joint &object)
Gets the angular offset property of the specified joint if its type has one.
Definition: Joint.cpp:612
Internal configuration concept.
Definition: Joint.hpp:325
InvRotInertia GetInvRotInertia() const noexcept
Gets the inverse rotational inertia of this body representation.
Definition: BodyConstraint.hpp:102
WorldImpl(const WorldImpl &other)=default
Copy constructor.
Name space for specializations of the standard library.
Definition: ArrayList.hpp:213
constexpr auto SetLength(DistanceJointConf &object, Length value) noexcept
Free function for setting the length value of the given configuration.
Definition: DistanceJointConf.hpp:226
FixtureID GetFixtureB(const Contact &contact) noexcept
Gets the fixture B associated with the given contact.
Definition: Contact.hpp:602
LinearVelocity2 linearVelocity
The linear velocity of the body's origin in world co-ordinates (in m/s).
Definition: BodyConf.hpp:118
void ApplyForce(World &world, BodyID id, Force2 force, Length2 point)
Apply a force at a world point.
Definition: WorldBody.cpp:499
UnitVec perp
Perpendicular.
Definition: PrismaticJointConf.hpp:156
Real dtRatio
Delta time ratio.
Definition: VelocityConstraint.hpp:53
constexpr auto max_size(IndexPair3 pairs) -> decltype(pairs.max_size())
Gets the maximum size of the given container of index pairs.
Definition: IndexPair.hpp:84
std::remove_const< decltype(DefaultMaxToiRootIters)>::type root_iter_type
Root iteration type.
Definition: StepStats.hpp:97
State state
State at time factor.
Definition: TimeOfImpact.hpp:258
void SetSweep(const Sweep &value) noexcept
Sets the sweep value of the given body.
Definition: Body.hpp:389
TypeID GetType(const Shape &shape) noexcept
Gets the type info of the use of the given shape.
Definition: Shape.hpp:329
Frequency GetInvDeltaTime(const WorldImpl &world) noexcept
Gets the inverse delta time.
Definition: WorldImplMisc.cpp:147
PROPAGATE_CONST_CONSTEXPR propagate_const()=default
Default constructor.
constexpr bool empty() const noexcept
Checks whether this span is empty.
Definition: Span.hpp:112
Proxies m_proxies
Proxies queue.
Definition: WorldImpl.hpp:853
Joints m_joints
Joint collection.
Definition: WorldImpl.hpp:859
LimitState GetLimitState(const Joint &object)
Definition: Joint.cpp:631
Momentum springImpulse
Spring impulse.
Definition: WheelJointConf.hpp:131
PLAYRHO_QUANTITY(boost::units::si::mass) Mass
Mass quantity.
Definition: Units.hpp:184
size_type m_pointCount
Number of defined manifold points (1-byte).
Definition: Manifold.hpp:442
typename detail::IsIterableImpl< T > IsIterable
Determines whether the given type is an iterable type.
Definition: Templates.hpp:225
constexpr auto DefaultToiMinMomentum
Default TOI-phase minimum momentum.
Definition: Settings.hpp:199
constexpr bool empty() const noexcept
Whether empty.
Definition: Vector.hpp:104
LinearVelocity2 GetLinearVelocityFromLocalPoint(const Body &body, const Length2 localPoint) noexcept
Gets the linear velocity from a local point.
Definition: Body.hpp:1270
long double type
Wider type.
Definition: Wider.hpp:76
bool operator()(const ::playrho::propagate_const< T > &pc1, const ::playrho::propagate_const< T > &pc2) const
Less-than operation functor.
Definition: propagate_const.hpp:457
void Free(size_type index)
Frees the previously-allocated index entry.
Definition: ArrayAllocator.hpp:100
Matrix22< Real > Mat22
2 by 2 matrix of Real elements.
Definition: Matrix.hpp:185
constexpr auto & UseDampingRatio(NonNegative< Real > v) noexcept
Use value for damping ratio.
Definition: TargetJointConf.hpp:94
friend PROPAGATE_CONST_CONSTEXPR bool operator==(const U &u, const propagate_const &pu)
Equals operator.
Definition: propagate_const.hpp:350
constexpr Fixed(float val) noexcept
Initializing constructor.
Definition: Fixed.hpp:163
const Joint & GetJoint(JointID id) const
Gets the value of the identified joint.
Definition: World.cpp:226
BodyID m_body1
Identifier of body 1.
Definition: JointKey.hpp:71
constexpr Fixed(long double val) noexcept
Initializing constructor.
Definition: Fixed.hpp:149
TypeID GetType_() const noexcept override
Gets the use type information.
Definition: Joint.hpp:397
friend bool operator==(const ConvexHull &lhs, const ConvexHull &rhs) noexcept
Equality operator.
Definition: MultiShapeConf.hpp:65
Shape & operator=(T &&other)
Move assignment operator.
Definition: Shape.hpp:250
AngularAcceleration GetAngularAcceleration(const Body &body) noexcept
Gets this body's angular acceleration.
Definition: Body.hpp:1048
constexpr RopeJointConf()=default
Default constructor.
constexpr std::enable_if_t< IsSquareMatrix< T >::value, T > GetIdentity()
Gets the identity matrix of the template type and size as given by the argument.
Definition: Matrix.hpp:116
constexpr BodyConf & UseEnabled(bool value) noexcept
Use the given enabled state.
Definition: BodyConf.hpp:264
::playrho::propagate_const< T > first_argument_type
First argument type.
Definition: propagate_const.hpp:467
Size GetLeafCount() const noexcept
Gets the current leaf node count.
Definition: DynamicTree.hpp:572
Fixtures m_fixturesForProxies
Fixtures for proxies queue.
Definition: WorldImpl.hpp:854
InvMass GetInvMass() const noexcept
Gets the inverse total mass of the body.
Definition: Body.hpp:534
void SetFixtureDestructionListener(FixtureListener listener) noexcept
Register a destruction listener for fixtures.
Definition: WorldImpl.hpp:1004
size_t result_type
Result type.
Definition: propagate_const.hpp:410
friend PROPAGATE_CONST_CONSTEXPR bool operator<=(const propagate_const &pt, const propagate_const< U > &pu)
Less-than or equal-to operator.
Definition: propagate_const.hpp:293
constexpr DiskShapeConf & UseLocation(Length2 value) noexcept
Uses the given value as the location.
Definition: DiskShapeConf.hpp:58
void SetMaxMotorForce(Joint &object, Force value)
Sets the given joint's max motor force if its type supports that.
Definition: Joint.cpp:341
std::unique_ptr< WorldImpl > CreateWorldImpl(const WorldConf &def)
Creates a new world with the given configuration.
Definition: WorldImplMisc.cpp:36
constexpr auto max_size(const T &arg) -> decltype(arg.max_size())
Gets the maximum size of the given container.
Definition: Templates.hpp:65
Size FindReference(Size index) const noexcept
Finds first node which references the given index.
Definition: DynamicTree.cpp:519
propagate_const< std::unique_ptr< WorldImpl > > m_impl
Pointer to implementation (PIMPL)
Definition: World.hpp:560
constexpr Vector< Length, N > GetCenter(const AABB< N > &aabb) noexcept
Gets the center of the AABB.
Definition: AABB.hpp:214
Real regResolutionRate
Regular resolution rate.
Definition: StepConf.hpp:85
constexpr auto & UseUpperAngle(Angle v) noexcept
Uses the given upper angle value.
Definition: RevoluteJointConf.hpp:90
void InitVelocity(DistanceJointConf &object, std::vector< BodyConstraint > &bodies, const StepConf &step, const ConstraintSolverConf &)
Initializes velocity constraint data based on the given solver data.
Definition: DistanceJointConf.cpp:80
virtual ChildCounter GetChildCount_() const noexcept=0
Gets the "child" count.
constexpr auto & UseMotorSpeed(AngularVelocity v) noexcept
Uses the given motor speed value.
Definition: PrismaticJointConf.hpp:102
void Transform(ChainShapeConf &arg, const Mat22 &m) noexcept
Transforms the given chain shape configuration's vertices by the given transformation matrix.
Definition: ChainShapeConf.hpp:196
counter_type skipped
Count of contacts Skipped (during update processing).
Definition: StepStats.hpp:39
constexpr bool IsEntirelyAfter(const Interval< T > &a, const Interval< T > &b)
Determines whether the first range is entirely after the second range.
Definition: Interval.hpp:275
constexpr BlockDeallocator(BlockAllocator *a, size_type n) noexcept
Initializing constructor.
Definition: BlockAllocator.hpp:135
constexpr AABB(std::enable_if_t< sizeof...(Tail)+1==N, LengthInterval > head, Tail... tail) noexcept
Initializing constructor.
Definition: AABB.hpp:78
Fixed< BT, FB > atan(Fixed< BT, FB > arg)
Computes the arc tangent.
Definition: FixedMath.hpp:452
constexpr FrictionJointConf()=default
Default constructor.
BodyConstraint & SetVelocity(Velocity value) noexcept
Sets the velocity of the body.
Definition: BodyConstraint.hpp:129
Target joint definition.
Definition: TargetJointConf.hpp:48
std::vector< BodyID > Bodies
Bodies container type.
Definition: World.hpp:132
Type information.
Definition: TypeInfo.hpp:55
constexpr BodyConf & Use(Position v) noexcept
Use the given position for the linear and angular positions.
Definition: BodyConf.hpp:184
constexpr friend bool operator>=(const IndexingNamedType &lhs, const IndexingNamedType &rhs)
Greater-than-or-equal-to operator.
Definition: IndexingNamedType.hpp:121
Distance Output.
Definition: Distance.hpp:70
ContactCounter contactsSkipped
Contacts skipped.
Definition: IslandStats.hpp:36
constexpr Momentum2 GetLinearReaction(const DistanceJointConf &object) noexcept
Gets the current linear reaction for the given configuration.
Definition: DistanceJointConf.hpp:163
ArrayList< T, S > operator+(ArrayList< T, S > lhs, const typename ArrayList< T, S >::data_type &rhs)
ArrayList add operator.
Definition: ArrayList.hpp:205
Length2 GetLocalCenter() const noexcept
Gets the local center of mass position.
Definition: Sweep.hpp:69
NonNegative< Frequency > m_angularDamping
Angular damping. 4-bytes.
Definition: Body.hpp:505
AngularVelocity motorSpeed
The desired angular motor speed.
Definition: WheelJointConf.hpp:121
BodyID GetBody(const FixtureConf &conf) noexcept
Gets the body of the given configuration.
Definition: FixtureConf.hpp:119
void UnsetAwakeFlag() noexcept
Unsets the body's awake flag.
Definition: Body.hpp:586
constexpr std::size_t GetNumValidIndices(IndexPair3 pairs) noexcept
Gets the number of valid indices in the given collection of index pairs.
Definition: IndexPair.hpp:60
void pop() noexcept
Pops the "top" element.
Definition: GrowableStack.hpp:104
Velocity m_velocity
Velocity data of body.
Definition: BodyConstraint.hpp:88
Bodies m_bodies
Body collection.
Definition: WorldImpl.hpp:857
Length2 GetScaledDelta(const Simplex &simplex, Simplex::size_type index)
Gets the scaled delta for the given indexed element of the given simplex.
Definition: Simplex.hpp:201
PLAYRHO_QUANTITY(boost::units::si::moment_of_inertia) RotInertia
Rotational inertia quantity.
Definition: Units.hpp:274
constexpr Interval & Move(const value_type &v) noexcept
Moves the interval by the given amount.
Definition: Interval.hpp:121
std::remove_const< decltype(MaxFixtures)>::type FixtureCounter
Counter type for fixtures.
Definition: Settings.hpp:208
An indexable, hashable, named "strong type" template class.
Definition: IndexingNamedType.hpp:40
NonNegative< Length > GetVertexRadius_(ChildCounter idx) const override
Gets the vertex radius.
Definition: Shape.hpp:449
counter_type sumVelIters
Sum of the velocity iterations.
Definition: StepStats.hpp:61
ContactListener m_endContactListener
Listener for ending contact events.
Definition: WorldImpl.hpp:874
ProcessContactsOutput ProcessContactsForTOI(BodyID id, Island &island, Real toi, const StepConf &conf)
Processes the contacts of a given body for TOI handling.
Definition: WorldImpl.cpp:1626
const_pointer const_iterator
Constant iterator alias.
Definition: AllocatedArray.hpp:66
Positive constrained value checker.
Definition: Positive.hpp:30
NonNegative< Area > GetAreaOfCircle(Length radius)
Gets the area of a circle.
Definition: Math.cpp:113
Angle maxAngularCorrection
Maximum angular correction.
Definition: ConstraintSolverConf.hpp:98
Real constant
Constant applied with the ratio.
Definition: GearJointConf.hpp:102
constexpr CountType capacity() const noexcept
Gets the capacity in number of elements.
Definition: GrowableStack.hpp:117
bool IsEqual_(const Concept &other) const noexcept override
Equality checking method.
Definition: Shape.hpp:474
void SetSensor(FixtureConf &conf, bool value) noexcept
Sets whether or not the given configuration is a sensor.
Definition: FixtureConf.hpp:161
void ApplyForceToCenter(World &world, BodyID id, Force2 force)
Applies a force to the center of mass of the given body.
Definition: WorldBody.hpp:696
Model(const T &arg) noexcept(std::is_nothrow_copy_constructible_v< T >)
Initializing constructor.
Definition: Joint.hpp:380
const void * GetData_() const noexcept override
Gets the data for the underlying configuration.
Definition: Joint.hpp:403
~AllocatedArray() noexcept
Destructor.
Definition: AllocatedArray.hpp:76
std::invalid_argument exception_type
Exception type possibly thrown by this checker.
Definition: Positive.hpp:32
constexpr Vector< Length, N > GetLowerBound(const AABB< N > &aabb) noexcept
Gets the lower bound.
Definition: AABB.hpp:357
constexpr auto operator*(const CheckedValue< LhsValueType, LhsCheckerType > &lhs, const CheckedValue< RhsValueType, RhsCheckerType > &rhs) -> decltype(LhsValueType(lhs) *RhsValueType(rhs))
Constrained value multiplication operator.
Definition: CheckedValue.hpp:227
InvMass m_invMass
Inverse mass of the body.
Definition: Body.hpp:497
constexpr auto SetRatio(GearJointConf &object, Real value) noexcept
Free function for setting the ratio value of the given configuration.
Definition: GearJointConf.hpp:212
constexpr Vector< Length, N > GetDimensions(const AABB< N > &aabb) noexcept
Gets dimensions of the given AABB.
Definition: AABB.hpp:227
WorldImpl & operator=(const WorldImpl &other)=default
Assignment operator.
BodyID m_bodyA
Identifier for body-A.
Definition: PositionConstraint.hpp:65
2-D acceleration related data structure.
Definition: Acceleration.hpp:33
Real GetRatio(const Joint &object)
Gets the given joint's ratio property if it has one.
Definition: Joint.cpp:377
SizedRange< std::vector< BodyID >::const_iterator > GetBodies(const World &world) noexcept
Gets the bodies of the specified world.
Definition: WorldBody.cpp:47
bool fixedRotation
Should this body be prevented from rotating? Useful for characters.
Definition: BodyConf.hpp:154
constexpr Transformation GetTransformation(const Length2 ctr, const UnitVec rot, const Length2 localCtr) noexcept
Gets the transformation for the given values.
Definition: Math.hpp:875
bool operator==(const DistanceProxy &lhs, const DistanceProxy &rhs) noexcept
Determines with the two given distance proxies are equal.
Definition: DistanceProxy.cpp:28
Vector3< Real > Vec3
A 3-dimensional column vector with 3 elements.
Definition: Vector3.hpp:38
constexpr d2::AABB GetInvalid() noexcept
Gets an invalid AABB value.
Definition: AABB.hpp:484
bool allowSleep
Set this flag to false if this body should never fall asleep. Note that this increases CPU usage.
Definition: BodyConf.hpp:148
constexpr reference UseBodyB(BodyID b) noexcept
Use value for body B setting.
Definition: JointConf.hpp:87
static constexpr playrho::Fixed32 epsilon() noexcept
Gets the epsilon value for the type.
Definition: FixedLimits.hpp:60
constexpr size_type size() const noexcept
Gets the size.
Definition: UnitVec.hpp:164
Angle GetReferenceAngle(const Joint &object)
Gets the reference angle of the joint if it has one.
Definition: Joint.cpp:215
VertexCounterArray< N > secondShape
Second shape vertex indices.
Definition: IndexPair.hpp:112
pointer begin() const noexcept
Gets the "begin" iterator value.
Definition: Span.hpp:80
Real dampingRatio
Damping ratio.
Definition: WeldJointConf.hpp:99
ToiConf GetToiConf(const StepConf &conf) noexcept
Gets the time of impact configuration for the given step configuration.
Definition: TimeOfImpact.cpp:53
ContactCounter GetContactCount(const World &world) noexcept
Gets the count of contacts in the given world.
Definition: WorldContact.hpp:287
constexpr auto Centi
Centi- (1 x 10^-2).
Definition: RealConstants.hpp:73
auto GetVertex(VertexCounter index) const noexcept
Gets a vertex by index.
Definition: DistanceProxy.hpp:164
static const element_type * get_pointer(const U &u)
Gets pointer.
Definition: propagate_const.hpp:88
constexpr BodyID GetBody1() const noexcept
Gets body 1.
Definition: JointKey.hpp:51
constexpr UnitVec Absolute() const noexcept
Gets the absolute value.
Definition: UnitVec.hpp:287
bool operator()(const ::playrho::propagate_const< T > &pc1, const ::playrho::propagate_const< T > &pc2) const
Greater-than operation functor.
Definition: propagate_const.hpp:471
static element_type * get_pointer(U *u)
Gets pointer.
Definition: propagate_const.hpp:70
constexpr auto GetX() const noexcept
Gets the "X" value.
Definition: UnitVec.hpp:233
Length2 localAnchorA
The local anchor point relative to body A's origin.
Definition: RopeJointConf.hpp:79
static bool UpdateBody(Body &body, const Position &pos)
Updates the given body.
Definition: WorldImpl.cpp:1497
MotorJointConf GetMotorJointConf(const Joint &joint) noexcept
Gets the definition data for the given joint.
Definition: MotorJointConf.cpp:67
WorldManifold()=default
Default constructor.
std::reverse_iterator< iterator > reverse_iterator
Reverse iterator type.
Definition: Vector.hpp:78
InvMass GetInvMass(const Body &body) noexcept
Gets the inverse total mass of the body.
Definition: Body.hpp:967
constexpr auto operator()(const T &v) -> decltype(!(v > static_cast< T >(0)), T
Value checking functor.
Definition: Positive.hpp:36
friend bool operator==(const ChainShapeConf &lhs, const ChainShapeConf &rhs) noexcept
Equality operator.
Definition: ChainShapeConf.hpp:110
RevoluteJointConf GetRevoluteJointConf(const Joint &joint)
Gets the definition data for the given joint.
Definition: RevoluteJointConf.cpp:102
Momentum tangentImpulse
Tangent impulse.
Definition: Manifold.hpp:155
bool IsSpeedable(BodyType type)
Is "speedable".
Definition: BodyType.hpp:62
auto NeedsUpdating(const Contact &contact) noexcept
Whether or not the contact needs updating.
Definition: Contact.hpp:686
deleter_type m_deleter
Deleter. 8-bytes (with default Deleter).
Definition: AllocatedArray.hpp:214
void SetEndContactListener(ContactListener listener) noexcept
Register an end contact event listener.
Definition: WorldImpl.hpp:1019
PLAYRHO_QUANTITY(playrho::units::si::inverse_mass) InvMass
Inverse mass quantity.
Definition: Units.hpp:191
counter_type contactsUpdatedTouching
Contacts updated touching count.
Definition: StepStats.hpp:82
constexpr void SetOther(Size other) noexcept
Sets the node's "other" index to the given value.
Definition: DynamicTree.hpp:459
Real value_type
Value type.
Definition: Vector.hpp:51
constexpr friend bool operator!=(const IndexingNamedType &lhs, const IndexingNamedType &rhs)
Inequality operator.
Definition: IndexingNamedType.hpp:97
AngularVelocity motorSpeed
Desired motor speed.
Definition: RevoluteJointConf.hpp:149
void ApplyAngularImpulse(Body &body, AngularMomentum impulse) noexcept
Applies an angular impulse.
Definition: Body.cpp:252
T t_
Underlying data.
Definition: propagate_const.hpp:231
Torque GetMotorTorque(const Joint &joint, Frequency inv_dt)
Gets the current motor torque for the given joint given the inverse time step.
Definition: Joint.hpp:791
Length aabbExtension
AABB extension.
Definition: StepConf.hpp:206
bool IsSleepingAllowed() const noexcept
Gets whether or not this body allowed to sleep.
Definition: Body.hpp:634
static constexpr size_type GetChunkArrayIncrement() noexcept
Chunk array increment.
Definition: BlockAllocator.hpp:56
constexpr auto & UseTarget(Length2 v) noexcept
Use value for target.
Definition: TargetJointConf.hpp:62
VertexCounter GetVertexCount() const noexcept
Gets the vertex count.
Definition: PolygonShapeConf.hpp:127
friend PROPAGATE_CONST_CONSTEXPR bool operator<(const U &u, const propagate_const &pu)
Less-than operator.
Definition: propagate_const.hpp:364
std::enable_if_t< IsArithmetic< T >::value, std::pair< UnitVec, T > > PolarCoord
Polar coordinate.
Definition: UnitVec.hpp:122
void SetNormalImpulses(VelocityConstraint &vc, const Momentum2 impulses)
Sets the normal impulses of the given velocity constraint.
Definition: VelocityConstraint.hpp:461
The per-contact velocity constraint data structure.
Definition: VelocityConstraint.hpp:45
static Manifold GetForFaceB(UnitVec ln, Length2 lp, const Point &mp1, const Point &mp2) noexcept
Gets a face B typed manifold.
Definition: Manifold.hpp:233
Finite constrained value checker.
Definition: Finite.hpp:34
ContactImpulsesList GetContactImpulses(const VelocityConstraint &vc)
Gets the contact impulses for the given velocity constraint.
Definition: ContactImpulsesList.cpp:28
void Reserve(Island &island, BodyCounter bodies, ContactCounter contacts, JointCounter joints)
Reserves space ahead of time.
Definition: Island.cpp:138
std::pair< Length2, Length2 > PairLength2
Pair of Length2 values.
Definition: Distance.hpp:31
constexpr IndexingNamedType() noexcept(std::is_nothrow_default_constructible< underlying_type >::value)
Default constructor.
Definition: IndexingNamedType.hpp:47
void DestroyLeaf(Size index) noexcept
Destroys a leaf node.
Definition: DynamicTree.cpp:558
Real ratio
The pulley ratio, used to simulate a block-and-tackle.
Definition: PulleyJointConf.hpp:106
constexpr auto & UseRatio(Real v) noexcept
Uses the given ratio value.
Definition: GearJointConf.hpp:66
Flag guard type.
Definition: FlagGuard.hpp:31
std::size_t size_type
Size type.
Definition: Vector.hpp:54
void UnsetMassDataDirty() noexcept
Unsets the body from being in the mass data dirty state.
Definition: Body.hpp:666
constexpr ContactFeature GetFaceVertexContactFeature(ContactFeature::Index a, ContactFeature::Index b) noexcept
Gets the face vertex contact feature for the given indices.
Definition: ContactFeature.hpp:76
Angle maxRotation
Maximum rotation.
Definition: StepConf.hpp:177
ContactCounter GetContactRange(const World &world) noexcept
Gets the extent of the currently valid contact range.
Definition: WorldContact.cpp:34
typename detect_element_type< std::unique_ptr< playrho::d2::WorldImpl > >::type element_type
Element type alias.
Definition: propagate_const.hpp:65
Revnum revision
Revision version number.
Definition: Version.hpp:59
Mass GetNormalMassAtPoint(const VelocityConstraint &vc, VelocityConstraint::size_type index)
Gets the normal mass at the given point from the given velocity constraint.
Definition: VelocityConstraint.hpp:409
Vector< Length, N > center
Position of the shape's centroid relative to the shape's origin.
Definition: MassData.hpp:43
Chunk * m_chunks
Chunks array.
Definition: BlockAllocator.hpp:113
Range< ConstVertexIterator > GetVertices() const noexcept
Gets the range of vertices.
Definition: DistanceProxy.hpp:134
void InitVelocity_(BodyConstraintsMap &bodies, const playrho::StepConf &step, const ConstraintSolverConf &conf) override
Initializes the velocities for this joint.
Definition: Joint.hpp:451
auto NeedsFiltering(const Contact &contact) noexcept
Whether or not the contact needs filtering.
Definition: Contact.hpp:679
AngularAcceleration GetAngularAcceleration() const noexcept
Gets this body's angular acceleration.
Definition: Body.hpp:656
friend void Transform(Shape &shape, const Mat22 &m)
Transforms all of the given shape's vertices by the given transformation matrix.
Definition: Shape.hpp:309
void RebuildBottomUp()
Builds an optimal tree.
Definition: DynamicTree.cpp:608
bool IsUnderActive(Velocity velocity, LinearVelocity linSleepTol, AngularVelocity angSleepTol) noexcept
Gets whether the given velocity is "under active" based on the given tolerances.
Definition: Math.hpp:928
Length2 location
The world location of the body. Avoid creating bodies at the origin since this can lead to many overl...
Definition: BodyConf.hpp:112
PointArray m_points
Points of contact (at least 40-bytes).
Definition: Manifold.hpp:454
std::vector< FixtureID > Fixtures
Container type for fixture identifiers.
Definition: World.hpp:144
constexpr Length2 GetDelta(PairLength2 arg) noexcept
Gets the delta to go from the first element to the second.
Definition: Distance.hpp:44
Point GetPoint(Momentum normalImpulse, Momentum tangentImpulse, Length2 relA, Length2 relB, const std::vector< BodyConstraint > &bodies, Conf conf) const noexcept
Gets a point instance for the given parameters.
Definition: VelocityConstraint.cpp:130
ContactCounter GetProxy(const WorldImpl &world, FixtureID id, ChildCounter child)
Gets the specified proxy of the identified fixture.
Definition: WorldImplFixture.cpp:59
ArrayAllocator< Manifold > m_manifoldBuffer
Array of manifold data both used and freed.
Definition: WorldImpl.hpp:848
Fixed< BT, FB > fmod(Fixed< BT, FB > dividend, Fixed< BT, FB > divisor) noexcept
Computes the remainder of the division of the given dividend by the given divisor.
Definition: FixedMath.hpp:367
constexpr bool operator==(ContactFeature lhs, ContactFeature rhs) noexcept
Determines if the given two contact features are equal.
Definition: ContactFeature.hpp:99
Flag
Flag enumeration.
Definition: Body.hpp:79
constexpr auto & UseAngularOffset(Angle v) noexcept
Uses the given angular offset value.
Definition: MotorJointConf.hpp:67
NonNegative< Length > vertexRadius
Vertex radius.
Definition: DiskShapeConf.hpp:102
virtual bool ShiftOrigin_(Length2 value) noexcept=0
Call to notify joint of a shift in the world origin.
MassData GetMassData() const noexcept
Gets the mass data.
Definition: ChainShapeConf.cpp:101
constexpr UnusedData AsUnused() const noexcept
Gets the node as an "unused" value.
Definition: DynamicTree.hpp:482
constexpr T NextPowerOfTwo(T x)
Gets the next largest power of 2.
Definition: Math.hpp:617
TOIOutput()=default
Default constructor.
double type
Wider type.
Definition: Wider.hpp:71
Length2 rA
Relative A.
Definition: FrictionJointConf.hpp:93
static Manifold GetForFaceB(UnitVec nb, CfIndex ib, Length2 pb) noexcept
Gets the face B manifold for the given data.
Definition: Manifold.hpp:252
AllocatedArray(AllocatedArray &&other) noexcept
Move constructor.
Definition: AllocatedArray.hpp:86
PositionSolverManifold GetPSM(const Manifold &manifold, Manifold::size_type index, const Transformation &xfA, const Transformation &xfB)
Gets the normal-point-separation data in world coordinates for the given inputs.
Definition: PositionSolverManifold.cpp:87
Length2 GetPointRelPosB(const VelocityConstraint &vc, VelocityConstraint::size_type index)
Gets the point relative position B data.
Definition: VelocityConstraint.hpp:396
BodyType
Type of body.
Definition: BodyType.hpp:30
RotInertia angularMass
Effective mass for motor/limit angular constraint.
Definition: RevoluteJointConf.hpp:157
ChainShapeConf & Set(std::vector< Length2 > arg)
Sets the configuration up for representing a chain of vertices as given.
Definition: ChainShapeConf.cpp:62
void Free(void *mem)
Frees memory.
Definition: DynamicMemory.cpp:54
A joint-like constraint on one or more bodies.
Definition: Joint.hpp:144
UnitVec axis
Axis.
Definition: PrismaticJointConf.hpp:155
BodyID bodyB
2nd attached body.
Definition: JointConf.hpp:39
Real maxCirclesRatio
Max. circles ratio.
Definition: Manifold.hpp:474
Length maxLength
The maximum length of the rope.
Definition: RopeJointConf.hpp:85
Mat33 mass
Mass.
Definition: WeldJointConf.hpp:109
Momentum GetLinearMotorImpulse(const Joint &object)
Definition: Joint.cpp:664
constexpr UnitVec FlipXY() const noexcept
Flips the X and Y values.
Definition: UnitVec.hpp:239
Fixed< BT, FB > atan2(Fixed< BT, FB > y, Fixed< BT, FB > x)
Computes the multi-valued inverse tangent.
Definition: FixedMath.hpp:473
@ e_locked
Locked.
Definition: WorldImpl.hpp:528
constexpr BodyConf & UseLinearDamping(NonNegative< Frequency > v) noexcept
Use the given linear damping.
Definition: BodyConf.hpp:222
Length2 rA
Relative A.
Definition: RopeJointConf.hpp:92
Template for determining if the given type is an "arithmetic" type.
Definition: Templates.hpp:215
constexpr MotorJointConf()=default
Default constructor.
static constexpr UnitVec GetZero() noexcept
Gets the non-oriented unit vector.
Definition: UnitVec.hpp:95
std::shared_ptr< const Concept > m_self
Self pointer.
Definition: Shape.hpp:509
void SetFixtureDestructionListener(WorldImpl &world, std::function< void(FixtureID)> listener) noexcept
Registers a destruction listener for fixtures.
Definition: WorldImplMisc.cpp:51
constexpr auto InvalidVertex
Invalid vertex index.
Definition: Settings.hpp:125
Positive< Length > m_minVertexRadius
Minimum vertex radius.
Definition: WorldImpl.hpp:887
Shape.
Definition: Shape.hpp:183
Function object for performing lexicographical less-than or equal-to comparisons of containers.
Definition: Templates.hpp:314
Fixed< std::int32_t, 9 > Fixed32
32-bit fixed precision type.
Definition: Fixed.hpp:710
DynamicTree::Height GetHeight(const DynamicTree &tree) noexcept
Gets the height of the binary tree.
Definition: DynamicTree.hpp:680
Length length
Natural length between the anchor points.
Definition: DistanceJointConf.hpp:99
constexpr Fixed(short val) noexcept
Initializing constructor.
Definition: Fixed.hpp:212
std::function< void(ContactID, const ContactImpulsesList &, unsigned)> ImpulsesContactListener
Impulses contact listener.
Definition: World.hpp:160
std::remove_const< decltype(MaxManifoldPoints)>::type size_type
Size type.
Definition: VelocityConstraint.hpp:48
LinearVelocity2 GetLinearVelocity(const Body &body) noexcept
Gets the linear velocity of the center of mass.
Definition: Body.hpp:1168
constexpr auto GetConstant(const GearJointConf &object) noexcept
Free function for getting the constant value of the given configuration.
Definition: GearJointConf.hpp:219
bool GetSubStepping() const noexcept
Gets whether or not sub-stepping is enabled.
Definition: World.cpp:91
static constexpr auto InvalidIteration
Invalid iteration value.
Definition: StepConf.hpp:49
static constexpr value_type GetFromFloat(T val) noexcept
Gets the value from a floating point value.
Definition: Fixed.hpp:115
constexpr T Bisect(T a1, T a2) noexcept
Bisection method.
Definition: Math.hpp:145
AABB GetAABB(Size index) const noexcept
Gets the AABB for a leaf or branch (a non-unused node).
Definition: DynamicTree.hpp:593
constexpr auto & GetY(T &value)
Gets the "Y" element of the given value - i.e. the second element.
Definition: Math.hpp:73
constexpr Fixed< BT, FB > atan(Fixed< BT, FB > arg)
Computes the arctangent of the given argument via Maclaurin series approximation.
Definition: FixedMath.hpp:275
size_type nelem
Number of elements.
Definition: BlockAllocator.hpp:148
Vector3< Mass > Mass3
3-element vector of Mass quantities.
Definition: Vector3.hpp:41
value_type * pointer
Pointer type.
Definition: AllocatedArray.hpp:51
void AddProxies(const Proxies &proxies)
Adds the given dynamic tree leaves to the queue for finding new contacts.
Definition: WorldImpl.hpp:905
Span< const Length2 > GetVertices() const noexcept
Gets the span of vertices.
Definition: PolygonShapeConf.hpp:154
constexpr auto operator()(const T &v) -> decltype(!(v< static_cast< T >(0)), T
Value checking functor.
Definition: Negative.hpp:36
pointer data() const noexcept
Gets a direct pointer to this array's memory.
Definition: AllocatedArray.hpp:115
bool IsLocked() const noexcept
Is the world locked (in the middle of a time step).
Definition: WorldImpl.hpp:935
BodyCounter GetBodyRange() const noexcept
Gets the extent of the currently valid body range.
Definition: World.cpp:131
A holder for contact filtering data.
Definition: Filter.hpp:33
std::remove_const< decltype(MaxJoints)>::type JointCounter
Counter type for joints.
Definition: Settings.hpp:239
Real GetDefaultRestitution(const FixtureConf &fixtureA, const FixtureConf &fixtureB)
Gets the default restitution amount for the given fixtures.
Definition: FixtureConf.cpp:46
constexpr auto operator/(const CheckedValue< LhsValueType, LhsCheckerType > &lhs, const CheckedValue< RhsValueType, RhsCheckerType > &rhs) -> decltype(LhsValueType(lhs)/RhsValueType(rhs))
Constrained value division operator.
Definition: CheckedValue.hpp:241
constexpr void SetDampingRatio(DistanceJointConf &object, Real value) noexcept
Free function for setting the damping ratio value of the given configuration.
Definition: DistanceJointConf.hpp:212
ArrayAllocator< BodyJoints > m_bodyJoints
Cache of joints associated with bodies.
Definition: WorldImpl.hpp:835
ChainShapeConf & Transform(const Mat22 &m) noexcept
Transforms all the vertices by the given transformation matrix.
Definition: ChainShapeConf.cpp:75
UnitVec GetNormal() const noexcept
Gets the normal of the contact in world coordinates.
Definition: VelocityConstraint.hpp:88
constexpr Interval & Include(const Interval &v) noexcept
Includes the given interval into this interval.
Definition: Interval.hpp:158
constexpr auto Kilo
Kilo- (1 x 10^3).
Definition: RealConstants.hpp:81
PLAYRHO_QUANTITY(boost::units::si::acceleration) LinearAcceleration
Linear acceleration quantity.
Definition: Units.hpp:176
constexpr auto operator<=(const CheckedValue< LhsValueType, LhsCheckerType > &lhs, const CheckedValue< RhsValueType, RhsCheckerType > &rhs) -> decltype(LhsValueType(lhs)<=RhsValueType(rhs))
Constrained value less-than or equal-to operator.
Definition: CheckedValue.hpp:171
const Proxies & GetProxies() const noexcept
Gets the dynamic tree leaves queued for finding new contacts.
Definition: WorldImpl.hpp:900
const Length2 * ConstVertexPointer
Constant vertex pointer.
Definition: DistanceProxy.hpp:55
size_type m_pointCount
Point count (at least 1-byte).
Definition: VelocityConstraint.hpp:292
PROPAGATE_CONST_CONSTEXPR propagate_const(propagate_const &&p)=default
Move constructor.
PLAYRHO_QUANTITY(boost::units::si::plane_angle) Angle
Angle quantity.
Definition: Units.hpp:215
constexpr Length2 InverseTransform(const Length2 v, const Transformation xfm) noexcept
Inverse transforms the given 2-D vector with the given transformation.
Definition: Math.hpp:852
Vector2< Length > Length2
2-element vector of Length quantities.
Definition: Vector2.hpp:43
UnitVec localXAxisA
The local X translation axis in body-A.
Definition: WheelJointConf.hpp:109
constexpr bool operator()(const T &lhs, const T &rhs) const
Checks whether the first argument is lexicographically greater-than the second argument.
Definition: Templates.hpp:299
Length2 GetGroundAnchorA(const Joint &object)
Definition: Joint.cpp:646
Filter filter
Contact filtering data.
Definition: FixtureConf.hpp:90
constexpr auto Radian
Radian unit of angle.
Definition: Units.hpp:369
void ShiftOrigin(Length2 newOrigin)
Shifts the world origin.
Definition: WorldImpl.cpp:1771
static Manifold GetForFaceA(UnitVec na, CfIndex ia, Length2 pa, CfType tb0, CfIndex ib0, Length2 pb0, CfType tb1, CfIndex ib1, Length2 pb1) noexcept
Gets the face A manifold for the given data.
Definition: Manifold.hpp:281
Length JwD
D Jw data.
Definition: GearJointConf.hpp:112
static Manifold GetForFaceA(UnitVec na, CfIndex ia, Length2 pa, CfType tb0, CfIndex ib0, Length2 pb0) noexcept
Gets the face A manifold for the given data.
Definition: Manifold.hpp:261
BodyCounter GetWorldIndex(const World &world, BodyID id) noexcept
Gets the world index for the given body.
Definition: WorldBody.cpp:202
constexpr bool empty() const noexcept
Whether this range is empty.
Definition: Range.hpp:63
Wider data type obtainer.
Definition: Wider.hpp:37
friend PROPAGATE_CONST_CONSTEXPR bool operator>=(const propagate_const &pt, const U &u)
Greater-than or equal-to operator.
Definition: propagate_const.hpp:343
Momentum motorImpulse
Motor impulse.
Definition: PrismaticJointConf.hpp:132
void Clear()
Clears this allocator.
Definition: BlockAllocator.cpp:223
constexpr auto GetLinearError(const MotorJointConf &object) noexcept
Free function for getting the linear error value of the given configuration.
Definition: MotorJointConf.hpp:227
constexpr WorldConf & UseInitialTreeSize(ContactCounter value) noexcept
Uses the given value as the initial dynamic tree size.
Definition: WorldConf.hpp:78
const_pointer begin() const
Gets the "begin" iterator value.
Definition: VertexSet.hpp:85
bool has_value() const noexcept
Checks whether this instance contains a value.
Definition: Shape.hpp:263
Trait class for checking if type is a Vector type.
Definition: Vector.hpp:227
PLAYRHO_QUANTITY(boost::units::si::area) Area
Area quantity.
Definition: Units.hpp:200
UnitVec GetLocalYAxisA(const Joint &object)
Gets the given joint's local Y axis A if its type supports that.
Definition: Joint.cpp:242
std::size_t FindLowestRightMostVertex(Span< const Length2 > vertices)
Finds the lowest right most vertex in the given collection.
Definition: DistanceProxy.cpp:41
Length2 rA
Rotated delta of body A's local center from local anchor A.
Definition: RevoluteJointConf.hpp:154
bool SolveVelocity_(BodyConstraintsMap &bodies, const playrho::StepConf &step) override
Solves the velocities for this joint.
Definition: Joint.hpp:458
SizedRange< WorldImpl::Contacts::const_iterator > GetContacts(BodyID id) const
Gets the contacts associated with the identified body.
Definition: WorldImpl.cpp:2302
std::int16_t index_type
Index type definition.
Definition: Filter.hpp:40
std::remove_const< decltype(DefaultMaxDistanceIters)>::type iteration_type
Iteration type.
Definition: Distance.hpp:54
TOI-phase per-step statistics.
Definition: StepStats.hpp:67
std::enable_if_t< std::is_pointer< T >::value, CheckedValue< T, NonZeroChecker< T > >> NonNull
Non-null constrained value type.
Definition: NonZero.hpp:55
StepStats Step(const StepConf &conf=StepConf{})
Steps the world simulation according to the given configuration.
Definition: World.cpp:81
std::function< void(ContactID)> ContactListener
Listener type for some contact related events.
Definition: World.hpp:153
constexpr auto operator()(const T &v) -> decltype(isfinite(v), T
Value checking functor.
Definition: Finite.hpp:47
ArrayAllocator< Joint > m_jointBuffer
Array of joint data both used and freed.
Definition: WorldImpl.hpp:846
counter_type destroyed
Count of contacts destroyed.
Definition: StepStats.hpp:35
void SetMaxMotorTorque(Joint &object, Torque value)
Sets the given joint's max motor torque if its type supports that.
Definition: Joint.cpp:363
void SetSleepingAllowed(Body &body, bool value) noexcept
You can disable sleeping on this body. If you disable sleeping, the body will be woken.
Definition: Body.hpp:763
constexpr bool empty() const noexcept
Whether this stack is empty.
Definition: GrowableStack.hpp:123
PLAYRHO_QUANTITY(boost::units::si::surface_density) AreaDensity
Area (surface) density quantity.
Definition: Units.hpp:209
constexpr Interval(const Interval &other)=default
Copy constructor.
FixtureID CreateFixture(const FixtureConf &def=FixtureConf{})
Creates a fixture with the given parameters.
Definition: WorldImpl.cpp:2230
void SetAccelerations(World &world, Acceleration acceleration) noexcept
Sets the accelerations of all the world's bodies to the given value.
Definition: WorldBody.cpp:558
Defaults object for real types.
Definition: Settings.hpp:48
UnitVec GetNormal() const noexcept
Gets the normal of the contact.
Definition: WorldManifold.hpp:123
constexpr auto & UseLinearOffset(Length2 v) noexcept
Uses the given linear offset value.
Definition: MotorJointConf.hpp:60
@ e_fixedRotationFlag
Fixed rotation flag.
Definition: Body.hpp:92
constexpr value_type get() const noexcept
Gets the underlying value.
Definition: CheckedValue.hpp:90
void AddToIsland(Island &island, BodyID seed, BodyCounter &remNumBodies, ContactCounter &remNumContacts, JointCounter &remNumJoints)
Adds to the island based off of a given "seed" body.
Definition: WorldImpl.cpp:818
BodyCounter bodiesSlept
Bodies slept.
Definition: IslandStats.hpp:34
bool IsImpenetrable() const noexcept
Is this body treated like a bullet for continuous collision detection?
Definition: Body.hpp:564
std::function< void(JointID)> JointListener
Joint listener.
Definition: WorldImpl.hpp:102
bits_type maskBits
The collision mask bits.
Definition: Filter.hpp:52
DistanceJointConf(const DistanceJointConf ©)=default
Copy constructor.
typename std::vector< value_type >::size_type size_type
Size type.
Definition: ArrayAllocator.hpp:40
void Transform_(const Mat22 &m) override
Transforms all of the shape's vertices by the given transformation matrix.
Definition: Shape.hpp:469
std::vector< BodyID > Bodies
Bodies container type.
Definition: WorldImpl.hpp:77
size_type blockSize
Block size.
Definition: BlockAllocator.cpp:100
iteration_type maxDistanceIters
Max distance iterations.
Definition: StepConf.hpp:256
T m_value
Value.
Definition: FlagGuard.hpp:68
void SetBody(World &world, BodyID id, const Body &body)
Sets the body state for the identified body.
Definition: WorldBody.cpp:68
Friction joint definition.
Definition: FrictionJointConf.hpp:49
constexpr auto Pi
Pi.
Definition: RealConstants.hpp:54
Size GetNodeCount() const noexcept
Gets the current count of allocated nodes.
Definition: DynamicTree.hpp:567
static Manifold GetForFaceA(UnitVec na, CfIndex ia, Length2 pa) noexcept
Gets the face A manifold for the given data.
Definition: Manifold.hpp:243
NonNegative< Frequency > frequency
Suspension frequency, zero indicates no suspension.
Definition: WheelJointConf.hpp:124
std::function< Real(BodyID body, FixtureID fixture, ChildCounter child, const RayCastInput &input)> DynamicTreeRayCastCB
Ray cast callback function.
Definition: RayCastOutput.hpp:97
Configuration data for manifold calculation.
Definition: Manifold.hpp:459
void SetContact(ContactID id, const Contact &value)
Sets the identified contact's state.
Definition: World.cpp:251
No-op value checker.
Definition: CheckedValue.hpp:39
StepStats Step(const StepConf &conf)
Steps the world simulation according to the given configuration.
Definition: WorldImpl.cpp:1709
Length minSeparation
Minimum separation.
Definition: IslandStats.hpp:32
DynamicTree::Height ComputeHeight(const DynamicTree &tree, DynamicTree::Size index) noexcept
Computes the height of the tree from a given node.
Definition: DynamicTree.cpp:773
Manifold(const Manifold ©)=default
Copy constructor.
static constexpr Fixed GetNegativeInfinity() noexcept
Gets the negative infinity value for this type.
Definition: Fixed.hpp:99
NonNegative< Mass > mass
Mass of the shape in kilograms.
Definition: MassData.hpp:46
const value_type const_value_type
Constant value type.
Definition: AllocatedArray.hpp:42
Length s1
Location S-1.
Definition: PrismaticJointConf.hpp:157
SizedRange< Bodies::const_iterator > GetBodies() const noexcept
Gets the world body range for this constant world.
Definition: WorldImpl.hpp:910
constexpr reference at(size_type pos)
Gets a reference to the requested element.
Definition: Vector.hpp:174
Length2 localAnchorB
The local anchor point relative to body B's origin.
Definition: PrismaticJointConf.hpp:119
Length sBy
Solver B y location.
Definition: WheelJointConf.hpp:139
Mass normalMass
Normal mass.
Definition: VelocityConstraint.hpp:203
friend void swap(IndexingNamedType &a, IndexingNamedType &b) noexcept
Swap function.
Definition: IndexingNamedType.hpp:84
VariantData m_variant
Variant data for the node.
Definition: DynamicTree.hpp:536
constexpr ContactFeature Flip(ContactFeature val) noexcept
Flips contact features information.
Definition: ContactFeature.hpp:92
Trait class for checking if type is a square matrix type.
Definition: Matrix.hpp:81
counter_type proxiesMoved
Proxies moved count.
Definition: StepStats.hpp:34
ContactKeyQueue m_proxyKeys
Proxy keys.
Definition: WorldImpl.hpp:852
bool IsSpeedable(const Body &body) noexcept
Is "speedable".
Definition: Body.hpp:708
void SetSubStepping(bool flag) noexcept
Enables/disables single stepped continuous physics.
Definition: World.cpp:96
Wider< dist_iter_type >::type dist_sum_type
Distance iterations sum type.
Definition: TimeOfImpact.hpp:174
const UnitVec * m_normals
Normals.
Definition: DistanceProxy.hpp:185
JointCounter GetJointRange() const noexcept
Gets the extent of the currently valid joint range.
Definition: WorldImpl.cpp:624
Real tMax
T-Max.
Definition: TimeOfImpact.hpp:81
void SetLinearDamping(Body &body, NonNegative< Frequency > value) noexcept
Sets the linear damping of the body.
Definition: Body.hpp:995
Bodies bodies
Container of body identifiers.
Definition: Island.hpp:50
const Body & GetBody(BodyID id) const
Gets the state of the identified body.
Definition: World.cpp:166
AngularAcceleration angularAcceleration
Initial angular acceleration of the body.
Definition: BodyConf.hpp:129
Length lowerTranslation
The lower translation limit.
Definition: PrismaticJointConf.hpp:138
Length targetDepth
Target depth.
Definition: StepConf.hpp:124
const DynamicTree & GetTree(const WorldImpl &world) noexcept
Gets access to the broad-phase dynamic tree information.
Definition: WorldImplMisc.cpp:152
BodyConstraint GetBodyConstraint(const Body &body, Time time, MovementConf conf) noexcept
Gets the BodyConstraint based on the given parameters.
Definition: BodyConstraint.hpp:137
Mass GetNormalMassAtPoint(size_type index) const noexcept
Gets the normal mass at the given point.
Definition: VelocityConstraint.hpp:333
Span< const UnitVec > GetNormals() const noexcept
Gets the span of normals.
Definition: PolygonShapeConf.hpp:160
constexpr iterator_type end() const noexcept
Gets the "end" index value.
Definition: Range.hpp:57
constexpr VariantData(BranchData value) noexcept
Initializing constructor.
Definition: DynamicTree.hpp:381
constexpr auto & UseEnableMotor(bool v) noexcept
Uses the given enable motor state value.
Definition: RevoluteJointConf.hpp:97
bool operator()(const ::playrho::propagate_const< T > &pc1, const ::playrho::propagate_const< T > &pc2) const
Greater-than operation functor.
Definition: propagate_const.hpp:499
@ e_massDataDirtyFlag
Mass Data Dirty Flag.
Definition: Body.hpp:108
std::vector< JointID > Joints
Container type for joint identifiers.
Definition: Island.hpp:48
constexpr Acceleration operator*(const Acceleration &lhs, const Real rhs)
Multiplication operator.
Definition: Acceleration.hpp:118
Angle referenceAngle
Reference angle.
Definition: RevoluteJointConf.hpp:134
Length JwB
B Jw data.
Definition: GearJointConf.hpp:110
std::ptrdiff_t difference_type
Difference type.
Definition: Vector.hpp:57
DistanceProxy GetDistanceProxy() const
Gets the distance proxy for this convex hull.
Definition: MultiShapeConf.hpp:45
Momentum2 linearImpulse
Linear impulse.
Definition: MotorJointConf.hpp:100
Size m_leafCount
Leaf count.
Definition: DynamicTree.hpp:294
BodyID FindClosestBody(const World &world, Length2 location) noexcept
Finds body in given world that's closest to the given location.
Definition: WorldBody.cpp:574
Stack allocator configuration data.
Definition: StackAllocator.hpp:43
constexpr Vector(std::enable_if_t< sizeof...(Tail)+1==N, T > head, Tail... tail) noexcept
Initializing constructor.
Definition: Vector.hpp:90
DistanceProxy GetChild_(ChildCounter index) const override
Gets the "child" specified by the given index.
Definition: Shape.hpp:439
NonNegative< Frequency > linearDamping
Linear damping is use to reduce the linear velocity. The damping parameter can be larger than 1 but t...
Definition: BodyConf.hpp:134
Length m_totalRadius
Total "Radius" distance of the associated shapes of fixture A and fixture B.
Definition: PositionConstraint.hpp:71
Size m_nodeCapacity
Node capacity.
Definition: DynamicTree.hpp:297
void UnsetAwake() noexcept
Sets this body to asleep if sleeping is allowed.
Definition: Body.cpp:155
void AddFixture(BodyID id, FixtureID fixture)
Adds the given fixture to the given body.
Definition: WorldImpl.cpp:2326
Torque GetTorque(const Body &body) noexcept
Gets the net torque that the given body is currently experiencing.
Definition: Body.hpp:1285
AngularVelocity angularSleepTolerance
Angular sleep tolerance.
Definition: StepConf.hpp:195
Momentum normalImpulse
Normal impulse.
Definition: Manifold.hpp:149
static constexpr UnitVec GetBottom() noexcept
Gets the bottom-ward oriented unit vector.
Definition: UnitVec.hpp:92
constexpr auto & UseCorrectionFactor(Real v) noexcept
Uses the given correction factor.
Definition: MotorJointConf.hpp:88
reverse_iterator rbegin() noexcept
Gets a reverse "begin" iterator.
Definition: Vector.hpp:125
friend PROPAGATE_CONST_CONSTEXPR bool operator<(const propagate_const &pt, const U &u)
Less-than operator.
Definition: propagate_const.hpp:322
constexpr bool operator()(const playrho::d2::JointKey &lhs, const playrho::d2::JointKey &rhs) const
Function object operator.
Definition: JointKey.hpp:114
bool awake
Is the body awake or sleeping?
Definition: BodyConf.hpp:151
void SetJointDestructionListener(WorldImpl &world, std::function< void(JointID)> listener) noexcept
Registers a destruction listener for joints.
Definition: WorldImplMisc.cpp:57
bool IsAccelerable(const Body &body) noexcept
Is "accelerable".
Definition: Body.hpp:718
BodyCounter islandsSolved
Islands solved count.
Definition: StepStats.hpp:56
static constexpr Fixed GetLowest() noexcept
Gets the lowest value this type is capable of expressing.
Definition: Fixed.hpp:106
root_sum_type sum_root_iters
Sum total of root finder iterations.
Definition: TimeOfImpact.hpp:182
A dynamic AABB tree broad-phase.
Definition: DynamicTree.hpp:72
@ e_enabledFlag
Enabled flag.
Definition: Body.hpp:95
FlagsType m_flags
Flags. 2-bytes.
Definition: Body.hpp:475
Length2 rB
Relative B.
Definition: FrictionJointConf.hpp:94
SeparationInfo GetMaxSeparation(const DistanceProxy &proxy1, Transformation xf1, const DistanceProxy &proxy2, Transformation xf2)
Gets the max separation information.
Definition: ShapeSeparation.cpp:111
CountType m_count
Count of elements.
Definition: GrowableStack.hpp:131
ConvexHull & Transform(const Mat22 &m) noexcept
Transforms all the vertices by the given transformation matrix.
Definition: MultiShapeConf.cpp:80
friend TypeID GetType(const Shape &shape) noexcept
Gets the type info of the use of the given shape.
Definition: Shape.hpp:329
BodyID bodyC
Identifier of body C.
Definition: GearJointConf.hpp:73
std::unique_ptr< Concept > m_self
Self pointer.
Definition: Joint.hpp:473
dist_iter_type max_dist_iters
Max. distance iterations count.
Definition: TimeOfImpact.hpp:186
Manifold manifold
Copy of contact's manifold with 1 or more contact points (64-bytes).
Definition: PositionConstraint.hpp:44
constexpr auto Invert(const Matrix22< IN_TYPE > value) noexcept
Inverts the given value.
Definition: Math.hpp:470
constexpr Length GetPerimeter(const AABB &aabb) noexcept
Gets the perimeter length of the 2-dimensional AABB.
Definition: AABB.hpp:424
constexpr auto DefaultMaxVertexRadius
Default maximum vertex radius.
Definition: Settings.hpp:140
StepStats Step(WorldImpl &world, const StepConf &conf)
Steps the given world the specified amount.
Definition: WorldImplMisc.cpp:85
BodyID m_body2
Identifier of body 2.
Definition: JointKey.hpp:75
InvRotInertia GetInvRotInertia() const noexcept
Gets the inverse rotational inertia of the body.
Definition: Body.hpp:539
friend bool SolvePosition(const Joint &object, std::vector< BodyConstraint > &bodies, const ConstraintSolverConf &conf)
Solves the position constraint.
Definition: Joint.hpp:316
Length GetLinearLowerLimit(const Joint &object)
Gets the lower linear joint limit.
Definition: Joint.cpp:478
static constexpr JointKey Get(BodyID bodyA, BodyID bodyB) noexcept
Gets the JointKey for the given bodies.
Definition: JointKey.hpp:45
Angle GetAngle(const Vector2< T > value)
Gets the angle.
Definition: Math.hpp:304
size_type m_allocation
Allocation.
Definition: StackAllocator.hpp:151
void UnsetNewFixtures() noexcept
Unsets the new fixtures state.
Definition: WorldImpl.hpp:979
Momentum maxIncImpulse
Max incremental impulse.
Definition: StepStats.hpp:53
T ElementType
Element type.
Definition: GrowableStack.hpp:39
Length maxLinearCorrection
Maximum linear correction.
Definition: StepConf.hpp:183
Definition of a "world" implementation.
Definition: WorldImpl.hpp:74
counter_type ignored
Count of contacts ignored during update processing.
Definition: StepStats.hpp:37
std::function< bool(FixtureID fixture, ChildCounter child)> QueryFixtureCallback
Query AABB for fixtures callback function type.
Definition: DynamicTree.hpp:760
void SetTarget(Joint &object, Length2 value)
Sets the given joint's target property if it has one.
Definition: Joint.cpp:468
NonNegative< Real > friction
Friction coefficient.
Definition: ShapeConf.hpp:44
Convex hull.
Definition: MultiShapeConf.hpp:37
counter_type contactsAdded
Contacts added count.
Definition: StepStats.hpp:84
detail::IndexingNamedType< JointCounter, struct JointIdentifier > JointID
Joint identifier.
Definition: JointID.hpp:30
TypeID type2
Type of the second joint.
Definition: GearJointConf.hpp:82
std::int32_t Revnum
Revision number type.
Definition: Version.hpp:39
bool IsLooped(const ChainShapeConf &shape) noexcept
Determines whether the given shape is looped.
Definition: ChainShapeConf.hpp:169
const Length2 localPoint
Local point.
Definition: SeparationScenario.hpp:58
bool IsImpenetrable(const Body &body) noexcept
Is this body treated like a bullet for continuous collision detection?
Definition: Body.hpp:726
const Sweep & GetSweep(const Body &body) noexcept
Gets the body's sweep.
Definition: Body.hpp:879
bool collideConnected
Collide connected.
Definition: JointConf.hpp:43
constexpr auto DefaultAabbExtension
Default AABB extension amount.
Definition: Settings.hpp:143
Length Evaluate(const SeparationScenario &scenario, const Transformation &xfA, const Transformation &xfB, IndexPair indexPair)
Evaluates the separation of the identified proxy vertices at the given time factor.
Definition: SeparationScenario.cpp:182
static constexpr Size GetInvalidSize() noexcept
Gets the invalid size value.
Definition: DynamicTree.hpp:84
const_reverse_iterator crend() const noexcept
Gets a reverse "end" iterator.
Definition: Vector.hpp:137
Body(const BodyConf &bd=GetDefaultBodyConf()) noexcept
Initializing constructor.
Definition: Body.cpp:92
void EnableLimit(Joint &object, bool value)
Enables the specified joint's limit property if it supports one.
Definition: Joint.cpp:546
const_iterator end() const noexcept
Gets an "end" iterator.
Definition: Vector.hpp:116
index_type groupIndex
Group index.
Definition: Filter.hpp:60
DynamicTree::Size ProxyId
Proxy ID type alias.
Definition: WorldImpl.hpp:93
constexpr pointer data() noexcept
Direct access to data.
Definition: Vector.hpp:195
constexpr auto KilogramPerSquareMeter
Kilogram per square meter unit of area density.
Definition: Units.hpp:363
LinearVelocity velocityThreshold
Velocity threshold.
Definition: StepConf.hpp:138
static auto Size(T &v)
Internal helper template function to avoid confusion for use within classes that define their own siz...
Definition: Templates.hpp:89
constexpr IndexingNamedType(underlying_type &&value) noexcept(std::is_nothrow_move_constructible< underlying_type >::value)
Move initializing constructor.
Definition: IndexingNamedType.hpp:55
Template range value class.
Definition: Range.hpp:32
virtual DistanceProxy GetChild_(ChildCounter index) const =0
Gets the "child" specified by the given index.
Real ratio
The gear ratio.
Definition: GearJointConf.hpp:98
void clear() noexcept
Clear this set.
Definition: VertexSet.hpp:70
Length2 localAnchorB
The local anchor point relative to body B's origin.
Definition: WeldJointConf.hpp:87
constexpr auto InvalidTypeID
Invalid type ID value.
Definition: TypeInfo.hpp:94
counter_type proxiesMoved
Proxies moved count.
Definition: StepStats.hpp:59
Velocity GetVelocity(const Body &body, Time h) noexcept
Gets the velocity of the body after the given time accounting for the body's acceleration and capped ...
Definition: Body.cpp:221
ChildCounter GetVertexCount() const noexcept
Gets the vertex count.
Definition: ChainShapeConf.hpp:90
Force2 GetForce(const Body &body) noexcept
Gets the net force that the given body is currently experiencing.
Definition: Body.hpp:1278
VertexCounterArray< N > indices
Array of vertex indices.
Definition: IndexPair.hpp:103
Momentum GetMaxNormalImpulse(const ContactImpulsesList &impulses) noexcept
Gets the maximum normal impulse from the given contact impulses list.
Definition: ContactImpulsesList.hpp:70
constexpr bool IsFor(const JointKey key, BodyID body) noexcept
Determines whether the given key is for the given body.
Definition: JointKey.hpp:101
PointState state2[MaxManifoldPoints]
State 2.
Definition: Collision.hpp:55
static constexpr Conf GetDefaultConf() noexcept
Gets the default configuration for a VelocityConstraint.
Definition: VelocityConstraint.hpp:59
PointState
Point state enumeration.
Definition: Collision.hpp:39
const value_type * const_pointer
Constant pointer type.
Definition: UnitVec.hpp:62
Length distance
Distance.
Definition: IndexPair.hpp:110
LimitState
Limit state.
Definition: LimitState.hpp:31
UnitInterval< Real > fraction
Fraction.
Definition: RayCastOutput.hpp:84
Length GetLinearLowerLimit(const Joint &object)
Gets the lower linear joint limit.
Definition: Joint.cpp:478
LimitState limitState
Limit state.
Definition: RopeJointConf.hpp:95
void SetAngularLimits(Joint &object, Angle lower, Angle upper)
Sets the joint limits.
Definition: Joint.cpp:524
Length GetMaxVertexRadius() const noexcept
Gets the maximum vertex radius that shapes in this world can be.
Definition: WorldImpl.hpp:989
value_type m_value
Underlying value.
Definition: CheckedValue.hpp:118
constexpr Vec2 GetVec2(const UnitVec value)
Gets a Vec2 representation of the given value.
Definition: Math.hpp:712
void JustSetVelocity(Velocity value) noexcept
Sets the body's velocity.
Definition: Body.hpp:179
Length2 m_localPoint
Local point.
Definition: Manifold.hpp:452
DynamicTree m_tree
Dynamic tree.
Definition: WorldImpl.hpp:850
Angle GetAngularUpperLimit(const Joint &object)
Gets the upper joint limit.
Definition: Joint.cpp:515
void Query(const DynamicTree &tree, const AABB &aabb, const DynamicTreeSizeCB &callback)
Query the given dynamic tree and find nodes overlapping the given AABB.
Definition: DynamicTree.cpp:704
constexpr bool operator()(const playrho::d2::JointKey &lhs, const playrho::d2::JointKey &rhs) const
Function object operator.
Definition: JointKey.hpp:125
friend bool GetCollideConnected(const Joint &object) noexcept
Gets collide connected.
Definition: Joint.hpp:293
constexpr TargetJointConf()=default
Default constructor.
Momentum2 GetTangentImpulses(const VelocityConstraint &vc)
Gets the tangent impulses of the given velocity constraint.
Definition: VelocityConstraint.hpp:443
constexpr auto operator()(const T &v) -> decltype(!(v !=static_cast< T >(0)), T
Value checking functor.
Definition: NonZero.hpp:36
AngularMomentum angularImpulse
Angular impulse.
Definition: MotorJointConf.hpp:101
pointer m_data
Pointer to allocated data space. 8-bytes.
Definition: AllocatedArray.hpp:213
constexpr Acceleration & operator-=(Acceleration &lhs, const Acceleration &rhs)
Subtraction assignment operator.
Definition: Acceleration.hpp:88
size_type GetPointCount() const noexcept
Gets the point count.
Definition: WorldManifold.hpp:115
Size m_nodeCount
Node count.
Definition: DynamicTree.hpp:293
constexpr AllocatedArray(size_type max_size, pointer data, deleter_type deleter=noop_deleter)
Initializing constructor.
Definition: AllocatedArray.hpp:69
Motor joint definition.
Definition: MotorJointConf.hpp:49
SeparationInfo GetMaxSeparation4x4(const DistanceProxy &proxy1, Transformation xf1, const DistanceProxy &proxy2, Transformation xf2)
Gets the max separation information for the first four vertices of the two given shapes.
Definition: ShapeSeparation.cpp:69
constexpr CmpResult Compare(const Fixed other) const noexcept
Compares this value to the given one.
Definition: Fixed.hpp:245
Length2 GetEdge(const PolygonShapeConf &shape, VertexCounter index)
Gets the identified edge of the given polygon shape.
Definition: PolygonShapeConf.cpp:157
void SetPosition0(const Position value) noexcept
Sets the "position 0" value of the body to the given position.
Definition: Body.hpp:397
GearJointConf GetGearJointConf(const Joint &joint) noexcept
Gets the definition data for the given joint.
Definition: GearJointConf.cpp:74
ImpulsesContactListener m_postSolveContactListener
Listener for post-solving contacts.
Definition: WorldImpl.hpp:876
auto GetMaxEntries() const noexcept
Gets the max entries.
Definition: StackAllocator.hpp:130
constexpr UnitVec GetFwdPerpendicular() const noexcept
Gets a vector clockwise (forward-clockwise) perpendicular to this vector.
Definition: UnitVec.hpp:274
constexpr auto Second
Second unit of time.
Definition: Units.hpp:320
UnitVec GetTangent(const VelocityConstraint &vc) noexcept
Gets the tangent from the given velocity constraint data.
Definition: VelocityConstraint.hpp:383
Internal model configuration concept.
Definition: Shape.hpp:422
FixtureConf & UseIsSensor(bool value) noexcept
Uses the given sensor state value.
Definition: FixtureConf.hpp:73
toi_iter_type maxToiIters
Max time of impact iterations.
Definition: TimeOfImpact.hpp:104
std::pair< ContactKey, ContactID > KeyedContactPtr
Keyed contact pointer.
Definition: KeyedContactID.hpp:34
Length JwA
A Jw data.
Definition: GearJointConf.hpp:109
constexpr auto InvalidContactID
Invalid contact ID value.
Definition: ContactID.hpp:33
LinearAcceleration2 GetLinearAcceleration(const Body &body) noexcept
Gets this body's linear acceleration.
Definition: Body.hpp:1040
std::reverse_iterator< const_iterator > const_reverse_iterator
Constant reverse iterator type.
Definition: Vector.hpp:81
PrismaticJointConf GetPrismaticJointConf(const Joint &joint)
Gets the definition data for the given joint.
Definition: PrismaticJointConf.cpp:126
FrictionJointConf GetFrictionJointConf(const Joint &joint) noexcept
Gets the definition data for the given joint.
Definition: FrictionJointConf.cpp:64
constexpr ContactFeature GetFaceFaceContactFeature(ContactFeature::Index a, ContactFeature::Index b) noexcept
Gets the face face contact feature for the given indices.
Definition: ContactFeature.hpp:84
size_type m_entryCount
Entry count.
Definition: StackAllocator.hpp:153
constexpr auto Tera
Tera- (1 x 10^12).
Definition: RealConstants.hpp:93
Revolute joint definition.
Definition: RevoluteJointConf.hpp:64
Time underActiveTime
Under-active time.
Definition: BodyConf.hpp:144
const_iterator begin() const noexcept
Gets a "begin" iterator.
Definition: UnitVec.hpp:171
Mass mass
Mass. 4-bytes (with 4-byte Real).
Definition: DistanceJointConf.hpp:122
FixtureID GetFixtureA(const Contact &contact) noexcept
Gets the fixture A associated with the given contact.
Definition: Contact.hpp:595
Length2 location
Location of point or the invalid value.
Definition: WorldManifold.hpp:67
Transformation GetTransform0(const Sweep &sweep) noexcept
Gets the transform at "time" zero.
Definition: Math.hpp:906
constexpr void SetMaxForce(FrictionJointConf &object, NonNegative< Force > value) noexcept
Free function for setting the max force value of the given configuration.
Definition: FrictionJointConf.hpp:184
const char * GetName(ContactFeature::Type type) noexcept
Gets the human readable name for the given contact feature type.
Definition: ContactFeature.hpp:113
constexpr Length2 GetLocalPoint() const noexcept
Gets the local point.
Definition: Manifold.hpp:406
PLAYRHO_QUANTITY(boost::units::si::velocity) LinearVelocity
Linear velocity quantity.
Definition: Units.hpp:167
@ e_awakeFlag
Awake flag.
Definition: Body.hpp:81
ChildCounter GetChildCount_() const noexcept override
Gets the "child" count.
Definition: Shape.hpp:434
void SetFixedRotation(bool flag)
Sets this body to have fixed rotation.
Definition: Body.cpp:208
Length2 m_vertices[2]
Vertices.
Definition: EdgeShapeConf.hpp:103
PulleyJointConf() noexcept
Default constructor.
Definition: PulleyJointConf.hpp:72
std::uint64_t type
Wider type.
Definition: Wider.hpp:66
std::size_t size_type
Size type.
Definition: Range.hpp:79
constexpr auto DefaultMaxAngularCorrection
Default maximum angular correction.
Definition: Settings.hpp:162
Joint(T &&arg)
Initializing constructor.
Definition: Joint.hpp:215
DistanceProxy(const DistanceProxy ©) noexcept
Copy constructor.
Definition: DistanceProxy.hpp:69
size_type m_chunkCount
Chunk count.
Definition: BlockAllocator.hpp:111
UnitVec u
"u" directional. 8-bytes (with 4-byte Real).
Definition: DistanceJointConf.hpp:117
const_iterator end() const
Gets the "end" iterator value for this array.
Definition: AllocatedArray.hpp:153
void ClearForces(World &world) noexcept
Clears forces.
Definition: WorldBody.hpp:826
ChildCounter GetChildCount(const ChainShapeConf &arg) noexcept
Gets the child count for a given chain shape configuration.
Definition: ChainShapeConf.hpp:151
void * Alloc(std::size_t size)
Allocates memory.
Definition: DynamicMemory.cpp:29
Size GetOther(Size index) const noexcept
Gets the "other" index for the node at the given index.
Definition: DynamicTree.hpp:586
constexpr auto GetMaxLength(const RopeJointConf &object) noexcept
Free function for getting the maximum length value of the given configuration.
Definition: RopeJointConf.hpp:165
void Advance(Real value) noexcept
Advances the body by a given time ratio.
Definition: Body.hpp:449
Scalar type.
Definition: Fixed.hpp:561
Angle GetNormalized(Angle value) noexcept
Gets the "normalized" value of the given angle.
Definition: Math.hpp:275
constexpr SizedRange() noexcept=default
Default constructor.
void SetAngularDamping(Body &body, NonNegative< Frequency > value) noexcept
Sets the angular damping of the body.
Definition: Body.hpp:1011
T * AllocateArray(size_type n)
Allocates an array.
Definition: BlockAllocator.hpp:88
std::vector< std::pair< BodyID, JointID > > BodyJoints
Container type for body associated joint identifiers.
Definition: World.hpp:141
constexpr auto operator()() noexcept -> decltype(static_cast< T >(0))
Valid value supplying functor.
Definition: NonNegative.hpp:35
Length2 localAnchorA
The local anchor point relative to body A's origin.
Definition: PrismaticJointConf.hpp:116
virtual const void * GetData_() const noexcept=0
Gets the data for the underlying configuration.
void SetSubStepping(WorldImpl &world, bool value) noexcept
Enables/disables single stepped continuous physics.
Definition: WorldImplMisc.cpp:132
JointID CreateJoint(const Joint &def)
Creates a joint to constrain one or more bodies.
Definition: World.cpp:221
const_reference at(size_type pos) const
Bounds checking indexed array accessor.
Definition: ArrayAllocator.hpp:147
std::vector< VelocityConstraint > VelocityConstraints
Collection of velocity constraints.
Definition: WorldImpl.cpp:104
DistanceProxy GetChild() const noexcept
Gets the "child" shape.
Definition: EdgeShapeConf.hpp:84
std::remove_const< decltype(DefaultMaxDistanceIters)>::type dist_iter_type
Distance iteration type.
Definition: TimeOfImpact.hpp:60
size_type m_chunkSpace
Chunk space.
Definition: BlockAllocator.hpp:112
bool IsEqual_(const Concept &other) const noexcept override
Equality checking method.
Definition: Joint.hpp:418
The "multi-shape" shape configuration.
Definition: MultiShapeConf.hpp:112
TreeNode * m_nodes
Nodes.
Definition: DynamicTree.hpp:298
@ e_unset
Unset type.
Definition: Manifold.hpp:86
@ e_nextAfter
Next after.
Definition: TimeOfImpact.hpp:230
bool operator>=(const AABB< N > &lhs, const AABB< N > &rhs) noexcept
Greater-than or equal-to operator.
Definition: AABB.hpp:174
constexpr auto & UseMotorSpeed(AngularVelocity v) noexcept
Uses the given motor speed value.
Definition: WheelJointConf.hpp:82
RotInertia angularMass
Motor mass.
Definition: WheelJointConf.hpp:142
@ e_inactiveLimit
Inactive limit.
NonNegative< Length > tolerance
Tolerance.
Definition: StepConf.hpp:132
FixtureID CreateFixture(const FixtureConf &def=FixtureConf{})
Creates a fixture and attaches it to the identified body.
Definition: World.cpp:196
constexpr bool isnan() const noexcept
Is NaN.
Definition: Fixed.hpp:540
void ApplyTorque(World &world, BodyID id, Torque torque)
Applies a torque.
Definition: WorldBody.cpp:514
constexpr auto Transform_identity
Identity transformation value.
Definition: Transformation.hpp:50
PLAYRHO_QUANTITY(boost::units::si::angular_velocity) AngularVelocity
Angular velocity quantity.
Definition: Units.hpp:225
size_type size
Size.
Definition: StackAllocator.hpp:141
Mass GetTangentMassAtPoint(size_type index) const noexcept
Gets the tangent mass at the given point.
Definition: VelocityConstraint.hpp:338
Angle referenceAngle
The constrained angle between the bodies: body B's angle minus body A's angle.
Definition: PrismaticJointConf.hpp:128
constexpr BodyConf & UseAngle(Angle a) noexcept
Use the given angle.
Definition: BodyConf.hpp:178
Length2 rB
Relative B.
Definition: TargetJointConf.hpp:128
FixtureListener m_fixtureDestructionListener
Listener for fixture destruction.
Definition: WorldImpl.hpp:871
constexpr Acceleration & operator*=(Acceleration &lhs, const Real rhs)
Multiplication assignment operator.
Definition: Acceleration.hpp:54
AngularVelocity GetMotorSpeed(const Joint &object)
Gets the given joint's motor speed if its type supports that.
Definition: Joint.cpp:254
const_reference back() const noexcept
Gets a reference to the "back" element of this array.
Definition: AllocatedArray.hpp:180
const Body & GetBody(BodyID id) const
Gets the identified body.
Definition: WorldImpl.cpp:2636
Length minSeparation
Min separation.
Definition: StepStats.hpp:50
virtual std::unique_ptr< Concept > Clone_() const =0
Clones this concept and returns a pointer to a mutable copy.
constexpr auto SquareRootTwo
Square root of two.
Definition: RealConstants.hpp:60
Mat33 mass
Effective mass for point-to-point constraint.
Definition: RevoluteJointConf.hpp:156
constexpr auto & UseDampingRatio(Real v) noexcept
Uses the given damping ratio value.
Definition: WheelJointConf.hpp:96
TimestepIters velocityIterations
Velocity iterations actually performed.
Definition: IslandStats.hpp:39
RegStepStats SolveReg(const StepConf &conf)
Solves the step.
Definition: WorldImpl.cpp:951
Pulley joint definition.
Definition: PulleyJointConf.hpp:55
Vector2< Force > Force2
2-element vector of Force quantities.
Definition: Vector2.hpp:55
bool solved
Solved. true if position constraints solved, false otherwise.
Definition: IslandStats.hpp:37
Disk shape configuration.
Definition: DiskShapeConf.hpp:42
Output data for time of impact.
Definition: TimeOfImpact.hpp:157
void SetTransformation(Body &body, Transformation value) noexcept
Sets the body's transformation.
Definition: Body.hpp:854