playrho::d2 Namespace Reference

Classes

struct  Acceleration
 2-D acceleration related data structure. More...
 
struct  BaseShapeConf
 Base configuration for initializing shapes. More...
 
class  Body
 Physical entity that exists within a World. More...
 
class  BodyAtty
 Body attorney. More...
 
struct  BodyConf
 Body configuration. More...
 
class  BodyConstraint
 Body Constraint. More...
 
class  ChainShapeConf
 Chain shape configuration. More...
 
struct  ClipVertex
 Clip vertex. More...
 
class  ConstJointVisitor
 Constant joint visitor interface class. More...
 
class  Contact
 A potential contact between the children of two Fixture objects. More...
 
class  ContactAtty
 Contact attorney. More...
 
class  ContactImpulsesList
 
class  ContactListener
 A pure-virtual interface for "listeners" for contacts. More...
 
class  ConvexHull
 Convex hull. More...
 
class  DestructionListener
 
struct  DiskShapeConf
 Disk shape configuration. More...
 
struct  DistanceConf
 Distance Configuration. More...
 
class  DistanceJoint
 Distance Joint. More...
 
struct  DistanceJointConf
 Distance joint definition. More...
 
struct  DistanceOutput
 Distance Output. More...
 
class  DistanceProxy
 Distance Proxy. More...
 
class  DynamicTree
 A dynamic AABB tree broad-phase. More...
 
class  EdgeShapeConf
 Edge shape configuration. More...
 
class  Fixture
 An association between a body and a shape. More...
 
class  FixtureAtty
 Fixture attorney. More...
 
struct  FixtureConf
 Fixture definition. More...
 
class  FrictionJoint
 Friction joint. More...
 
struct  FrictionJointConf
 Friction joint definition. More...
 
class  FunctionalJointVisitor
 Functional joint visitor class. More...
 
class  GearJoint
 Gear joint. More...
 
struct  GearJointConf
 Gear joint definition. More...
 
struct  Island
 Definition of a self-contained constraint "island". More...
 
class  Joint
 Base joint class. More...
 
class  JointAtty
 Joint attorney. More...
 
struct  JointBuilder
 Joint builder definition structure. More...
 
struct  JointConf
 Abstract base Joint definition class. More...
 
class  JointKey
 Joint key. More...
 
class  JointVisitor
 Visitor interface for Joint instances. More...
 
class  Manifold
 A collision response oriented description of the intersection of two convex shapes. More...
 
class  MotorJoint
 Motor joint. More...
 
struct  MotorJointConf
 Motor joint definition. More...
 
struct  MultiShapeConf
 The "multi-shape" shape configuration. More...
 
class  PolygonShapeConf
 Polygon shape configuration. More...
 
struct  Position
 2-D positional data structure. More...
 
class  PositionConstraint
 
struct  PositionSolution
 Solution for position constraint. More...
 
struct  PositionSolverManifold
 
class  PrismaticJoint
 Prismatic Joint. More...
 
struct  PrismaticJointConf
 Prismatic joint definition. More...
 
class  PulleyJoint
 Pulley joint. More...
 
struct  PulleyJointConf
 Pulley joint definition. More...
 
struct  RayCastHit
 Ray-cast hit data. More...
 
class  RevoluteJoint
 Revolute Joint. More...
 
struct  RevoluteJointConf
 Revolute joint definition. More...
 
class  RopeJoint
 Rope joint. More...
 
struct  RopeJointConf
 Rope joint definition. More...
 
struct  SeparationScenario
 Separation scenario. More...
 
class  Shape
 Shape. More...
 
struct  ShapeBuilder
 Builder configuration structure. More...
 
struct  ShapeConf
 Shape configuration structure. More...
 
class  Simplex
 An encapsulation of a point, line segment, or triangle. More...
 
class  SimplexEdge
 Simplex edge. More...
 
class  Sweep
 Description of a "sweep" of motion in 2-D space. More...
 
class  TargetJoint
 Target Joint. More...
 
struct  TargetJointConf
 Target joint definition. More...
 
struct  Transformation
 Describes a geometric transformation. More...
 
class  TypeJointVisitor
 Typing JointVisitor. More...
 
class  UnitVec
 2-D unit vector. More...
 
struct  Velocity
 2-D velocity related data structure. More...
 
class  VelocityConstraint
 
class  VertexSet
 Vertex Set. More...
 
class  WeldJoint
 Weld joint. More...
 
struct  WeldJointConf
 Weld joint definition. More...
 
class  WheelJoint
 Wheel joint. More...
 
struct  WheelJointConf
 Wheel joint definition. More...
 
class  World
 Definition of an independent and simulatable "world". More...
 
class  WorldAtty
 World attorney. More...
 
struct  WorldConf
 World configuration data. More...
 
class  WorldManifold
 Essentially a Manifold expressed in world coordinate terms. More...
 

Typedefs

using AABB = detail::AABB< 2 >
 2-Dimensional Axis Aligned Bounding Box. More...
 
using ClipList = ArrayList< ClipVertex, MaxManifoldPoints >
 Clip list for ClipSegmentToLine. More...
 
using DynamicTreeSizeCB = std::function< DynamicTreeOpcode(DynamicTree::Size)>
 Query callback type. More...
 
using QueryFixtureCallback = std::function< bool(Fixture *fixture, ChildCounter child)>
 Query AABB for fixtures callback function type. More...
 
using LengthIndices = detail::LengthIndices< 2 >
 Length and vertex counter array of indices for 2-D space. More...
 
using SeparationInfo = detail::SeparationInfo< 2 >
 Separation information alias for 2-D space. More...
 
using MassData = detail::MassData< 2 >
 Mass data alias for 2-D objects. More...
 
using RayCastInput = playrho::detail::RayCastInput< 2 >
 Ray cast input data for 2-dimensions. More...
 
using RayCastOutput = Optional< RayCastHit >
 Ray cast output. More...
 
using DynamicTreeRayCastCB = std::function< Real(Fixture *fixture, ChildCounter child, const RayCastInput &input)>
 Ray cast callback function. More...
 
using FixtureRayCastCB = std::function< RayCastOpcode(Fixture *fixture, ChildCounter child, Length2 point, UnitVec normal)>
 Ray cast callback function signature. More...
 
using TypeInfoVisitor = std::function< void(const std::type_info &ti, const void *data)>
 Visitor type alias for underlying shape configuration. More...
 
using SimplexEdges = ArrayList< SimplexEdge, MaxSimplexEdges, std::remove_const< decltype(MaxSimplexEdges)>::type >
 Simplex edge collection. More...
 
using VelocityPair = std::pair< Velocity, Velocity >
 Velocity pair. More...
 
using ContactPtr = Contact *
 Contact pointer type. More...
 
using KeyedContactPtr = std::pair< ContactKey, Contact * >
 Keyed contact pointer. More...
 
using BodyConstraintPtr = BodyConstraint *
 A body constraint pointer alias. More...
 
using BodyConstraintPair = std::pair< const Body *, BodyConstraintPtr >
 A body pointer and body constraint pointer pair alias. More...
 
using BodyConstraintsMap = std::unordered_map< const Body *, BodyConstraint * >
 A body constraints map alias. More...
 
using BodyPtr = Body *
 Body pointer alias. More...
 
using BodyConstraintsPair = std::pair< const Body *const, BodyConstraint * >
 A body pointer and body constraint pointer pair. More...
 
using BodyConstraints = std::vector< BodyConstraint >
 Collection of body constraints. More...
 
using PositionConstraints = std::vector< PositionConstraint >
 Collection of position constraints. More...
 
using VelocityConstraints = std::vector< VelocityConstraint >
 Collection of velocity constraints. More...
 

Enumerations

enum  DynamicTreeOpcode { DynamicTreeOpcode::End, DynamicTreeOpcode::Continue }
 Opcodes for dynamic tree callbacks. More...
 
enum  JointType : std::uint8_t {
  JointType::Unknown, JointType::Revolute, JointType::Prismatic, JointType::Distance,
  JointType::Pulley, JointType::Target, JointType::Gear, JointType::Wheel,
  JointType::Weld, JointType::Friction, JointType::Rope, JointType::Motor
}
 Enumeration of joint types. More...
 

Functions

AABB ComputeAABB (const DistanceProxy &proxy, const Transformation &xf) noexcept
 Computes the AABB. More...
 
AABB ComputeAABB (const DistanceProxy &proxy, const Transformation &xfm0, const Transformation &xfm1) noexcept
 Computes the AABB. More...
 
AABB ComputeAABB (const Shape &shape, const Transformation &xf) noexcept
 Computes the AABB for the given shape with the given transformation. More...
 
AABB ComputeAABB (const Fixture &fixture) noexcept
 Computes the AABB for the given fixture. More...
 
AABB ComputeAABB (const Body &body)
 Computes the AABB for the given body. More...
 
AABB ComputeIntersectingAABB (const Fixture &fA, ChildCounter iA, const Fixture &fB, ChildCounter iB) noexcept
 Computes the intersecting AABB for the given pair of fixtures and indexes. More...
 
AABB ComputeIntersectingAABB (const Contact &contact)
 Computes the intersecting AABB for the given contact. More...
 
AABB GetAABB (const playrho::detail::RayCastInput< 2 > &input) noexcept
 Gets the AABB for the given ray cast input data. More...
 
PLAYRHO_CONSTEXPR Length GetPerimeter (const AABB &aabb) noexcept
 Gets the perimeter length of the 2-dimensional AABB. More...
 
PointStates GetPointStates (const Manifold &manifold1, const Manifold &manifold2) noexcept
 Computes the point states given two manifolds. More...
 
ClipList ClipSegmentToLine (const ClipList &vIn, const UnitVec &normal, Length offset, ContactFeature::Index indexA)
 
DistanceConf GetDistanceConf (const ToiConf &conf) noexcept
 Gets the distance configuration for the given time of impact configuration. More...
 
PairLength2 GetWitnessPoints (const Simplex &simplex) noexcept
 Gets the witness points of the given simplex. More...
 
DistanceOutput Distance (const DistanceProxy &proxyA, const Transformation &transformA, const DistanceProxy &proxyB, const Transformation &transformB, DistanceConf conf=DistanceConf{})
 Determines the closest points between two shapes. More...
 
Area TestOverlap (const DistanceProxy &proxyA, const Transformation &xfA, const DistanceProxy &proxyB, const Transformation &xfB, DistanceConf conf=DistanceConf{})
 Determine if two generic shapes overlap. More...
 
PLAYRHO_CONSTEXPR Length2 GetDelta (PairLength2 arg) noexcept
 Gets the delta to go from the first element to the second. More...
 
bool operator== (const DistanceProxy &lhs, const DistanceProxy &rhs) noexcept
 Determines with the two given distance proxies are equal. More...
 
std::size_t FindLowestRightMostVertex (Span< const Length2 > vertices)
 Finds the lowest right most vertex in the given collection. More...
 
std::vector< Length2GetConvexHullAsVector (Span< const Length2 > vertices)
 Gets the convex hull for the given collection of vertices as a vector. More...
 
bool TestPoint (const DistanceProxy &proxy, Length2 point) noexcept
 Tests a point for containment in the given distance proxy. More...
 
bool operator!= (const DistanceProxy &lhs, const DistanceProxy &rhs) noexcept
 Determines with the two given distance proxies are not equal. More...
 
NonNegative< LengthGetVertexRadius (const DistanceProxy &arg) noexcept
 Gets the vertex radius property of a given distance proxy. More...
 
template<class T >
VertexCounter GetSupportIndex (const DistanceProxy &proxy, T dir) noexcept
 Gets the supporting vertex index in the given direction for the given distance proxy. More...
 
void swap (DynamicTree &lhs, DynamicTree &rhs) noexcept
 
void Query (const DynamicTree &tree, const AABB &aabb, const DynamicTreeSizeCB &callback)
 Query the given dynamic tree and find nodes overlapping the given AABB. More...
 
void Query (const DynamicTree &tree, const AABB &aabb, QueryFixtureCallback callback)
 Queries the world for all fixtures that potentially overlap the provided AABB. More...
 
Length ComputeTotalPerimeter (const DynamicTree &tree) noexcept
 Gets the sum of the perimeters of nodes. More...
 
Real ComputePerimeterRatio (const DynamicTree &tree) noexcept
 Gets the ratio of the sum of the perimeters of nodes to the root perimeter. More...
 
DynamicTree::Height ComputeHeight (const DynamicTree &tree, DynamicTree::Size index) noexcept
 Computes the height of the tree from a given node. More...
 
DynamicTree::Height GetMaxImbalance (const DynamicTree &tree) noexcept
 Gets the maximum imbalance. More...
 
bool ValidateStructure (const DynamicTree &tree, DynamicTree::Size index) noexcept
 Validates the structure of the given tree from the given index. More...
 
bool ValidateMetrics (const DynamicTree &tree, DynamicTree::Size index) noexcept
 Validates the metrics of the given tree from the given index. More...
 
PLAYRHO_CONSTEXPR bool operator== (const DynamicTree::LeafData &lhs, const DynamicTree::LeafData &rhs) noexcept
 Equality operator. More...
 
PLAYRHO_CONSTEXPR bool operator!= (const DynamicTree::LeafData &lhs, const DynamicTree::LeafData &rhs) noexcept
 Inequality operator. More...
 
PLAYRHO_CONSTEXPR bool IsUnused (const DynamicTree::TreeNode &node) noexcept
 Is unused. More...
 
PLAYRHO_CONSTEXPR bool IsLeaf (const DynamicTree::TreeNode &node) noexcept
 Is leaf. More...
 
PLAYRHO_CONSTEXPR bool IsBranch (const DynamicTree::TreeNode &node) noexcept
 Is branch. More...
 
PLAYRHO_CONSTEXPR DynamicTree::BranchData ReplaceChild (DynamicTree::BranchData bd, DynamicTree::Size oldChild, DynamicTree::Size newChild)
 Replaces the old child with the new child. More...
 
PLAYRHO_CONSTEXPR AABB GetAABB (const DynamicTree::TreeNode &node) noexcept
 Gets the AABB of the given dynamic tree node. More...
 
PLAYRHO_CONSTEXPR DynamicTree::Size GetNext (const DynamicTree::TreeNode &node) noexcept
 Gets the next index of the given node. More...
 
DynamicTree::Height GetHeight (const DynamicTree &tree) noexcept
 Gets the height of the binary tree. More...
 
AABB GetAABB (const DynamicTree &tree) noexcept
 Gets the AABB for the given dynamic tree. More...
 
bool TestOverlap (const DynamicTree &tree, DynamicTree::Size leafIdA, DynamicTree::Size leafIdB) noexcept
 Tests for overlap of the elements identified in the given dynamic tree. More...
 
DynamicTree::Height ComputeHeight (const DynamicTree &tree) noexcept
 Computes the height of the given dynamic tree. More...
 
std::size_t size (const DynamicTree &tree) noexcept
 Gets the "size" of the given tree. More...
 
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. More...
 
Manifold GetManifold (bool flipped, Length totalRadius, const DistanceProxy &shape, const Transformation &sxf, Length2 point, const Transformation &xfm)
 Computes manifolds for face-to-point collision. More...
 
Manifold GetManifold (Length2 locationA, const Transformation &xfA, Length2 locationB, const Transformation &xfB, Length totalRadius) noexcept
 Gets a point-to-point based manifold. More...
 
Manifold CollideShapes (const DistanceProxy &shapeA, const Transformation &xfA, const DistanceProxy &shapeB, const Transformation &xfB, Manifold::Conf conf=GetDefaultManifoldConf())
 Calculates the relevant collision manifold. More...
 
const char * GetName (Manifold::Type type) noexcept
 Gets a unique name for the given manifold type. More...
 
bool operator== (const Manifold::Point &lhs, const Manifold::Point &rhs) noexcept
 Determines whether the two given manifold points are equal. More...
 
bool operator!= (const Manifold::Point &lhs, const Manifold::Point &rhs) noexcept
 Determines whether the two given manifold points are not equal. More...
 
bool operator== (const Manifold &lhs, const Manifold &rhs) noexcept
 Manifold equality operator. More...
 
bool operator!= (const Manifold &lhs, const Manifold &rhs) noexcept
 Manifold inequality operator. More...
 
PLAYRHO_CONSTEXPR Manifold::Conf GetDefaultManifoldConf () noexcept
 Gets the default manifold configuration. More...
 
MassData GetMassData (Length r, NonNegative< AreaDensity > density, Length2 location)
 Computes the mass data for a circular shape. More...
 
MassData GetMassData (Length r, NonNegative< AreaDensity > density, Length2 v0, Length2 v1)
 Computes the mass data for a linear shape. More...
 
MassData GetMassData (Length vertexRadius, NonNegative< AreaDensity > density, Span< const Length2 > vertices)
 Gets the mass data for the given collection of vertices with the given properties. More...
 
MassData GetMassData (const Fixture &f)
 Computes the mass data for the given fixture. More...
 
MassData ComputeMassData (const Body &body) noexcept
 Computes the body's mass data. More...
 
MassData GetMassData (const Body &body) noexcept
 Gets the mass data of the body. More...
 
RayCastOutput RayCast (Length radius, Length2 location, const RayCastInput &input) noexcept
 Cast a ray against a circle of a given radius at the given location. More...
 
RayCastOutput RayCast (const detail::AABB< 2 > &aabb, const RayCastInput &input) noexcept
 Cast a ray against the given AABB. More...
 
RayCastOutput RayCast (const DistanceProxy &proxy, const RayCastInput &input, const Transformation &transform) noexcept
 Cast a ray against the distance proxy. More...
 
RayCastOutput RayCast (const Shape &shape, ChildCounter childIndex, const RayCastInput &input, const Transformation &transform) noexcept
 Cast a ray against the child of the given shape. More...
 
bool RayCast (const DynamicTree &tree, RayCastInput input, const DynamicTreeRayCastCB &callback)
 Cast rays against the leafs in the given tree. More...
 
bool RayCast (const DynamicTree &tree, const RayCastInput &input, FixtureRayCastCB callback)
 Ray-cast the dynamic tree for all fixtures in the path of the ray. More...
 
SeparationScenario GetSeparationScenario (IndexPair3 indices, const DistanceProxy &proxyA, const Transformation &xfA, const DistanceProxy &proxyB, const Transformation &xfB)
 Gets a separation finder for the given inputs. More...
 
LengthIndexPair FindMinSeparation (const SeparationScenario &scenario, const Transformation &xfA, const Transformation &xfB)
 Finds the minimum separation. More...
 
Length Evaluate (const SeparationScenario &scenario, const Transformation &xfA, const Transformation &xfB, IndexPair indexPair)
 
ChainShapeConf GetChainShapeConf (Length2 dimensions)
 Gets an enclosing chain shape configuration for an axis aligned rectangle of the given dimensions (width and height). More...
 
ChainShapeConf GetChainShapeConf (const AABB &arg)
 Gets an enclosing chain shape configuration for the given axis aligned box. More...
 
ChildCounter GetChildCount (const ChainShapeConf &arg) noexcept
 Gets the child count for a given chain shape configuration. More...
 
DistanceProxy GetChild (const ChainShapeConf &arg, ChildCounter index)
 Gets the "child" shape for a given chain shape configuration. More...
 
MassData GetMassData (const ChainShapeConf &arg) noexcept
 Gets the mass data for a given chain shape configuration. More...
 
bool IsLooped (const ChainShapeConf &shape) noexcept
 Determines whether the given shape is looped. More...
 
ChildCounter GetNextIndex (const ChainShapeConf &shape, ChildCounter index) noexcept
 Gets the next index after the given index for the given shape. More...
 
NonNegative< LengthGetVertexRadius (const ChainShapeConf &arg)
 Gets the vertex radius of the given shape configuration. More...
 
NonNegative< LengthGetVertexRadius (const ChainShapeConf &arg, ChildCounter)
 Gets the vertex radius of the given shape configuration. More...
 
void Transform (ChainShapeConf &arg, const Mat22 &m) noexcept
 Transforms the given chain shape configuration's vertices by the given transformation matrix. More...
 
ChainShapeConf GetChainShapeConf (Length dimension)
 Gets an enclosing chain shape configuration for an axis aligned square of the given dimension. More...
 
bool operator== (const DiskShapeConf &lhs, const DiskShapeConf &rhs) noexcept
 Equality operator. More...
 
bool operator!= (const DiskShapeConf &lhs, const DiskShapeConf &rhs) noexcept
 Inequality operator. More...
 
PLAYRHO_CONSTEXPR ChildCounter GetChildCount (const DiskShapeConf &) noexcept
 Gets the "child" count of the given disk shape configuration. More...
 
DistanceProxy GetChild (const DiskShapeConf &arg, ChildCounter index)
 Gets the "child" of the given disk shape configuration. More...
 
PLAYRHO_CONSTEXPR NonNegative< LengthGetVertexRadius (const DiskShapeConf &arg) noexcept
 Gets the vertex radius of the given shape configuration. More...
 
PLAYRHO_CONSTEXPR NonNegative< LengthGetVertexRadius (const DiskShapeConf &arg, ChildCounter) noexcept
 Gets the vertex radius of the given shape configuration. More...
 
MassData GetMassData (const DiskShapeConf &arg) noexcept
 Gets the mass data of the given disk shape configuration. More...
 
void Transform (DiskShapeConf &arg, const Mat22 &m) noexcept
 Transforms the given shape configuration's vertices by the given transformation matrix. More...
 
bool operator== (const EdgeShapeConf &lhs, const EdgeShapeConf &rhs) noexcept
 Equality operator. More...
 
bool operator!= (const EdgeShapeConf &lhs, const EdgeShapeConf &rhs) noexcept
 Inequality operator. More...
 
PLAYRHO_CONSTEXPR ChildCounter GetChildCount (const EdgeShapeConf &) noexcept
 Gets the "child" count for the given shape configuration. More...
 
DistanceProxy GetChild (const EdgeShapeConf &arg, ChildCounter index)
 Gets the "child" shape for the given shape configuration. More...
 
NonNegative< LengthGetVertexRadius (const EdgeShapeConf &arg) noexcept
 Gets the vertex radius of the given shape configuration. More...
 
NonNegative< LengthGetVertexRadius (const EdgeShapeConf &arg, ChildCounter) noexcept
 Gets the vertex radius of the given shape configuration. More...
 
MassData GetMassData (const EdgeShapeConf &arg) noexcept
 Gets the mass data for the given shape configuration. More...
 
void Transform (EdgeShapeConf &arg, const Mat22 &m) noexcept
 Transforms the given shape configuration's vertices by the given transformation matrix. More...
 
MassData GetMassData (const MultiShapeConf &arg) noexcept
 Gets the mass data for the given shape configuration. More...
 
bool operator== (const MultiShapeConf &lhs, const MultiShapeConf &rhs) noexcept
 Equality operator. More...
 
bool operator!= (const MultiShapeConf &lhs, const MultiShapeConf &rhs) noexcept
 Inequality operator. More...
 
ChildCounter GetChildCount (const MultiShapeConf &arg) noexcept
 Gets the "child" count for the given shape configuration. More...
 
DistanceProxy GetChild (const MultiShapeConf &arg, ChildCounter index)
 Gets the "child" shape for the given shape configuration. More...
 
NonNegative< LengthGetVertexRadius (const MultiShapeConf &arg, ChildCounter index)
 Gets the vertex radius of the given shape configuration. More...
 
void Transform (MultiShapeConf &arg, const Mat22 &m) noexcept
 Transforms the given multi shape configuration by the given transformation matrix. More...
 
Length2 GetEdge (const PolygonShapeConf &shape, VertexCounter index)
 
bool Validate (const Span< const Length2 > verts)
 Validates the convexity of the given collection of vertices. More...
 
PLAYRHO_CONSTEXPR ChildCounter GetChildCount (const PolygonShapeConf &) noexcept
 Gets the "child" count for the given shape configuration. More...
 
DistanceProxy GetChild (const PolygonShapeConf &arg, ChildCounter index)
 Gets the "child" shape for the given shape configuration. More...
 
NonNegative< LengthGetVertexRadius (const PolygonShapeConf &arg) noexcept
 Gets the vertex radius of the given shape configuration. More...
 
NonNegative< LengthGetVertexRadius (const PolygonShapeConf &arg, ChildCounter) noexcept
 Gets the vertex radius of the given shape configuration. More...
 
MassData GetMassData (const PolygonShapeConf &arg) noexcept
 Gets the mass data for the given shape configuration. More...
 
void Transform (PolygonShapeConf &arg, const Mat22 &m) noexcept
 Transforms the given polygon configuration's vertices by the given transformation matrix. More...
 
bool TestPoint (const Shape &shape, Length2 point) noexcept
 Test a point for containment in the given shape. More...
 
ChildCounter GetChildCount (const Shape &shape) noexcept
 Gets the number of child primitives of the shape. More...
 
DistanceProxy GetChild (const Shape &shape, ChildCounter index)
 Gets the "child" for the given index. More...
 
MassData GetMassData (const Shape &shape) noexcept
 Gets the mass properties of this shape using its dimensions and density. More...
 
Real GetFriction (const Shape &shape) noexcept
 Gets the coefficient of friction. More...
 
Real GetRestitution (const Shape &shape) noexcept
 Gets the coefficient of restitution value of the given shape. More...
 
NonNegative< AreaDensityGetDensity (const Shape &shape) noexcept
 Gets the density of the given shape. More...
 
NonNegative< LengthGetVertexRadius (const Shape &shape, ChildCounter idx)
 Gets the vertex radius of the indexed child of the given shape. More...
 
void Transform (Shape &shape, const Mat22 &m)
 Transforms all of the given shape's vertices by the given transformation matrix. More...
 
bool Visit (const Shape &shape, void *userData)
 Visits the given shape with the potentially non-null user data pointer. More...
 
const void * GetData (const Shape &shape) noexcept
 Gets a pointer to the underlying data. More...
 
const std::type_info & GetUseTypeInfo (const Shape &shape)
 Gets the type info of the use of the given shape. More...
 
void Accept (const Shape &shape, const TypeInfoVisitor &visitor)
 Accepts a visitor. More...
 
bool operator== (const Shape &lhs, const Shape &rhs) noexcept
 Equality operator for shape to shape comparisons. More...
 
bool operator!= (const Shape &lhs, const Shape &rhs) noexcept
 Inequality operator for shape to shape comparisons. More...
 
PLAYRHO_CONSTEXPR NonNegative< AreaDensityGetDensity (const BaseShapeConf &arg) noexcept
 Gets the density of the given shape configuration. More...
 
PLAYRHO_CONSTEXPR Finite< RealGetRestitution (const BaseShapeConf &arg) noexcept
 Gets the restitution of the given shape configuration. More...
 
PLAYRHO_CONSTEXPR NonNegative< RealGetFriction (const BaseShapeConf &arg) noexcept
 Gets the friction of the given shape configuration. More...
 
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. More...
 
SeparationInfo GetMaxSeparation (const DistanceProxy &proxy1, Transformation xf1, const DistanceProxy &proxy2, Transformation xf2)
 Gets the max separation information. More...
 
SeparationInfo GetMaxSeparation (const DistanceProxy &proxy1, Transformation xf1, const DistanceProxy &proxy2, Transformation xf2, Length stop)
 Gets the max separation information. More...
 
SeparationInfo GetMaxSeparation (const DistanceProxy &proxy1, const DistanceProxy &proxy2, Length stop=MaxFloat *Meter)
 Gets the max separation information. More...
 
IndexPair3 GetIndexPairs (const SimplexEdges &collection) noexcept
 Gets index pairs for the given edges collection. More...
 
Length2 CalcSearchDirection (const SimplexEdges &simplexEdges) noexcept
 Calculates the "search direction" for the given simplex edge list. More...
 
Length2 GetScaledDelta (const Simplex &simplex, Simplex::size_type index)
 Gets the scaled delta for the given indexed element of the given simplex. More...
 
PLAYRHO_CONSTEXPR Length2 GetClosestPoint (const Simplex &simplex)
 Gets the "closest point". More...
 
PLAYRHO_CONSTEXPR Length2 GetPointDelta (const SimplexEdge &sv) noexcept
 Gets "w". More...
 
PLAYRHO_CONSTEXPR bool operator== (const SimplexEdge &lhs, const SimplexEdge &rhs) noexcept
 Equality operator for SimplexEdge. More...
 
PLAYRHO_CONSTEXPR bool operator!= (const SimplexEdge &lhs, const SimplexEdge &rhs) noexcept
 Inequality operator for SimplexEdge. More...
 
TOIOutput GetToiViaSat (const DistanceProxy &proxyA, const Sweep &sweepA, const DistanceProxy &proxyB, const Sweep &sweepB, ToiConf conf=GetDefaultToiConf())
 Gets the time of impact for two disjoint convex sets using the Separating Axis Theorem. More...
 
WorldManifold GetWorldManifold (const Manifold &manifold, Transformation xfA, Length radiusA, Transformation xfB, Length radiusB)
 Gets the world manifold for the given data. More...
 
WorldManifold GetWorldManifold (const Contact &contact)
 
PLAYRHO_CONSTEXPR bool operator== (const Acceleration &lhs, const Acceleration &rhs)
 Equality operator. More...
 
PLAYRHO_CONSTEXPR bool operator!= (const Acceleration &lhs, const Acceleration &rhs)
 Inequality operator. More...
 
PLAYRHO_CONSTEXPR Accelerationoperator*= (Acceleration &lhs, const Real rhs)
 Multiplication assignment operator. More...
 
PLAYRHO_CONSTEXPR Accelerationoperator/= (Acceleration &lhs, const Real rhs)
 Division assignment operator. More...
 
PLAYRHO_CONSTEXPR Accelerationoperator+= (Acceleration &lhs, const Acceleration &rhs)
 Addition assignment operator. More...
 
PLAYRHO_CONSTEXPR Acceleration operator+ (const Acceleration &lhs, const Acceleration &rhs)
 Addition operator. More...
 
PLAYRHO_CONSTEXPR Accelerationoperator-= (Acceleration &lhs, const Acceleration &rhs)
 Subtraction assignment operator. More...
 
PLAYRHO_CONSTEXPR Acceleration operator- (const Acceleration &lhs, const Acceleration &rhs)
 Subtraction operator. More...
 
PLAYRHO_CONSTEXPR Acceleration operator- (const Acceleration &value)
 Negation operator. More...
 
PLAYRHO_CONSTEXPR Acceleration operator+ (const Acceleration &value)
 Positive operator. More...
 
PLAYRHO_CONSTEXPR Acceleration operator* (const Acceleration &lhs, const Real rhs)
 Multiplication operator. More...
 
PLAYRHO_CONSTEXPR Acceleration operator* (const Real lhs, const Acceleration &rhs)
 Multiplication operator. More...
 
PLAYRHO_CONSTEXPR Acceleration operator/ (const Acceleration &lhs, const Real rhs)
 Division operator. More...
 
void Dump (const World &world)
 
void Dump (const Body &body, std::size_t bodyIndex)
 Dump body to a log file. More...
 
void Dump (const Joint &joint, std::size_t index)
 Dump joint to the log file. More...
 
void Dump (const Fixture &fixture, std::size_t bodyIndex)
 Dump fixture to log file. More...
 
void Dump (const DistanceJoint &joint, std::size_t index)
 Dump joint to log file. More...
 
void Dump (const FrictionJoint &joint, std::size_t index)
 Dump joint to the log file. More...
 
void Dump (const GearJoint &joint, std::size_t index)
 Dumps the joint to the log file. More...
 
void Dump (const MotorJoint &joint, std::size_t index)
 Dumps the joint to the log file. More...
 
void Dump (const TargetJoint &joint, std::size_t index)
 Dumps the joint to the log file. More...
 
void Dump (const PrismaticJoint &joint, std::size_t index)
 Dumps the joint to the log file. More...
 
void Dump (const PulleyJoint &joint, std::size_t index)
 Dump joint to log file. More...
 
void Dump (const RevoluteJoint &joint, std::size_t index)
 Dumps the joint to the log file. More...
 
void Dump (const RopeJoint &joint, std::size_t index)
 Dumps the joint to the log file. More...
 
void Dump (const WeldJoint &joint, std::size_t index)
 Dumps the joint to the log file. More...
 
void Dump (const WheelJoint &joint, std::size_t index)
 Dumps the joint to the log file. More...
 
LinearVelocity2 GetContactRelVelocity (const Velocity velA, const Length2 relA, const Velocity velB, const Length2 relB) noexcept
 Gets the contact relative velocity. More...
 
PLAYRHO_CONSTEXPR Vec2 GetVec2 (const UnitVec value)
 Gets a Vec2 representation of the given value. More...
 
Angle GetAngle (const UnitVec value)
 Gets the angle of the given unit vector. More...
 
template<class T , LoValueCheck lo, HiValueCheck hi>
PLAYRHO_CONSTEXPR Vector2< T > operator* (BoundedValue< T, lo, hi > s, UnitVec u) noexcept
 Multiplication operator. More...
 
template<class T >
PLAYRHO_CONSTEXPR Vector2< T > operator* (const T s, const UnitVec u) noexcept
 Multiplication operator. More...
 
template<class T , LoValueCheck lo, HiValueCheck hi>
PLAYRHO_CONSTEXPR Vector2< T > operator* (UnitVec u, BoundedValue< T, lo, hi > s) noexcept
 Multiplication operator. More...
 
template<class T >
PLAYRHO_CONSTEXPR Vector2< T > operator* (const UnitVec u, const T s) noexcept
 Multiplication operator. More...
 
PLAYRHO_CONSTEXPR Vec2 operator/ (const UnitVec u, const UnitVec::value_type s) noexcept
 Division operator. More...
 
template<class T >
PLAYRHO_CONSTEXPR auto Rotate (const Vector2< T > vector, const UnitVec &angle) noexcept
 Rotates a vector by a given angle. More...
 
template<class T >
PLAYRHO_CONSTEXPR auto InverseRotate (const Vector2< T > vector, const UnitVec &angle) noexcept
 Inverse rotates a vector. More...
 
template<class T >
UnitVec GetUnitVector (Vector2< T > value, UnitVec fallback=UnitVec::GetDefaultFallback())
 
Position GetNormalized (const Position &val) noexcept
 Gets the "normalized" position. More...
 
Sweep GetNormalized (Sweep sweep) noexcept
 Gets a sweep with the given sweep's angles normalized. More...
 
PLAYRHO_CONSTEXPR Length2 Transform (const Length2 v, const Transformation xfm) noexcept
 Transforms the given 2-D vector with the given transformation. More...
 
PLAYRHO_CONSTEXPR Length2 InverseTransform (const Length2 v, const Transformation T) noexcept
 Inverse transforms the given 2-D vector with the given transformation. More...
 
PLAYRHO_CONSTEXPR Transformation Mul (const Transformation &A, const Transformation &B) noexcept
 Multiplies a given transformation by another given transformation. More...
 
PLAYRHO_CONSTEXPR Transformation MulT (const Transformation &A, const Transformation &B) noexcept
 Inverse multiplies a given transformation by another given transformation. More...
 
PLAYRHO_CONSTEXPR Transformation GetTransformation (const Length2 ctr, const UnitVec rot, const Length2 localCtr) noexcept
 Gets the transformation for the given values. More...
 
Transformation GetTransformation (const Position pos, const Length2 local_ctr) noexcept
 Gets the transformation for the given values. More...
 
Transformation GetTransformation (const Sweep &sweep, const Real beta) noexcept
 Gets the interpolated transform at a specific time. More...
 
Transformation GetTransform0 (const Sweep &sweep) noexcept
 Gets the transform at "time" zero. More...
 
Transformation GetTransform1 (const Sweep &sweep) noexcept
 Gets the transform at "time" one. More...
 
bool IsUnderActive (Velocity velocity, LinearVelocity linSleepTol, AngularVelocity angSleepTol) noexcept
 Gets whether the given velocity is "under active" based on the given tolerances. More...
 
PLAYRHO_CONSTEXPR auto GetReflectionMatrix (UnitVec axis)
 Gets the reflection matrix for the given unit vector that defines the normal of the line through the origin that points should be reflected against. More...
 
PLAYRHO_CONSTEXPR bool operator== (const Position &lhs, const Position &rhs)
 Equality operator. More...
 
PLAYRHO_CONSTEXPR bool operator!= (const Position &lhs, const Position &rhs)
 Inequality operator. More...
 
PLAYRHO_CONSTEXPR Position operator- (const Position &value)
 Negation operator. More...
 
PLAYRHO_CONSTEXPR Position operator+ (const Position &value)
 Positive operator. More...
 
PLAYRHO_CONSTEXPR Positionoperator+= (Position &lhs, const Position &rhs)
 Addition assignment operator. More...
 
PLAYRHO_CONSTEXPR Position operator+ (const Position &lhs, const Position &rhs)
 Addition operator. More...
 
PLAYRHO_CONSTEXPR Positionoperator-= (Position &lhs, const Position &rhs)
 Subtraction assignment operator. More...
 
PLAYRHO_CONSTEXPR Position operator- (const Position &lhs, const Position &rhs)
 Subtraction operator. More...
 
PLAYRHO_CONSTEXPR Position operator* (const Position &pos, const Real scalar)
 Multiplication operator. More...
 
PLAYRHO_CONSTEXPR Position operator* (const Real scalar, const Position &pos)
 Multiplication operator. More...
 
PLAYRHO_CONSTEXPR Position GetPosition (const Position pos0, const Position pos1, const Real beta) noexcept
 
PLAYRHO_CONSTEXPR bool operator== (Transformation lhs, Transformation rhs) noexcept
 Equality operator. More...
 
PLAYRHO_CONSTEXPR bool operator!= (Transformation lhs, Transformation rhs) noexcept
 Inequality operator. More...
 
PLAYRHO_CONSTEXPR UnitVec GetXAxis (UnitVec rot) noexcept
 Gets the "X-axis". More...
 
PLAYRHO_CONSTEXPR UnitVec GetYAxis (UnitVec rot) noexcept
 Gets the "Y-axis". More...
 
PLAYRHO_CONSTEXPR bool operator== (const UnitVec a, const UnitVec b) noexcept
 Equality operator. More...
 
PLAYRHO_CONSTEXPR bool operator!= (const UnitVec a, const UnitVec b) noexcept
 Inequality operator. More...
 
PLAYRHO_CONSTEXPR UnitVec GetRevPerpendicular (const UnitVec vector) noexcept
 Gets a vector counter-clockwise (reverse-clockwise) perpendicular to the given vector. More...
 
PLAYRHO_CONSTEXPR UnitVec GetFwdPerpendicular (const UnitVec vector) noexcept
 Gets a vector clockwise (forward-clockwise) perpendicular to the given vector. More...
 
PLAYRHO_CONSTEXPR UnitVec Rotate (const UnitVec vector, const UnitVec &angle) noexcept
 Rotates a unit vector by the angle expressed by the second unit vector. More...
 
PLAYRHO_CONSTEXPR UnitVec InverseRotate (const UnitVec vector, const UnitVec &angle) noexcept
 Inverse rotates a vector. More...
 
template<std::size_t I>
PLAYRHO_CONSTEXPR UnitVec::value_type get (UnitVec v) noexcept
 Gets the specified element of the given collection. More...
 
template<>
PLAYRHO_CONSTEXPR UnitVec::value_type get< 0 > (UnitVec v) noexcept
 Gets element 0 of the given collection. More...
 
template<>
PLAYRHO_CONSTEXPR UnitVec::value_type get< 1 > (UnitVec v) noexcept
 Gets element 1 of the given collection. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const UnitVec &value)
 Output stream operator. More...
 
VelocityPair CalcWarmStartVelocityDeltas (const VelocityConstraint &vc)
 Calculates the "warm start" velocity deltas for the given velocity constraint. More...
 
PLAYRHO_CONSTEXPR bool operator== (const Velocity &lhs, const Velocity &rhs)
 Equality operator. More...
 
PLAYRHO_CONSTEXPR bool operator!= (const Velocity &lhs, const Velocity &rhs)
 Inequality operator. More...
 
PLAYRHO_CONSTEXPR Velocityoperator*= (Velocity &lhs, const Real rhs)
 Multiplication assignment operator. More...
 
PLAYRHO_CONSTEXPR Velocityoperator/= (Velocity &lhs, const Real rhs)
 Division assignment operator. More...
 
PLAYRHO_CONSTEXPR Velocityoperator+= (Velocity &lhs, const Velocity &rhs)
 Addition assignment operator. More...
 
PLAYRHO_CONSTEXPR Velocity operator+ (const Velocity &lhs, const Velocity &rhs)
 Addition operator. More...
 
PLAYRHO_CONSTEXPR Velocityoperator-= (Velocity &lhs, const Velocity &rhs)
 Subtraction assignment operator. More...
 
PLAYRHO_CONSTEXPR Velocity operator- (const Velocity &lhs, const Velocity &rhs)
 Subtraction operator. More...
 
PLAYRHO_CONSTEXPR Velocity operator- (const Velocity &value)
 Negation operator. More...
 
PLAYRHO_CONSTEXPR Velocity operator+ (const Velocity &value)
 Positive operator. More...
 
PLAYRHO_CONSTEXPR Velocity operator* (const Velocity &lhs, const Real rhs)
 Multiplication operator. More...
 
PLAYRHO_CONSTEXPR Velocity operator* (const Real lhs, const Velocity &rhs)
 Multiplication operator. More...
 
PLAYRHO_CONSTEXPR Velocity operator/ (const Velocity &lhs, const Real rhs)
 Division operator. More...
 
bool ShouldCollide (const Body &lhs, const Body &rhs) noexcept
 Should collide. More...
 
BodyCounter GetWorldIndex (const Body *body) noexcept
 Gets the world index for the given body. More...
 
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 by the given configuration. More...
 
Velocity Cap (Velocity velocity, Time h, MovementConf conf) noexcept
 Caps velocity. More...
 
std::size_t GetFixtureCount (const Body &body) noexcept
 Gets the fixture count of the given body. More...
 
void RotateAboutWorldPoint (Body &body, Angle amount, Length2 worldPoint)
 Rotates a body a given amount around a point in world coordinates. More...
 
void RotateAboutLocalPoint (Body &body, Angle amount, Length2 localPoint)
 Rotates a body a given amount around a point in body local coordinates. More...
 
Force2 GetCentripetalForce (const Body &body, Length2 axis)
 Gets the centripetal force necessary to put the body into an orbit having the given radius. More...
 
Acceleration CalcGravitationalAcceleration (const Body &body) noexcept
 Calculates the gravitationally associated acceleration for the given body within its world. More...
 
Acceleration GetAcceleration (const Body &body) noexcept
 Gets the given body's acceleration. More...
 
void SetAcceleration (Body &body, Acceleration value) noexcept
 Sets the accelerations on the given body. More...
 
bool Awaken (Body &body) noexcept
 Awakens the body if it's asleep. More...
 
bool Unawaken (Body &body) noexcept
 Puts the body to sleep if it's awake. More...
 
Position GetPosition1 (const Body &body) noexcept
 Gets the "position 1" Position information for the given body. More...
 
Mass GetMass (const Body &body) noexcept
 Gets the mass of the body. More...
 
void SetLinearAcceleration (Body &body, LinearAcceleration2 value) noexcept
 Sets the given linear acceleration of the given body. More...
 
void SetAngularAcceleration (Body &body, AngularAcceleration value) noexcept
 Sets the given angular acceleration of the given body. More...
 
void ApplyLinearAcceleration (Body &body, LinearAcceleration2 amount)
 Applies the given linear acceleration to the given body. More...
 
void SetForce (Body &body, Force2 force, Length2 point) noexcept
 Sets the given amount of force at the given point to the given body. More...
 
void ApplyForce (Body &body, Force2 force, Length2 point) noexcept
 Apply a force at a world point. More...
 
void ApplyForceToCenter (Body &body, Force2 force) noexcept
 Apply a force to the center of mass. More...
 
void SetTorque (Body &body, Torque torque) noexcept
 Sets the given amount of torque to the given body. More...
 
void ApplyTorque (Body &body, Torque torque) noexcept
 Applies a torque. More...
 
void ApplyLinearImpulse (Body &body, Momentum2 impulse, Length2 point) noexcept
 Applies an impulse at a point. More...
 
void ApplyAngularImpulse (Body &body, AngularMomentum impulse) noexcept
 Applies an angular impulse. More...
 
RotInertia GetRotInertia (const Body &body) noexcept
 Gets the rotational inertia of the body. More...
 
RotInertia GetLocalRotInertia (const Body &body) noexcept
 Gets the rotational inertia of the body about the local origin. More...
 
LinearVelocity2 GetLinearVelocity (const Body &body) noexcept
 Gets the linear velocity of the center of mass. More...
 
AngularVelocity GetAngularVelocity (const Body &body) noexcept
 Gets the angular velocity. More...
 
void SetLinearVelocity (Body &body, const LinearVelocity2 v) noexcept
 Sets the linear velocity of the center of mass. More...
 
void SetAngularVelocity (Body &body, AngularVelocity omega) noexcept
 Sets the angular velocity. More...
 
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. More...
 
Length2 GetWorldVector (const Body &body, const Length2 localVector) noexcept
 Gets the world coordinates of a vector given the local coordinates. More...
 
UnitVec GetWorldVector (const Body &body, const UnitVec localVector) noexcept
 Gets the world vector for the given local vector from the given body's transformation. More...
 
Length2 GetLocalPoint (const Body &body, const Length2 worldPoint) noexcept
 Gets a local point relative to the body's origin given a world point. More...
 
UnitVec GetLocalVector (const Body &body, const UnitVec uv) noexcept
 Gets a locally oriented unit vector given a world oriented unit vector. More...
 
LinearVelocity2 GetLinearVelocityFromWorldPoint (const Body &body, const Length2 worldPoint) noexcept
 Gets the linear velocity from a world point attached to this body. More...
 
LinearVelocity2 GetLinearVelocityFromLocalPoint (const Body &body, const Length2 localPoint) noexcept
 Gets the linear velocity from a local point. More...
 
Force2 GetForce (const Body &body) noexcept
 Gets the net force that the given body is currently experiencing. More...
 
Torque GetTorque (const Body &body) noexcept
 Gets the net torque that the given body is currently experiencing. More...
 
Length2 GetLocation (const Body &body) noexcept
 Gets the body's origin location. More...
 
Angle GetAngle (const Body &body) noexcept
 Gets the body's angle. More...
 
Transformation GetTransformation (const Body &body) noexcept
 Gets the body's transformation. More...
 
void SetTransformation (Body &body, const Transformation &xfm) noexcept
 Sets the body's transformation. More...
 
Position GetPosition (const Body &body) noexcept
 Gets the body's position. More...
 
void SetLocation (Body &body, Length2 value) noexcept
 Sets the body's location. More...
 
void SetAngle (Body &body, Angle value) noexcept
 Sets the body's angular orientation. More...
 
BodyConf GetBodyConf (const Body &body) noexcept
 Gets the body definition for the given body. More...
 
PLAYRHO_CONSTEXPR BodyConf GetDefaultBodyConf () noexcept
 Gets the default body definition. More...
 
ContactImpulsesList GetContactImpulses (const VelocityConstraint &vc)
 Gets the contact impulses for the given velocity constraint. More...
 
Momentum GetMaxNormalImpulse (const ContactImpulsesList &impulses) noexcept
 Gets the maximum normal impulse from the given contact impulses list. More...
 
BodyConstraint GetBodyConstraint (const Body &body, Time time, MovementConf conf) noexcept
 Gets the BodyConstraint based on the given parameters. More...
 
BodyGetBodyA (const Contact &contact) noexcept
 Gets the body A associated with the given contact. More...
 
BodyGetBodyB (const Contact &contact) noexcept
 Gets the body B associated with the given contact. More...
 
bool HasSensor (const Contact &contact) noexcept
 Whether the given contact has a sensor. More...
 
bool IsImpenetrable (const Contact &contact) noexcept
 Whether the given contact is "impenetrable". More...
 
bool IsActive (const Contact &contact) noexcept
 Determines whether the given contact is "active". More...
 
void SetAwake (const Contact &c) noexcept
 Sets awake the fixtures of the given contact. More...
 
void ResetFriction (Contact &contact)
 Resets the friction mixture to the default value. More...
 
void ResetRestitution (Contact &contact) noexcept
 Reset the restitution to the default value. More...
 
TOIOutput CalcToi (const Contact &contact, ToiConf conf)
 Calculates the Time Of Impact for the given contact with the given configuration. More...
 
FixtureGetFixtureA (const Contact &contact) noexcept
 Gets the fixture A associated with the given contact. More...
 
FixtureGetFixtureB (const Contact &contact) noexcept
 Gets the fixture B associated with the given contact. More...
 
ChildCounter GetChildIndexA (const Contact &contact) noexcept
 Gets the child index A of the given contact. More...
 
ChildCounter GetChildIndexB (const Contact &contact) noexcept
 Gets the child index B of the given contact. More...
 
ContactKey GetContactKey (const Fixture &fixtureA, ChildCounter childIndexA, const Fixture &fixtureB, ChildCounter childIndexB) noexcept
 Gets the ContactKey for the given parameters. More...
 
ContactKey GetContactKey (const Contact &contact) noexcept
 Gets the ContactKey for the given contact. More...
 
ContactGetContactPtr (KeyedContactPtr value)
 Gets the contact pointer for the given value. More...
 
PositionSolution operator+ (PositionSolution lhs, PositionSolution rhs)
 Addition operator. More...
 
PositionSolution operator- (PositionSolution lhs, PositionSolution rhs)
 Subtraction operator. More...
 
PositionSolverManifold GetPSM (const Manifold &manifold, Manifold::size_type index, const Transformation &xfA, const Transformation &xfB)
 
VelocityConstraint::Conf GetRegVelocityConstraintConf (const StepConf &conf) noexcept
 Gets the regular phase velocity constraint configuration from the given step configuration. More...
 
VelocityConstraint::Conf GetToiVelocityConstraintConf (const StepConf &conf) noexcept
 Gets the TOI phase velocity constraint configuration from the given step configuration. More...
 
UnitVec GetNormal (const VelocityConstraint &vc) noexcept
 
UnitVec GetTangent (const VelocityConstraint &vc) noexcept
 Gets the tangent from the given velocity constraint data. More...
 
InvMass GetInvMass (const VelocityConstraint &vc) noexcept
 Gets the inverse mass from the given velocity constraint data. More...
 
Length2 GetPointRelPosA (const VelocityConstraint &vc, VelocityConstraint::size_type index)
 Gets the point relative position A data. More...
 
Length2 GetPointRelPosB (const VelocityConstraint &vc, VelocityConstraint::size_type index)
 Gets the point relative position B data. More...
 
LinearVelocity GetVelocityBiasAtPoint (const VelocityConstraint &vc, VelocityConstraint::size_type index)
 Gets the velocity bias at the given point from the given velocity constraint. More...
 
Mass GetNormalMassAtPoint (const VelocityConstraint &vc, VelocityConstraint::size_type index)
 Gets the normal mass at the given point from the given velocity constraint. More...
 
Mass GetTangentMassAtPoint (const VelocityConstraint &vc, VelocityConstraint::size_type index)
 Gets the tangent mass at the given point from the given velocity constraint. More...
 
Momentum GetNormalImpulseAtPoint (const VelocityConstraint &vc, VelocityConstraint::size_type index)
 Gets the normal impulse at the given point from the given velocity constraint. More...
 
Momentum GetTangentImpulseAtPoint (const VelocityConstraint &vc, VelocityConstraint::size_type index)
 Gets the tangent impulse at the given point from the given velocity constraint. More...
 
Momentum2 GetNormalImpulses (const VelocityConstraint &vc)
 Gets the normal impulses of the given velocity constraint. More...
 
Momentum2 GetTangentImpulses (const VelocityConstraint &vc)
 Gets the tangent impulses of the given velocity constraint. More...
 
void SetNormalImpulseAtPoint (VelocityConstraint &vc, VelocityConstraint::size_type index, Momentum value)
 Sets the normal impulse at the given point of the given velocity constraint. More...
 
void SetTangentImpulseAtPoint (VelocityConstraint &vc, VelocityConstraint::size_type index, Momentum value)
 Sets the tangent impulse at the given point of the given velocity constraint. More...
 
void SetNormalImpulses (VelocityConstraint &vc, const Momentum2 impulses)
 Sets the normal impulses of the given velocity constraint. More...
 
void SetTangentImpulses (VelocityConstraint &vc, const Momentum2 impulses)
 Sets the tangent impulses of the given velocity constraint. More...
 
bool TestPoint (const Fixture &f, Length2 p) noexcept
 Tests a point for containment in a fixture. More...
 
void SetAwake (const Fixture &f) noexcept
 Sets the associated body's sleep status to awake. More...
 
Transformation GetTransformation (const Fixture &f) noexcept
 Gets the transformation associated with the given fixture. More...
 
bool ShouldCollide (const Fixture &fixtureA, const Fixture &fixtureB) noexcept
 Whether contact calculations should be performed between the two fixtures. More...
 
FixtureConf GetFixtureConf (const Fixture &fixture) noexcept
 Gets the fixture definition for the given fixture. More...
 
PLAYRHO_CONSTEXPR FixtureConf GetDefaultFixtureConf () noexcept
 Gets the default fixture definition. More...
 
std::size_t Count (const Island &island, const Body *entry)
 Counts the number of occurrences of the given entry in the given island. More...
 
std::size_t Count (const Island &island, const Contact *entry)
 Counts the number of occurrences of the given entry in the given island. More...
 
std::size_t Count (const Island &island, const Joint *entry)
 Counts the number of occurrences of the given entry in the given island. More...
 
bool IsFullOfBodies (const Island &island)
 Determines whether the given island is full of bodies. More...
 
bool IsFullOfContacts (const Island &island)
 Determines whether the given island is full of contacts. More...
 
DistanceJointConf GetDistanceJointConf (const DistanceJoint &joint) noexcept
 Gets the definition data for the given joint. More...
 
FrictionJointConf GetFrictionJointConf (const FrictionJoint &joint) noexcept
 Gets the definition data for the given joint. More...
 
GearJointConf GetGearJointConf (const GearJoint &joint) noexcept
 Gets the definition data for the given joint. More...
 
bool IsEnabled (const Joint &j) noexcept
 Short-cut function to determine if both bodies are enabled. More...
 
void SetAwake (Joint &j) noexcept
 Wakes up the joined bodies. More...
 
JointCounter GetWorldIndex (const Joint *joint)
 Gets the world index of the given joint. More...
 
BodyConstraintPtrAt (std::unordered_map< const Body *, BodyConstraint * > &container, const Body *key)
 Provides referenced access to the identified element of the given container. More...
 
const char * ToString (Joint::LimitState val) noexcept
 Provides a human readable C-style string uniquely identifying the given limit state. More...
 
template<class T >
void IncMotorSpeed (T &j, AngularVelocity delta)
 Increment motor speed. More...
 
void Set (JointConf &def, const Joint &joint) noexcept
 Sets the joint definition data for the given joint. More...
 
JointKey GetJointKey (const Joint &joint) noexcept
 Gets the JointKey for the given joint. More...
 
PLAYRHO_CONSTEXPR int Compare (const JointKey &lhs, const JointKey &rhs) noexcept
 Compares the given joint keys. More...
 
PLAYRHO_CONSTEXPR bool IsFor (const JointKey key, const Body *body) noexcept
 Determines whether the given key is for the given body. More...
 
JointGetJointPtr (std::pair< JointKey, Joint * > value)
 Gets the joint pointer from the given value. More...
 
JointType GetType (const Joint &joint) noexcept
 Gets the type of the given joint. More...
 
const char * ToString (JointType type) noexcept
 Provides a C-style (null-terminated) string name for given joint type. More...
 
MotorJointConf GetMotorJointConf (const MotorJoint &joint) noexcept
 Gets the definition data for the given joint. More...
 
Length GetJointTranslation (const PrismaticJoint &joint) noexcept
 Get the current joint translation. More...
 
LinearVelocity GetLinearVelocity (const PrismaticJoint &joint) noexcept
 Get the current joint translation speed. More...
 
Force GetMotorForce (const PrismaticJoint &joint, Frequency inv_dt) noexcept
 Gets the current motor force for the given joint, given the inverse time step. More...
 
PrismaticJointConf GetPrismaticJointConf (const PrismaticJoint &joint) noexcept
 Gets the definition data for the given joint. More...
 
Length GetCurrentLengthA (const PulleyJoint &joint)
 Get the current length of the segment attached to body-A. More...
 
Length GetCurrentLengthB (const PulleyJoint &joint)
 Get the current length of the segment attached to body-B. More...
 
PulleyJointConf GetPulleyJointConf (const PulleyJoint &joint) noexcept
 Gets the definition data for the given joint. More...
 
Angle GetJointAngle (const RevoluteJoint &joint)
 Gets the current joint angle. More...
 
AngularVelocity GetAngularVelocity (const RevoluteJoint &joint)
 Gets the current joint angle speed. More...
 
Torque GetMotorTorque (const RevoluteJoint &joint, Frequency inv_dt) noexcept
 Gets the current motor torque for the given joint given the inverse time step. More...
 
RevoluteJointConf GetRevoluteJointConf (const RevoluteJoint &joint) noexcept
 Gets the definition data for the given joint. More...
 
RopeJointConf GetRopeJointConf (const RopeJoint &joint) noexcept
 Gets the definition data for the given joint. More...
 
TargetJointConf GetTargetJointConf (const TargetJoint &joint) noexcept
 Gets the definition data for the given joint. More...
 
WeldJointConf GetWeldJointConf (const WeldJoint &joint) noexcept
 Gets the definition data for the given joint. More...
 
Length GetJointTranslation (const WheelJoint &joint) noexcept
 Get the current joint translation. More...
 
AngularVelocity GetAngularVelocity (const WheelJoint &joint) noexcept
 Get the current joint translation speed. More...
 
Torque GetMotorTorque (const WheelJoint &joint, Frequency inv_dt) noexcept
 Gets the current motor torque for the given joint for the given the inverse time step. More...
 
WheelJointConf GetWheelJointConf (const WheelJoint &joint) noexcept
 Gets the definition data for the given joint. More...
 
StepStats Step (World &world, Time delta, TimestepIters velocityIterations=8, TimestepIters positionIterations=3)
 Steps the world ahead by a given time amount. More...
 
ContactCounter GetTouchingCount (const World &world) noexcept
 Gets the touching count for the given world. More...
 
size_t GetFixtureCount (const World &world) noexcept
 Gets the count of fixtures in the given world. More...
 
size_t GetShapeCount (const World &world) noexcept
 Gets the count of unique shapes in the given world. More...
 
BodyCounter GetAwakeCount (const World &world) noexcept
 Gets the count of awake bodies in the given world. More...
 
BodyCounter Awaken (World &world) noexcept
 Awakens all of the bodies in the given world. More...
 
void SetAccelerations (World &world, Acceleration acceleration) noexcept
 Sets the accelerations of all the world's bodies to the given value. More...
 
void SetAccelerations (World &world, LinearAcceleration2 acceleration) noexcept
 Sets the accelerations of all the world's bodies to the given value. More...
 
BodyFindClosestBody (const World &world, Length2 location) noexcept
 Finds body in given world that's closest to the given location. More...
 
BodyCounter GetBodyCount (const World &world) noexcept
 Gets the body count in the given world. More...
 
JointCounter GetJointCount (const World &world) noexcept
 
ContactCounter GetContactCount (const World &world) noexcept
 Gets the count of contacts in the given world. More...
 
template<class F >
void SetAccelerations (World &world, F fn) noexcept
 Sets the accelerations of all the world's bodies. More...
 
void ClearForces (World &world) noexcept
 Clears forces. More...
 
PLAYRHO_CONSTEXPR WorldConf GetDefaultWorldConf () noexcept
 

Variables

const PLAYRHO_CONSTEXPR auto Transform_identity
 Identity transformation value. More...
 
const PLAYRHO_CONSTEXPR auto EarthlyGravity
 Earthly gravity in 2-dimensions. More...
 

Detailed Description

Name space for 2-dimensionally related PlayRho names.

Typedef Documentation

◆ AABB

using playrho::d2::AABB = typedef detail::AABB<2>

2-Dimensional Axis Aligned Bounding Box.

Note
This data structure is 16-bytes large (on at least one 64-bit platform).

Definition at line 415 of file AABB.hpp.

◆ ClipList

Clip list for ClipSegmentToLine.

See also
ClipSegmentToLine.
Note
This data structure is at least 24-bytes large.

Definition at line 77 of file Collision.hpp.

◆ DynamicTreeSizeCB

Query callback type.

Definition at line 744 of file DynamicTree.hpp.

◆ QueryFixtureCallback

using playrho::d2::QueryFixtureCallback = typedef std::function<bool(Fixture* fixture, ChildCounter child)>

Query AABB for fixtures callback function type.

Note
Returning true will continue the query. Returning false will terminate the query.

Definition at line 753 of file DynamicTree.hpp.

◆ LengthIndices

Length and vertex counter array of indices for 2-D space.

Definition at line 144 of file IndexPair.hpp.

◆ SeparationInfo

Separation information alias for 2-D space.

Definition at line 147 of file IndexPair.hpp.

◆ MassData

Mass data alias for 2-D objects.

Note
This data structure is 16-bytes large (on at least one 64-bit platform).

Definition at line 77 of file MassData.hpp.

◆ RayCastInput

Ray cast input data for 2-dimensions.

Definition at line 52 of file RayCastInput.hpp.

◆ RayCastOutput

Ray cast output.

This is a type alias for an optional RayCastHit instance.

See also
RayCast, Optional, RayCastHit

Definition at line 86 of file RayCastOutput.hpp.

◆ DynamicTreeRayCastCB

using playrho::d2::DynamicTreeRayCastCB = typedef std::function<Real(Fixture* fixture, ChildCounter child, const RayCastInput& input)>

Ray cast callback function.

Note
Return 0 to terminate ray casting, or > 0 to update the segment bounding box.

Definition at line 91 of file RayCastOutput.hpp.

◆ FixtureRayCastCB

using playrho::d2::FixtureRayCastCB = typedef std::function<RayCastOpcode(Fixture* fixture, ChildCounter child, Length2 point, UnitVec normal)>

Ray cast callback function signature.

Definition at line 95 of file RayCastOutput.hpp.

◆ TypeInfoVisitor

using playrho::d2::TypeInfoVisitor = typedef std::function<void(const std::type_info& ti, const void* data)>

Visitor type alias for underlying shape configuration.

Definition at line 118 of file Shape.hpp.

◆ SimplexEdges

using playrho::d2::SimplexEdges = typedef ArrayList<SimplexEdge, MaxSimplexEdges, std::remove_const<decltype(MaxSimplexEdges)>::type>

Simplex edge collection.

Note
This data is 20 * 3 + 4 = 64-bytes large (on at least one 64-bit platform).

Definition at line 34 of file Simplex.hpp.

◆ VelocityPair

using playrho::d2::VelocityPair = typedef std::pair<Velocity, Velocity>

Velocity pair.

Definition at line 142 of file Velocity.hpp.

◆ ContactPtr

using playrho::d2::ContactPtr = typedef Contact*

Contact pointer type.

Definition at line 529 of file Contact.hpp.

◆ KeyedContactPtr

using playrho::d2::KeyedContactPtr = typedef std::pair<ContactKey, Contact*>

Keyed contact pointer.

Definition at line 118 of file ContactKey.hpp.

◆ BodyConstraintPtr

A body constraint pointer alias.

Definition at line 49 of file Joint.hpp.

◆ BodyConstraintPair

using playrho::d2::BodyConstraintPair = typedef std::pair<const Body*, BodyConstraintPtr>

A body pointer and body constraint pointer pair alias.

Definition at line 52 of file Joint.hpp.

◆ BodyConstraintsMap

using playrho::d2::BodyConstraintsMap = typedef std::unordered_map<const Body*, BodyConstraint*>

A body constraints map alias.

Definition at line 61 of file Joint.hpp.

◆ BodyPtr

using playrho::d2::BodyPtr = typedef Body*

Body pointer alias.

Definition at line 97 of file World.cpp.

◆ BodyConstraintsPair

using playrho::d2::BodyConstraintsPair = typedef std::pair<const Body* const, BodyConstraint*>

A body pointer and body constraint pointer pair.

Definition at line 100 of file World.cpp.

◆ BodyConstraints

using playrho::d2::BodyConstraints = typedef std::vector<BodyConstraint>

Collection of body constraints.

Definition at line 103 of file World.cpp.

◆ PositionConstraints

Collection of position constraints.

Definition at line 106 of file World.cpp.

◆ VelocityConstraints

Collection of velocity constraints.

Definition at line 109 of file World.cpp.

Enumeration Type Documentation

◆ DynamicTreeOpcode

Opcodes for dynamic tree callbacks.

Enumerator
End 
Continue 

Definition at line 737 of file DynamicTree.hpp.

◆ JointType

enum playrho::d2::JointType : std::uint8_t
strong

Enumeration of joint types.

Enumerator
Unknown 
Revolute 
Prismatic 
Distance 
Pulley 
Target 
Gear 
Wheel 
Weld 
Friction 
Rope 
Motor 

Definition at line 33 of file JointType.hpp.

Function Documentation

◆ ComputeAABB() [1/5]

AABB ComputeAABB ( const DistanceProxy proxy,
const Transformation xf 
)
noexcept

Computes the AABB.

Computes the Axis Aligned Bounding Box (AABB) for the given child shape at a given a transform.

Warning
Behavior is undefined if the given transformation is invalid.
Parameters
proxyDistance proxy for the child shape.
xfWorld transform of the shape.
Returns
AABB for the proxy shape or the default AABB if the proxy has a zero vertex count.

Definition at line 36 of file AABB.cpp.

◆ ComputeAABB() [2/5]

AABB ComputeAABB ( const DistanceProxy proxy,
const Transformation xfm0,
const Transformation xfm1 
)
noexcept

Computes the AABB.

Computes the Axis Aligned Bounding Box (AABB) for the given child shape at the given transforms.

Warning
Behavior is undefined if a given transformation is invalid.
Parameters
proxyDistance proxy for the child shape.
xfm0World transform 0 of the shape.
xfm1World transform 1 of the shape.
Returns
AABB for the proxy shape or the default AABB if the proxy has a zero vertex count.

Definition at line 47 of file AABB.cpp.

◆ ComputeAABB() [3/5]

AABB ComputeAABB ( const Shape shape,
const Transformation xf 
)
noexcept

Computes the AABB for the given shape with the given transformation.

Definition at line 61 of file AABB.cpp.

◆ ComputeAABB() [4/5]

AABB ComputeAABB ( const Fixture fixture)
noexcept

Computes the AABB for the given fixture.

This is the AABB of the entire shape of the given fixture at the body's location for the given fixture.

Definition at line 72 of file AABB.cpp.

◆ ComputeAABB() [5/5]

AABB ComputeAABB ( const Body body)

Computes the AABB for the given body.

Definition at line 77 of file AABB.cpp.

◆ ComputeIntersectingAABB() [1/2]

AABB playrho::d2::ComputeIntersectingAABB ( const Fixture fA,
ChildCounter  iA,
const Fixture fB,
ChildCounter  iB 
)
noexcept

Computes the intersecting AABB for the given pair of fixtures and indexes.

The intersecting AABB for the given pair of fixtures is the intersection of the AABB for child A of the shape of fixture A with the AABB for child B of the shape of fixture B.

Definition at line 88 of file AABB.cpp.

◆ ComputeIntersectingAABB() [2/2]

AABB ComputeIntersectingAABB ( const Contact contact)

Computes the intersecting AABB for the given contact.

Definition at line 100 of file AABB.cpp.

◆ GetAABB() [1/3]

AABB playrho::d2::GetAABB ( const playrho::detail::RayCastInput< 2 > &  input)
noexcept

Gets the AABB for the given ray cast input data.

<2>

Definition at line 106 of file AABB.cpp.

◆ GetPerimeter()

PLAYRHO_CONSTEXPR Length playrho::d2::GetPerimeter ( const AABB aabb)
inlinenoexcept

Gets the perimeter length of the 2-dimensional AABB.

Warning
Behavior is undefined for an invalid AABB.
Returns
Twice the sum of the width and height.
See also
https://en.wikipedia.org/wiki/Perimeter

Definition at line 422 of file AABB.hpp.

◆ GetPointStates()

PointStates playrho::d2::GetPointStates ( const Manifold manifold1,
const Manifold manifold2 
)
noexcept

Computes the point states given two manifolds.

Examples
World.cpp.

Definition at line 27 of file Collision.cpp.

◆ ClipSegmentToLine()

ClipList playrho::d2::ClipSegmentToLine ( const ClipList vIn,
const UnitVec normal,
Length  offset,
ContactFeature::Index  indexA 
)

Clipping for contact manifolds.

This returns an array of points from the given line that are inside of the plane as defined by a given normal and offset.

Parameters
vInClip list of two points defining the line.
normalNormal of the plane with which to determine intersection.
offsetOffset of the plane with which to determine intersection.
indexAIndex of vertex A.
Returns
List of zero one or two clip points.

Definition at line 68 of file Collision.cpp.

◆ GetDistanceConf()

DistanceConf playrho::d2::GetDistanceConf ( const ToiConf conf)
noexcept

Gets the distance configuration for the given time of impact configuration.

Definition at line 75 of file Distance.cpp.

◆ GetWitnessPoints()

PairLength2 playrho::d2::GetWitnessPoints ( const Simplex simplex)
noexcept

Gets the witness points of the given simplex.

Definition at line 82 of file Distance.cpp.

◆ Distance()

DistanceOutput Distance ( const DistanceProxy proxyA,
const Transformation transformA,
const DistanceProxy proxyB,
const Transformation transformB,
DistanceConf  conf = DistanceConf{} 
)

Determines the closest points between two shapes.

Note
Supports any combination of shapes.
On the first call, the Simplex::Cache.count should be set to zero.
Parameters
proxyAProxy A.
transformATransform of A.
proxyBProxy B.
transformBTransform of B.
confConfiguration to use including the simplex cache for assisting the determination.
Returns
Closest points between the two shapes and the count of iterations it took to determine them. The iteration count will always be greater than zero unless DefaultMaxDistanceIters is zero.
Examples
World.cpp.

Definition at line 108 of file Distance.cpp.

◆ TestOverlap() [1/2]

Area playrho::d2::TestOverlap ( const DistanceProxy proxyA,
const Transformation xfA,
const DistanceProxy proxyB,
const Transformation xfB,
DistanceConf  conf = DistanceConf{} 
)

Determine if two generic shapes overlap.

Note
The returned touching state information typically agrees with that returned from the CollideShapes function. This is not always the case however especially when the separation or overlap distance is closer to zero.

Definition at line 217 of file Distance.cpp.

◆ GetDelta()

PLAYRHO_CONSTEXPR Length2 playrho::d2::GetDelta ( PairLength2  arg)
inlinenoexcept

Gets the delta to go from the first element to the second.

Definition at line 43 of file Distance.hpp.

◆ operator==() [1/14]

bool operator== ( const DistanceProxy lhs,
const DistanceProxy rhs 
)
noexcept

Determines with the two given distance proxies are equal.

Definition at line 28 of file DistanceProxy.cpp.

◆ FindLowestRightMostVertex()

std::size_t playrho::d2::FindLowestRightMostVertex ( Span< const Length2 vertices)

Finds the lowest right most vertex in the given collection.

Definition at line 41 of file DistanceProxy.cpp.

◆ GetConvexHullAsVector()

std::vector< Length2 > playrho::d2::GetConvexHullAsVector ( Span< const Length2 vertices)

Gets the convex hull for the given collection of vertices as a vector.

Definition at line 61 of file DistanceProxy.cpp.

◆ operator!=() [1/14]

bool operator!= ( const DistanceProxy lhs,
const DistanceProxy rhs 
)
inlinenoexcept

Determines with the two given distance proxies are not equal.

Definition at line 199 of file DistanceProxy.hpp.

◆ GetVertexRadius() [1/11]

NonNegative<Length> playrho::d2::GetVertexRadius ( const DistanceProxy arg)
inlinenoexcept

Gets the vertex radius property of a given distance proxy.

Examples
Body.cpp, and World.cpp.

Definition at line 205 of file DistanceProxy.hpp.

◆ GetSupportIndex()

template<class T >
VertexCounter GetSupportIndex ( const DistanceProxy proxy,
dir 
)
inlinenoexcept

Gets the supporting vertex index in the given direction for the given distance proxy.

This finds the vertex that's most significantly in the direction of the given vector and returns its index.

Note
0 is returned for a given zero length direction vector.
Parameters
proxyDistance proxy object to find index in if a valid index exists for it.
dirDirection vector to find index for.
Returns
InvalidVertex if d is invalid or the count of vertices is zero, otherwise a value from 0 to one less than count.
See also
GetVertexCount().

Definition at line 221 of file DistanceProxy.hpp.

◆ swap()

void playrho::d2::swap ( DynamicTree lhs,
DynamicTree rhs 
)
noexcept
Note
This satisfies the Swappable concept.
See also
http://en.cppreference.com/w/cpp/concept/Swappable

Definition at line 666 of file DynamicTree.cpp.

◆ Query() [1/2]

void playrho::d2::Query ( const DynamicTree tree,
const AABB aabb,
const DynamicTreeSizeCB callback 
)

Query the given dynamic tree and find nodes overlapping the given AABB.

Note
The callback instance is called for each leaf node that overlaps the supplied AABB.
Examples
World.cpp.

Definition at line 677 of file DynamicTree.cpp.

◆ Query() [2/2]

void playrho::d2::Query ( const DynamicTree tree,
const AABB aabb,
QueryFixtureCallback  callback 
)

Queries the world for all fixtures that potentially overlap the provided AABB.

Parameters
treeDynamic tree to do the query over.
aabbThe query box.
callbackUser implemented callback function.

Definition at line 711 of file DynamicTree.cpp.

◆ ComputeTotalPerimeter()

Length playrho::d2::ComputeTotalPerimeter ( const DynamicTree tree)
noexcept

Gets the sum of the perimeters of nodes.

Note
Zero is returned if no proxies exist at the time of the call.
Returns
Value of zero or more.

Definition at line 720 of file DynamicTree.cpp.

◆ ComputePerimeterRatio()

Real playrho::d2::ComputePerimeterRatio ( const DynamicTree tree)
noexcept

Gets the ratio of the sum of the perimeters of nodes to the root perimeter.

Note
Zero is returned if no proxies exist at the time of the call.
Returns
Value of zero or more.
Examples
World.cpp.

Definition at line 734 of file DynamicTree.cpp.

◆ ComputeHeight() [1/2]

DynamicTree::Height playrho::d2::ComputeHeight ( const DynamicTree tree,
DynamicTree::Size  index 
)
noexcept

Computes the height of the tree from a given node.

Warning
Behavior is undefined if the given index is not valid.
Parameters
treeTree to compute the height at the given node for.
indexID of node to compute height from.
Returns
0 unless the given index is to a branch node.

Definition at line 746 of file DynamicTree.cpp.

◆ GetMaxImbalance()

DynamicTree::Height playrho::d2::GetMaxImbalance ( const DynamicTree tree)
noexcept

Gets the maximum imbalance.

This gets the maximum imbalance of nodes in the given tree.

Note
The imbalance is the difference in height of the two children of a node.
Examples
World.cpp.

Definition at line 759 of file DynamicTree.cpp.

◆ ValidateStructure()

bool playrho::d2::ValidateStructure ( const DynamicTree tree,
DynamicTree::Size  index 
)
noexcept

Validates the structure of the given tree from the given index.

Note
Meant for testing.
Returns
true if valid, false otherwise.

Definition at line 777 of file DynamicTree.cpp.

◆ ValidateMetrics()

bool playrho::d2::ValidateMetrics ( const DynamicTree tree,
DynamicTree::Size  index 
)
noexcept

Validates the metrics of the given tree from the given index.

Note
Meant for testing.
Returns
true if valid, false otherwise.

Definition at line 814 of file DynamicTree.cpp.

◆ operator==() [2/14]

PLAYRHO_CONSTEXPR bool operator== ( const DynamicTree::LeafData lhs,
const DynamicTree::LeafData rhs 
)
inlinenoexcept

Equality operator.

Definition at line 331 of file DynamicTree.hpp.

◆ operator!=() [2/14]

PLAYRHO_CONSTEXPR bool operator!= ( const DynamicTree::LeafData lhs,
const DynamicTree::LeafData rhs 
)
inlinenoexcept

Inequality operator.

Definition at line 339 of file DynamicTree.hpp.

◆ IsUnused()

PLAYRHO_CONSTEXPR bool IsUnused ( const DynamicTree::TreeNode node)
inlinenoexcept

Is unused.

Whether this node is free (or allocated).

Determines whether the given dynamic tree node is an unused node.

Definition at line 631 of file DynamicTree.hpp.

◆ IsLeaf()

PLAYRHO_CONSTEXPR bool IsLeaf ( const DynamicTree::TreeNode node)
inlinenoexcept

Is leaf.

Whether or not this node is a leaf node.

Determines whether the given dynamic tree node is a leaf node. Leaf nodes have a pointer to user data.

Note
This has constant complexity.
Returns
true if this is a leaf node, false otherwise.

Definition at line 640 of file DynamicTree.hpp.

◆ IsBranch()

PLAYRHO_CONSTEXPR bool IsBranch ( const DynamicTree::TreeNode node)
inlinenoexcept

Is branch.

Determines whether the given dynamic tree node is a branch node. Branch nodes have 2 indices to child nodes.

Determines whether the given node is a "branch" node.

Definition at line 648 of file DynamicTree.hpp.

◆ ReplaceChild()

PLAYRHO_CONSTEXPR DynamicTree::BranchData playrho::d2::ReplaceChild ( DynamicTree::BranchData  bd,
DynamicTree::Size  oldChild,
DynamicTree::Size  newChild 
)
inline

Replaces the old child with the new child.

Definition at line 622 of file DynamicTree.hpp.

◆ GetAABB() [2/3]

PLAYRHO_CONSTEXPR AABB GetAABB ( const DynamicTree::TreeNode node)
inlinenoexcept

Gets the AABB of the given dynamic tree node.

Definition at line 655 of file DynamicTree.hpp.

◆ GetNext()

PLAYRHO_CONSTEXPR DynamicTree::Size GetNext ( const DynamicTree::TreeNode node)
inlinenoexcept

Gets the next index of the given node.

Warning
Behavior is undefined if the given node is not an "unused" node.

Definition at line 664 of file DynamicTree.hpp.

◆ GetHeight()

DynamicTree::Height GetHeight ( const DynamicTree tree)
inlinenoexcept

Gets the height of the binary tree.

Returns
Height of the tree (as stored in the root node) or 0 if the root node is not valid.
Examples
World.cpp.

Definition at line 673 of file DynamicTree.hpp.

◆ GetAABB() [3/3]

AABB GetAABB ( const DynamicTree tree)
inlinenoexcept

Gets the AABB for the given dynamic tree.

Gets the AABB that encloses all other AABB instances that are within the given dynamic tree.

Returns
Enclosing AABB or the "unset" AABB.

Definition at line 684 of file DynamicTree.hpp.

◆ TestOverlap() [2/2]

bool TestOverlap ( const DynamicTree tree,
DynamicTree::Size  leafIdA,
DynamicTree::Size  leafIdB 
)
inlinenoexcept

Tests for overlap of the elements identified in the given dynamic tree.

Definition at line 692 of file DynamicTree.hpp.

◆ ComputeHeight() [2/2]

DynamicTree::Height playrho::d2::ComputeHeight ( const DynamicTree tree)
inlinenoexcept

Computes the height of the given dynamic tree.

Definition at line 716 of file DynamicTree.hpp.

◆ size()

std::size_t playrho::d2::size ( const DynamicTree tree)
inlinenoexcept

Gets the "size" of the given tree.

Note
Size in this context is defined as the leaf count.
This provides ancillary support for the container concept's size method.
See also
DynamicTree::GetLeafCount()
http://en.cppreference.com/w/cpp/concept/Container

Definition at line 766 of file DynamicTree.hpp.

◆ GetManifold() [1/3]

Manifold playrho::d2::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.

Parameters
flippedWhether to flip the resulting manifold (between face-A and face-B).
shape0Shape 0. This should be shape A for face-A type manifold or shape B for face-B type manifold.
xf0Transform 0. This should be transform A for face-A type manifold or transform B for face-B type manifold.
idx0Index 0. This should be the index of the vertex and normal of shape0 that had the maximal separation distance from any vertex in shape1.
shape1Shape 1. This should be shape B for face-A type manifold or shape A for face-B type manifold.
xf1Transform 1. This should be transform B for face-A type manifold or transform A for face-B type manifold.
indices1Index 1. This is the first and possibly second index of the vertex of shape1 that had the maximal separation distance from the edge of shape0 identified by idx0.
confManifold configuration data.

< Face offset.

Definition at line 100 of file Manifold.cpp.

◆ GetManifold() [2/3]

Manifold playrho::d2::GetManifold ( bool  flipped,
Length  totalRadius,
const DistanceProxy shape,
const Transformation sxf,
Length2  point,
const Transformation xfm 
)

Computes manifolds for face-to-point collision.

< Center of circle in frame of polygon.

Definition at line 274 of file Manifold.cpp.

◆ GetManifold() [3/3]

Manifold playrho::d2::GetManifold ( Length2  locationA,
const Transformation xfA,
Length2  locationB,
const Transformation xfB,
Length  totalRadius 
)
noexcept

Gets a point-to-point based manifold.

Definition at line 371 of file Manifold.cpp.

◆ CollideShapes()

Manifold CollideShapes ( const DistanceProxy shapeA,
const Transformation xfA,
const DistanceProxy shapeB,
const Transformation xfB,
Manifold::Conf  conf = GetDefaultManifoldConf() 
)

Calculates the relevant collision manifold.

Note
The returned touching state information typically agrees with that returned from the distance-proxy-based TestOverlap function. This is not always the case however especially when the separation or overlap distance is closer to zero.

Definition at line 388 of file Manifold.cpp.

◆ GetName()

const char * playrho::d2::GetName ( Manifold::Type  type)
noexcept

Gets a unique name for the given manifold type.

Definition at line 774 of file Manifold.cpp.

◆ operator==() [3/14]

bool operator== ( const Manifold::Point lhs,
const Manifold::Point rhs 
)
noexcept

Determines whether the two given manifold points are equal.

Definition at line 787 of file Manifold.cpp.

◆ operator!=() [3/14]

bool operator!= ( const Manifold::Point lhs,
const Manifold::Point rhs 
)
noexcept

Determines whether the two given manifold points are not equal.

Definition at line 808 of file Manifold.cpp.

◆ operator==() [4/14]

bool operator== ( const Manifold lhs,
const Manifold rhs 
)
noexcept

Manifold equality operator.

Note
In-so-far as manifold points are concerned, order doesn't matter; only whether the two manifolds have the same point set.

Definition at line 813 of file Manifold.cpp.

◆ operator!=() [4/14]

bool operator!= ( const Manifold lhs,
const Manifold rhs 
)
noexcept

Manifold inequality operator.

Determines whether the two given manifolds are not equal.

Definition at line 890 of file Manifold.cpp.

◆ GetDefaultManifoldConf()

PLAYRHO_CONSTEXPR Manifold::Conf GetDefaultManifoldConf ( )
inlinenoexcept

Gets the default manifold configuration.

Definition at line 479 of file Manifold.hpp.

◆ GetMassData() [1/11]

MassData playrho::d2::GetMassData ( Length  r,
NonNegative< AreaDensity density,
Length2  location 
)

Computes the mass data for a circular shape.

Parameters
rRadius of the circular shape.
densityAreal density of mass.
locationLocation of the center of the shape.

Definition at line 32 of file MassData.cpp.

◆ GetMassData() [2/11]

MassData playrho::d2::GetMassData ( Length  r,
NonNegative< AreaDensity density,
Length2  v0,
Length2  v1 
)

Computes the mass data for a linear shape.

Parameters
rRadius of the vertices of the linear shape.
densityAreal density of mass.
v0Location of vertex zero.
v1Location of vertex one.

Use the fixture's areal mass density times the shape's second moment of area to derive I.

See also
https://en.wikipedia.org/wiki/Second_moment_of_area

Definition at line 55 of file MassData.cpp.

◆ GetMassData() [3/11]

MassData playrho::d2::GetMassData ( Length  vertexRadius,
NonNegative< AreaDensity density,
Span< const Length2 vertices 
)

Gets the mass data for the given collection of vertices with the given properties.

Definition at line 89 of file MassData.cpp.

◆ GetMassData() [4/11]

MassData GetMassData ( const Fixture f)

Computes the mass data for the given fixture.

The mass data is based on the density and the shape of the fixture. The rotational inertia is about the shape's origin.

Note
This operation may be expensive.
Parameters
fFixture to compute the mass data for.

Definition at line 182 of file MassData.cpp.

◆ ComputeMassData()

MassData ComputeMassData ( const Body body)
noexcept

Computes the body's mass data.

This basically accumulates the mass data over all fixtures.

Note
The center is the mass weighted sum of all fixture centers. Divide it by the mass to get the averaged center.
Returns
accumulated mass data for all fixtures associated with the given body.

Definition at line 187 of file MassData.cpp.

◆ GetMassData() [5/11]

MassData GetMassData ( const Body body)
noexcept

Gets the mass data of the body.

Returns
Data structure containing the mass, inertia, and center of the body.

Definition at line 206 of file MassData.cpp.

◆ GetSeparationScenario()

SeparationScenario playrho::d2::GetSeparationScenario ( IndexPair3  indices,
const DistanceProxy proxyA,
const Transformation xfA,
const DistanceProxy proxyB,
const Transformation xfB 
)

Gets a separation finder for the given inputs.

Warning
Behavior is undefined if given less than one index pair or more than three.
Parameters
indicesCollection of 1 to 3 index pairs. A points-type finder will be returned if given 1 index pair. A face-type finder will be returned otherwise.
proxyAProxy A.
xfATransformation A.
proxyBProxy B.
xfBTransformation B.

Definition at line 106 of file SeparationScenario.cpp.

◆ FindMinSeparation()

LengthIndexPair playrho::d2::FindMinSeparation ( const SeparationScenario scenario,
const Transformation xfA,
const Transformation xfB 
)

Finds the minimum separation.

Returns
indexes of proxy A's and proxy B's vertices that have the minimum distance between them and what that distance is.

Definition at line 173 of file SeparationScenario.cpp.

◆ Evaluate()

Length playrho::d2::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.

Parameters
scenarioSeparation scenario to evaluate.
indexPairIndexes of the proxy A and proxy B vertexes.
xfATransformation A.
xfBTransformation B.
Returns
Separation distance which will be negative when the given transforms put the vertices on the opposite sides of the separating axis.

Definition at line 186 of file SeparationScenario.cpp.

◆ GetChainShapeConf() [1/3]

ChainShapeConf playrho::d2::GetChainShapeConf ( Length2  dimensions)

Gets an enclosing chain shape configuration for an axis aligned rectangle of the given dimensions (width and height).

Definition at line 173 of file ChainShapeConf.cpp.

◆ GetChainShapeConf() [2/3]

ChainShapeConf playrho::d2::GetChainShapeConf ( const AABB arg)

Gets an enclosing chain shape configuration for the given axis aligned box.

Definition at line 194 of file ChainShapeConf.cpp.

◆ GetChildCount() [1/6]

ChildCounter playrho::d2::GetChildCount ( const ChainShapeConf arg)
inlinenoexcept

Gets the child count for a given chain shape configuration.

Examples
World.cpp.

Definition at line 154 of file ChainShapeConf.hpp.

◆ GetChild() [1/6]

DistanceProxy playrho::d2::GetChild ( const ChainShapeConf arg,
ChildCounter  index 
)
inline

Gets the "child" shape for a given chain shape configuration.

Definition at line 160 of file ChainShapeConf.hpp.

◆ GetMassData() [6/11]

MassData playrho::d2::GetMassData ( const ChainShapeConf arg)
inlinenoexcept

Gets the mass data for a given chain shape configuration.

Definition at line 166 of file ChainShapeConf.hpp.

◆ IsLooped()

bool playrho::d2::IsLooped ( const ChainShapeConf shape)
inlinenoexcept

Determines whether the given shape is looped.

Definition at line 172 of file ChainShapeConf.hpp.

◆ GetNextIndex()

ChildCounter playrho::d2::GetNextIndex ( const ChainShapeConf shape,
ChildCounter  index 
)
inlinenoexcept

Gets the next index after the given index for the given shape.

Definition at line 179 of file ChainShapeConf.hpp.

◆ GetVertexRadius() [2/11]

NonNegative<Length> playrho::d2::GetVertexRadius ( const ChainShapeConf arg)
inline

Gets the vertex radius of the given shape configuration.

Definition at line 185 of file ChainShapeConf.hpp.

◆ GetVertexRadius() [3/11]

NonNegative<Length> playrho::d2::GetVertexRadius ( const ChainShapeConf arg,
ChildCounter   
)
inline

Gets the vertex radius of the given shape configuration.

Definition at line 191 of file ChainShapeConf.hpp.

◆ Transform() [1/7]

void playrho::d2::Transform ( ChainShapeConf arg,
const Mat22 m 
)
inlinenoexcept

Transforms the given chain shape configuration's vertices by the given transformation matrix.

See also
https://en.wikipedia.org/wiki/Transformation_matrix

Definition at line 199 of file ChainShapeConf.hpp.

◆ GetChainShapeConf() [3/3]

ChainShapeConf playrho::d2::GetChainShapeConf ( Length  dimension)
inline

Gets an enclosing chain shape configuration for an axis aligned square of the given dimension.

Definition at line 210 of file ChainShapeConf.hpp.

◆ operator==() [5/14]

bool playrho::d2::operator== ( const DiskShapeConf lhs,
const DiskShapeConf rhs 
)
inlinenoexcept

Equality operator.

Definition at line 111 of file DiskShapeConf.hpp.

◆ operator!=() [5/14]

bool playrho::d2::operator!= ( const DiskShapeConf lhs,
const DiskShapeConf rhs 
)
inlinenoexcept

Inequality operator.

Definition at line 119 of file DiskShapeConf.hpp.

◆ GetChildCount() [2/6]

PLAYRHO_CONSTEXPR ChildCounter playrho::d2::GetChildCount ( const DiskShapeConf )
inlinenoexcept

Gets the "child" count of the given disk shape configuration.

Definition at line 125 of file DiskShapeConf.hpp.

◆ GetChild() [2/6]

DistanceProxy playrho::d2::GetChild ( const DiskShapeConf arg,
ChildCounter  index 
)
inline

Gets the "child" of the given disk shape configuration.

Definition at line 131 of file DiskShapeConf.hpp.

◆ GetVertexRadius() [4/11]

PLAYRHO_CONSTEXPR NonNegative<Length> playrho::d2::GetVertexRadius ( const DiskShapeConf arg)
inlinenoexcept

Gets the vertex radius of the given shape configuration.

Definition at line 141 of file DiskShapeConf.hpp.

◆ GetVertexRadius() [5/11]

PLAYRHO_CONSTEXPR NonNegative<Length> playrho::d2::GetVertexRadius ( const DiskShapeConf arg,
ChildCounter   
)
inlinenoexcept

Gets the vertex radius of the given shape configuration.

Definition at line 147 of file DiskShapeConf.hpp.

◆ GetMassData() [7/11]

MassData playrho::d2::GetMassData ( const DiskShapeConf arg)
inlinenoexcept

Gets the mass data of the given disk shape configuration.

Definition at line 154 of file DiskShapeConf.hpp.

◆ Transform() [2/7]

void playrho::d2::Transform ( DiskShapeConf arg,
const Mat22 m 
)
inlinenoexcept

Transforms the given shape configuration's vertices by the given transformation matrix.

See also
https://en.wikipedia.org/wiki/Transformation_matrix

Definition at line 162 of file DiskShapeConf.hpp.

◆ operator==() [6/14]

bool playrho::d2::operator== ( const EdgeShapeConf lhs,
const EdgeShapeConf rhs 
)
inlinenoexcept

Equality operator.

Definition at line 116 of file EdgeShapeConf.hpp.

◆ operator!=() [6/14]

bool playrho::d2::operator!= ( const EdgeShapeConf lhs,
const EdgeShapeConf rhs 
)
inlinenoexcept

Inequality operator.

Definition at line 124 of file EdgeShapeConf.hpp.

◆ GetChildCount() [3/6]

PLAYRHO_CONSTEXPR ChildCounter playrho::d2::GetChildCount ( const EdgeShapeConf )
inlinenoexcept

Gets the "child" count for the given shape configuration.

Returns
1.

Definition at line 131 of file EdgeShapeConf.hpp.

◆ GetChild() [3/6]

DistanceProxy playrho::d2::GetChild ( const EdgeShapeConf arg,
ChildCounter  index 
)
inline

Gets the "child" shape for the given shape configuration.

Definition at line 137 of file EdgeShapeConf.hpp.

◆ GetVertexRadius() [6/11]

NonNegative<Length> playrho::d2::GetVertexRadius ( const EdgeShapeConf arg)
inlinenoexcept

Gets the vertex radius of the given shape configuration.

Definition at line 147 of file EdgeShapeConf.hpp.

◆ GetVertexRadius() [7/11]

NonNegative<Length> playrho::d2::GetVertexRadius ( const EdgeShapeConf arg,
ChildCounter   
)
inlinenoexcept

Gets the vertex radius of the given shape configuration.

Definition at line 153 of file EdgeShapeConf.hpp.

◆ GetMassData() [8/11]

MassData playrho::d2::GetMassData ( const EdgeShapeConf arg)
inlinenoexcept

Gets the mass data for the given shape configuration.

Definition at line 159 of file EdgeShapeConf.hpp.

◆ Transform() [3/7]

void playrho::d2::Transform ( EdgeShapeConf arg,
const Mat22 m 
)
inlinenoexcept

Transforms the given shape configuration's vertices by the given transformation matrix.

See also
https://en.wikipedia.org/wiki/Transformation_matrix

Definition at line 167 of file EdgeShapeConf.hpp.

◆ GetMassData() [9/11]

MassData playrho::d2::GetMassData ( const MultiShapeConf arg)
noexcept

Gets the mass data for the given shape configuration.

Computes the mass properties of this shape using its dimensions and density. The inertia tensor is computed about the local origin.

Returns
Mass data for this shape.

Definition at line 32 of file MultiShapeConf.cpp.

◆ operator==() [7/14]

bool playrho::d2::operator== ( const MultiShapeConf lhs,
const MultiShapeConf rhs 
)
inlinenoexcept

Equality operator.

Definition at line 149 of file MultiShapeConf.hpp.

◆ operator!=() [7/14]

bool playrho::d2::operator!= ( const MultiShapeConf lhs,
const MultiShapeConf rhs 
)
inlinenoexcept

Inequality operator.

Definition at line 156 of file MultiShapeConf.hpp.

◆ GetChildCount() [4/6]

ChildCounter playrho::d2::GetChildCount ( const MultiShapeConf arg)
inlinenoexcept

Gets the "child" count for the given shape configuration.

Definition at line 162 of file MultiShapeConf.hpp.

◆ GetChild() [4/6]

DistanceProxy playrho::d2::GetChild ( const MultiShapeConf arg,
ChildCounter  index 
)
inline

Gets the "child" shape for the given shape configuration.

Definition at line 168 of file MultiShapeConf.hpp.

◆ GetVertexRadius() [8/11]

NonNegative<Length> playrho::d2::GetVertexRadius ( const MultiShapeConf arg,
ChildCounter  index 
)
inline

Gets the vertex radius of the given shape configuration.

Definition at line 181 of file MultiShapeConf.hpp.

◆ Transform() [4/7]

void playrho::d2::Transform ( MultiShapeConf arg,
const Mat22 m 
)
inlinenoexcept

Transforms the given multi shape configuration by the given transformation matrix.

See also
https://en.wikipedia.org/wiki/Transformation_matrix

Definition at line 193 of file MultiShapeConf.hpp.

◆ GetEdge()

Length2 GetEdge ( const PolygonShapeConf shape,
VertexCounter  index 
)

Gets the identified edge of the given polygon shape.

Note
This must not be called for shapes with less than 2 vertices.
Warning
Behavior is undefined if called for a shape with less than 2 vertices.

Definition at line 157 of file PolygonShapeConf.cpp.

◆ Validate()

bool playrho::d2::Validate ( const Span< const Length2 verts)

Validates the convexity of the given collection of vertices.

Note
This is a time consuming operation.
Returns
true if the given collection of vertices is indeed convex, false otherwise.

Definition at line 166 of file PolygonShapeConf.cpp.

◆ GetChildCount() [5/6]

PLAYRHO_CONSTEXPR ChildCounter playrho::d2::GetChildCount ( const PolygonShapeConf )
inlinenoexcept

Gets the "child" count for the given shape configuration.

Returns
1.

Definition at line 201 of file PolygonShapeConf.hpp.

◆ GetChild() [5/6]

DistanceProxy playrho::d2::GetChild ( const PolygonShapeConf arg,
ChildCounter  index 
)
inline

Gets the "child" shape for the given shape configuration.

Definition at line 207 of file PolygonShapeConf.hpp.

◆ GetVertexRadius() [9/11]

NonNegative<Length> playrho::d2::GetVertexRadius ( const PolygonShapeConf arg)
inlinenoexcept

Gets the vertex radius of the given shape configuration.

Definition at line 218 of file PolygonShapeConf.hpp.

◆ GetVertexRadius() [10/11]

NonNegative<Length> playrho::d2::GetVertexRadius ( const PolygonShapeConf arg,
ChildCounter   
)
inlinenoexcept

Gets the vertex radius of the given shape configuration.

Definition at line 224 of file PolygonShapeConf.hpp.

◆ GetMassData() [10/11]

MassData playrho::d2::GetMassData ( const PolygonShapeConf arg)
inlinenoexcept

Gets the mass data for the given shape configuration.

Definition at line 230 of file PolygonShapeConf.hpp.

◆ Transform() [5/7]

void playrho::d2::Transform ( PolygonShapeConf arg,
const Mat22 m 
)
inlinenoexcept

Transforms the given polygon configuration's vertices by the given transformation matrix.

See also
https://en.wikipedia.org/wiki/Transformation_matrix

Definition at line 244 of file PolygonShapeConf.hpp.

◆ GetChildCount() [6/6]

ChildCounter playrho::d2::GetChildCount ( const Shape shape)
noexcept

Gets the number of child primitives of the shape.

Returns
Non-negative count.

Definition at line 199 of file Shape.hpp.

◆ GetChild() [6/6]

DistanceProxy playrho::d2::GetChild ( const Shape shape,
ChildCounter  index 
)

Gets the "child" for the given index.

Parameters
shapeShape to get "child" shape of.
indexIndex to a child element of the shape. Value must be less than the number of child primitives of the shape.
Note
The shape must remain in scope while the proxy is in use.
Exceptions
InvalidArgumentif the given index is out of range.
See also
GetChildCount

Definition at line 204 of file Shape.hpp.

◆ GetMassData() [11/11]

MassData playrho::d2::GetMassData ( const Shape shape)
noexcept

Gets the mass properties of this shape using its dimensions and density.

Returns
Mass data for this shape.

Definition at line 209 of file Shape.hpp.

◆ GetFriction() [1/2]

Real playrho::d2::GetFriction ( const Shape shape)
noexcept

Gets the coefficient of friction.

Returns
Value of 0 or higher.
Examples
Contact.cpp.

Definition at line 219 of file Shape.hpp.

◆ GetRestitution() [1/2]

Real playrho::d2::GetRestitution ( const Shape shape)
noexcept

Gets the coefficient of restitution value of the given shape.

Examples
Contact.cpp.

Definition at line 224 of file Shape.hpp.

◆ GetDensity() [1/2]

NonNegative<AreaDensity> playrho::d2::GetDensity ( const Shape shape)
noexcept

Gets the density of the given shape.

Returns
Non-negative density (in mass per area).

Definition at line 229 of file Shape.hpp.

◆ GetVertexRadius() [11/11]

NonNegative<Length> playrho::d2::GetVertexRadius ( const Shape shape,
ChildCounter  idx 
)

Gets the vertex radius of the indexed child of the given shape.

This gets the radius from the vertex that the shape's "skin" should extend outward by. While any edges - line segments between multiple vertices - are straight, corners between them (the vertices) are rounded and treated as rounded. Shapes with larger vertex radiuses compared to edge lengths therefore will be more prone to rolling or having other shapes more prone to roll off of them. Here's an image of a shape configured via a PolygonShapeConf with it's skin drawn:

Parameters
shapeShape to get child's vertex radius for.
idxChild index to get vertex radius for.
Note
This must be a non-negative value.
See also
UseVertexRadius
Exceptions
InvalidArgumentif the child index is not less than the child count.

Definition at line 214 of file Shape.hpp.

◆ Transform() [6/7]

void playrho::d2::Transform ( Shape shape,
const Mat22 m 
)

Transforms all of the given shape's vertices by the given transformation matrix.

See also
https://en.wikipedia.org/wiki/Transformation_matrix
Note
This may throw std::bad_alloc or any exception that's thrown by the constructor for the model's underlying data type.
Exceptions
std::bad_allocif there's a failure allocating storage.

Definition at line 234 of file Shape.hpp.

◆ Visit()

bool playrho::d2::Visit ( const Shape shape,
void *  userData 
)

Visits the given shape with the potentially non-null user data pointer.

See also
https://en.wikipedia.org/wiki/Visitor_pattern

Definition at line 241 of file Shape.hpp.

◆ GetData()

const void* playrho::d2::GetData ( const Shape shape)
noexcept

Gets a pointer to the underlying data.

Note
Provided for introspective purposes like visitation.
Generally speaking, try to avoid using this method unless there's no other way to access the underlying data.
Examples
Body.cpp.

Definition at line 246 of file Shape.hpp.

◆ GetUseTypeInfo()

const std::type_info& playrho::d2::GetUseTypeInfo ( const Shape shape)

Gets the type info of the use of the given shape.

Note
This is not the same as calling typeid(Shape).
Returns
Type info of the underlying value's type.

Definition at line 251 of file Shape.hpp.

◆ Accept()

void playrho::d2::Accept ( const Shape shape,
const TypeInfoVisitor visitor 
)

Accepts a visitor.

This is the "accept" method definition of a "visitor design pattern" for doing shape configuration specific types of processing for a constant shape.

See also
https://en.wikipedia.org/wiki/Visitor_pattern

Definition at line 256 of file Shape.hpp.

◆ operator==() [8/14]

bool playrho::d2::operator== ( const Shape lhs,
const Shape rhs 
)
noexcept

Equality operator for shape to shape comparisons.

Definition at line 262 of file Shape.hpp.

◆ operator!=() [8/14]

bool playrho::d2::operator!= ( const Shape lhs,
const Shape rhs 
)
noexcept

Inequality operator for shape to shape comparisons.

Definition at line 267 of file Shape.hpp.

◆ GetDensity() [2/2]

PLAYRHO_CONSTEXPR NonNegative<AreaDensity> playrho::d2::GetDensity ( const BaseShapeConf arg)
inlinenoexcept

Gets the density of the given shape configuration.

Definition at line 126 of file ShapeConf.hpp.

◆ GetRestitution() [2/2]

PLAYRHO_CONSTEXPR Finite<Real> playrho::d2::GetRestitution ( const BaseShapeConf arg)
inlinenoexcept

Gets the restitution of the given shape configuration.

Definition at line 132 of file ShapeConf.hpp.

◆ GetFriction() [2/2]

PLAYRHO_CONSTEXPR NonNegative<Real> playrho::d2::GetFriction ( const BaseShapeConf arg)
inlinenoexcept

Gets the friction of the given shape configuration.

Definition at line 138 of file ShapeConf.hpp.

◆ GetMaxSeparation4x4()

SeparationInfo playrho::d2::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.

This is a version of the get-max-separation functions that is optimized for two quadrilateral (4-sided) polygons.

Returns
Index of the vertex and normal from proxy1, index of the vertex from proxy2 (that had the maximum separation distance from each other in the direction of that normal), and the maximal distance.

Definition at line 69 of file ShapeSeparation.cpp.

◆ GetMaxSeparation() [1/3]

SeparationInfo playrho::d2::GetMaxSeparation ( const DistanceProxy proxy1,
Transformation  xf1,
const DistanceProxy proxy2,
Transformation  xf2 
)

Gets the max separation information.

Note
Prefer using this function - over the GetMaxSeparation function that takes a stopping length - when it's already known that the two convex shapes' AABBs overlap.
Returns
Index of the vertex and normal from proxy1, index of the vertex from proxy2 (that had the maximum separation distance from each other in the direction of that normal), and the maximal distance.

Definition at line 111 of file ShapeSeparation.cpp.

◆ GetMaxSeparation() [2/3]

SeparationInfo playrho::d2::GetMaxSeparation ( const DistanceProxy proxy1,
Transformation  xf1,
const DistanceProxy proxy2,
Transformation  xf2,
Length  stop 
)

Gets the max separation information.

Returns
Index of the vertex and normal from proxy1, index of the vertex from proxy2 (that had the maximum separation distance from each other in the direction of that normal), and the maximal distance.

Definition at line 137 of file ShapeSeparation.cpp.

◆ GetMaxSeparation() [3/3]

SeparationInfo playrho::d2::GetMaxSeparation ( const DistanceProxy proxy1,
const DistanceProxy proxy2,
Length  stop = MaxFloat *Meter 
)

Gets the max separation information.

Returns
Index of the vertex and normal from proxy1, index of the vertex from proxy2 (that had the maximum separation distance from each other in the direction of that normal), and the maximal distance.

Definition at line 167 of file ShapeSeparation.cpp.

◆ GetIndexPairs()

IndexPair3 playrho::d2::GetIndexPairs ( const SimplexEdges collection)
noexcept

Gets index pairs for the given edges collection.

Definition at line 25 of file Simplex.cpp.

◆ CalcSearchDirection()

Length2 playrho::d2::CalcSearchDirection ( const SimplexEdges simplexEdges)
noexcept

Calculates the "search direction" for the given simplex edge list.

Parameters
simplexEdgesA one or two edge list.
Warning
Behavior is undefined if the given edge list has zero edges.
Returns
"search direction" vector.

Definition at line 37 of file Simplex.cpp.

◆ GetScaledDelta()

Length2 playrho::d2::GetScaledDelta ( const Simplex simplex,
Simplex::size_type  index 
)
inline

Gets the scaled delta for the given indexed element of the given simplex.

Definition at line 201 of file Simplex.hpp.

◆ GetClosestPoint()

PLAYRHO_CONSTEXPR Length2 playrho::d2::GetClosestPoint ( const Simplex simplex)
inline

Gets the "closest point".

Definition at line 207 of file Simplex.hpp.

◆ GetPointDelta()

PLAYRHO_CONSTEXPR Length2 playrho::d2::GetPointDelta ( const SimplexEdge sv)
inlinenoexcept

Gets "w".

Returns
2-dimensional vector value of the simplex edge's point B minus its point A.

Definition at line 83 of file SimplexEdge.hpp.

◆ operator==() [9/14]

PLAYRHO_CONSTEXPR bool playrho::d2::operator== ( const SimplexEdge lhs,
const SimplexEdge rhs 
)
inlinenoexcept

Equality operator for SimplexEdge.

Definition at line 89 of file SimplexEdge.hpp.

◆ operator!=() [9/14]

PLAYRHO_CONSTEXPR bool playrho::d2::operator!= ( const SimplexEdge lhs,
const SimplexEdge rhs 
)
inlinenoexcept

Inequality operator for SimplexEdge.

Definition at line 97 of file SimplexEdge.hpp.

◆ GetToiViaSat()

TOIOutput playrho::d2::GetToiViaSat ( const DistanceProxy proxyA,
const Sweep sweepA,
const DistanceProxy proxyB,
const Sweep sweepB,
ToiConf  conf = GetDefaultToiConf() 
)

Gets the time of impact for two disjoint convex sets using the Separating Axis Theorem.

Computes the upper bound on time before two shapes penetrate too much. Time is represented as a fraction between [0,tMax]. This uses a swept separating axis and may miss some intermediate, non-tunneling collision. If you change the time interval, you should call this function again.

See also
https://en.wikipedia.org/wiki/Hyperplane_separation_theorem
Precondition
The given sweeps are both at the same alpha-0.
Warning
Behavior is undefined if sweeps are not at the same alpha-0.
Behavior is undefined if the configuration's tMax is not between 0 and 1 inclusive.
Note
Uses Distance to compute the contact point and normal at the time of impact.
This only works for two disjoint convex sets.
Parameters
proxyAProxy A. The proxy's vertex count must be 1 or more.
sweepASweep A. Sweep of motion for shape represented by proxy A.
proxyBProxy B. The proxy's vertex count must be 1 or more.
sweepBSweep B. Sweep of motion for shape represented by proxy B.
confConfiguration details for on calculation. Like the targeted depth of penetration.
Returns
Time of impact output data.

XXX maybe should return TOIOutput{timeLo, stats, TOIOutput::e_belowMinTarget}?

Definition at line 66 of file TimeOfImpact.cpp.

◆ GetWorldManifold() [1/2]

WorldManifold GetWorldManifold ( const Manifold manifold,
Transformation  xfA,
Length  radiusA,
Transformation  xfB,
Length  radiusB 
)

Gets the world manifold for the given data.

Precondition
The given manifold input has between 0 and 2 points.
Parameters
manifoldManifold to use. Uses the manifold's type, local point, local normal, point-count, and the indexed-points' local point data.
xfATransformation A.
radiusARadius of shape A.
xfBTransformation B.
radiusBRadius of shape B.
Returns
World manifold value for the given inputs which will have the same number of points as the given manifold has. The returned world manifold points will be the mid-points of the manifold intersection.

Definition at line 105 of file WorldManifold.cpp.

◆ GetWorldManifold() [2/2]

WorldManifold GetWorldManifold ( const Contact contact)

Gets the world manifold for the given data.

Note
This is a convenience function that in turn calls the GetWorldManifold(const Manifold&, const Transformation&, const Real, const Transformation& xfB, const Real) function.
Parameters
contactContact to return a world manifold for.
Returns
World manifold value for the given inputs which will have the same number of points as the given manifold has. The returned world manifold points will be the mid-points of the contact's intersection.

Definition at line 126 of file WorldManifold.cpp.

◆ operator==() [10/14]

PLAYRHO_CONSTEXPR bool operator== ( const Acceleration lhs,
const Acceleration rhs 
)
inline

Equality operator.

Definition at line 41 of file Acceleration.hpp.

◆ operator!=() [10/14]

PLAYRHO_CONSTEXPR bool operator!= ( const Acceleration lhs,
const Acceleration rhs 
)
inline

Inequality operator.

Definition at line 48 of file Acceleration.hpp.

◆ operator*=() [1/2]

PLAYRHO_CONSTEXPR Acceleration & operator*= ( Acceleration lhs,
const Real  rhs 
)
inline

Multiplication assignment operator.

Definition at line 55 of file Acceleration.hpp.

◆ operator/=() [1/2]

PLAYRHO_CONSTEXPR Acceleration & operator/= ( Acceleration lhs,
const Real  rhs 
)
inline

Division assignment operator.

Definition at line 64 of file Acceleration.hpp.

◆ operator+=() [1/3]

PLAYRHO_CONSTEXPR Acceleration & operator+= ( Acceleration lhs,
const Acceleration rhs 
)
inline

Addition assignment operator.

Definition at line 73 of file Acceleration.hpp.

◆ operator+() [1/7]

PLAYRHO_CONSTEXPR Acceleration operator+ ( const Acceleration lhs,
const Acceleration rhs 
)
inline

Addition operator.

Definition at line 82 of file Acceleration.hpp.

◆ operator-=() [1/3]

PLAYRHO_CONSTEXPR Acceleration & operator-= ( Acceleration lhs,
const Acceleration rhs 
)
inline

Subtraction assignment operator.

Definition at line 89 of file Acceleration.hpp.

◆ operator-() [1/7]

PLAYRHO_CONSTEXPR Acceleration operator- ( const Acceleration lhs,
const Acceleration rhs 
)
inline

Subtraction operator.

Definition at line 98 of file Acceleration.hpp.

◆ operator-() [2/7]

PLAYRHO_CONSTEXPR Acceleration operator- ( const Acceleration value)
inline

Negation operator.

Definition at line 105 of file Acceleration.hpp.

◆ operator+() [2/7]

PLAYRHO_CONSTEXPR Acceleration operator+ ( const Acceleration value)
inline

Positive operator.

Definition at line 112 of file Acceleration.hpp.

◆ operator*() [1/10]

PLAYRHO_CONSTEXPR Acceleration operator* ( const Acceleration lhs,
const Real  rhs 
)
inline

Multiplication operator.

Definition at line 119 of file Acceleration.hpp.

◆ operator*() [2/10]

PLAYRHO_CONSTEXPR Acceleration operator* ( const Real  lhs,
const Acceleration rhs 
)
inline

Multiplication operator.

Definition at line 126 of file Acceleration.hpp.

◆ operator/() [1/3]

PLAYRHO_CONSTEXPR Acceleration operator/ ( const Acceleration lhs,
const Real  rhs 
)
inline

Division operator.

Definition at line 133 of file Acceleration.hpp.

◆ Dump() [1/15]

void playrho::d2::Dump ( const World world)

Dump the world into the log file.

Warning
this should be called outside of a time step.

Definition at line 64 of file CodeDumper.cpp.

◆ Dump() [2/15]

void playrho::d2::Dump ( const Body body,
std::size_t  bodyIndex 
)

Dump body to a log file.

Definition at line 93 of file CodeDumper.cpp.

◆ Dump() [3/15]

void playrho::d2::Dump ( const Joint joint,
std::size_t  index 
)

Dump joint to the log file.

Definition at line 127 of file CodeDumper.cpp.

◆ Dump() [4/15]

void playrho::d2::Dump ( const Fixture fixture,
std::size_t  bodyIndex 
)

Dump fixture to log file.

Definition at line 170 of file CodeDumper.cpp.

◆ Dump() [5/15]

void playrho::d2::Dump ( const DistanceJoint joint,
std::size_t  index 
)

Dump joint to log file.

Definition at line 196 of file CodeDumper.cpp.

◆ Dump() [6/15]

void playrho::d2::Dump ( const FrictionJoint joint,
std::size_t  index 
)

Dump joint to the log file.

Definition at line 216 of file CodeDumper.cpp.

◆ Dump() [7/15]

void playrho::d2::Dump ( const GearJoint joint,
std::size_t  index 
)

Dumps the joint to the log file.

Definition at line 235 of file CodeDumper.cpp.

◆ Dump() [8/15]

void playrho::d2::Dump ( const MotorJoint joint,
std::size_t  index 
)

Dumps the joint to the log file.

Definition at line 247 of file CodeDumper.cpp.

◆ Dump() [9/15]

void playrho::d2::Dump ( const TargetJoint joint,
std::size_t  index 
)

Dumps the joint to the log file.

Definition at line 266 of file CodeDumper.cpp.

◆ Dump() [10/15]

void playrho::d2::Dump ( const PrismaticJoint joint,
std::size_t  index 
)

Dumps the joint to the log file.

Definition at line 283 of file CodeDumper.cpp.

◆ Dump() [11/15]

void playrho::d2::Dump ( const PulleyJoint joint,
std::size_t  index 
)

Dump joint to log file.

Definition at line 312 of file CodeDumper.cpp.

◆ Dump() [12/15]

void playrho::d2::Dump ( const RevoluteJoint joint,
std::size_t  index 
)

Dumps the joint to the log file.

Definition at line 338 of file CodeDumper.cpp.

◆ Dump() [13/15]

void playrho::d2::Dump ( const RopeJoint joint,
std::size_t  index 
)

Dumps the joint to the log file.

Definition at line 365 of file CodeDumper.cpp.

◆ Dump() [14/15]

void playrho::d2::Dump ( const WeldJoint joint,
std::size_t  index 
)

Dumps the joint to the log file.

Definition at line 382 of file CodeDumper.cpp.

◆ Dump() [15/15]

void playrho::d2::Dump ( const WheelJoint joint,
std::size_t  index 
)

Dumps the joint to the log file.

Definition at line 402 of file CodeDumper.cpp.

◆ GetContactRelVelocity()

LinearVelocity2 playrho::d2::GetContactRelVelocity ( const Velocity  velA,
const Length2  relA,
const Velocity  velB,
const Length2  relB 
)
noexcept

Gets the contact relative velocity.

Note
If relA and relB are the zero vectors, the resulting value is simply velB.linear - velA.linear.

Definition at line 173 of file Math.cpp.

◆ GetVec2()

PLAYRHO_CONSTEXPR Vec2 playrho::d2::GetVec2 ( const UnitVec  value)
inline

Gets a Vec2 representation of the given value.

Examples
World.cpp.

Definition at line 697 of file Math.hpp.

◆ GetAngle() [1/2]

Angle playrho::d2::GetAngle ( const UnitVec  value)
inline

Gets the angle of the given unit vector.

Definition at line 703 of file Math.hpp.

◆ operator*() [3/10]

template<class T , LoValueCheck lo, HiValueCheck hi>
PLAYRHO_CONSTEXPR Vector2<T> playrho::d2::operator* ( BoundedValue< T, lo, hi >  s,
UnitVec  u 
)
inlinenoexcept

Multiplication operator.

Definition at line 710 of file Math.hpp.

◆ operator*() [4/10]

template<class T >
PLAYRHO_CONSTEXPR Vector2<T> playrho::d2::operator* ( const T  s,
const UnitVec  u 
)
inlinenoexcept

Multiplication operator.

Definition at line 717 of file Math.hpp.

◆ operator*() [5/10]

template<class T , LoValueCheck lo, HiValueCheck hi>
PLAYRHO_CONSTEXPR Vector2<T> playrho::d2::operator* ( UnitVec  u,
BoundedValue< T, lo, hi >  s 
)
inlinenoexcept

Multiplication operator.

Definition at line 724 of file Math.hpp.

◆ operator*() [6/10]

template<class T >
PLAYRHO_CONSTEXPR Vector2<T> playrho::d2::operator* ( const UnitVec  u,
const T  s 
)
inlinenoexcept

Multiplication operator.

Definition at line 731 of file Math.hpp.

◆ operator/() [2/3]

PLAYRHO_CONSTEXPR Vec2 playrho::d2::operator/ ( const UnitVec  u,
const UnitVec::value_type  s 
)
inlinenoexcept

Division operator.

Definition at line 737 of file Math.hpp.

◆ Rotate() [1/2]

template<class T >
PLAYRHO_CONSTEXPR auto playrho::d2::Rotate ( const Vector2< T >  vector,
const UnitVec angle 
)
inlinenoexcept

Rotates a vector by a given angle.

This rotates a vector by the angle expressed by the angle parameter.

Parameters
vectorVector to forward rotate.
angleExpresses the angle to forward rotate the given vector by.
See also
InverseRotate.

Definition at line 749 of file Math.hpp.

◆ InverseRotate() [1/2]

template<class T >
PLAYRHO_CONSTEXPR auto playrho::d2::InverseRotate ( const Vector2< T >  vector,
const UnitVec angle 
)
inlinenoexcept

Inverse rotates a vector.

This is the inverse of rotating a vector - it undoes what rotate does. I.e. this effectively subtracts from the angle of the given vector the angle that's expressed by the angle parameter.

Parameters
vectorVector to reverse rotate.
angleExpresses the angle to reverse rotate the given vector by.
See also
Rotate.

Definition at line 764 of file Math.hpp.

◆ GetUnitVector()

template<class T >
UnitVec playrho::d2::GetUnitVector ( Vector2< T >  value,
UnitVec  fallback = UnitVec::GetDefaultFallback() 
)
inline

Gets the unit vector for the given value.

Parameters
valueValue to get the unit vector for.
fallbackFallback unit vector value to use in case a unit vector can't effectively be calculated from the given value.
Returns
value divided by its length if length not almost zero otherwise invalid value.
See also
AlmostEqual.

Definition at line 778 of file Math.hpp.

◆ GetNormalized() [1/2]

Position playrho::d2::GetNormalized ( const Position val)
inlinenoexcept

Gets the "normalized" position.

Enforces a wrap-around of one rotation on the angular position.

Note
Use to prevent unbounded angles in positions.

Definition at line 786 of file Math.hpp.

◆ GetNormalized() [2/2]

Sweep GetNormalized ( Sweep  sweep)
inlinenoexcept

Gets a sweep with the given sweep's angles normalized.

Parameters
sweepSweep to return with its angles normalized.
Returns
Sweep with its position 0 angle to be between -2 pi and 2 pi and its position 1 angle reduced by the amount the position 0 angle was reduced by.

Definition at line 796 of file Math.hpp.

◆ Transform() [7/7]

PLAYRHO_CONSTEXPR Length2 playrho::d2::Transform ( const Length2  v,
const Transformation  xfm 
)
inlinenoexcept

Transforms the given 2-D vector with the given transformation.

Rotate and translate the given 2-D linear position according to the rotation and translation defined by the given transformation.

Note
Passing the output of this function to InverseTransform (with the same transformation again) will result in the original vector being returned.
For a 2-D linear position of the origin (0, 0), the result is simply the translation.
See also
InverseTransform.
Parameters
v2-D position to transform (to rotate and then translate).
xfmTransformation (a translation and rotation) to apply to the given vector.
Returns
Rotated and translated vector.

Definition at line 816 of file Math.hpp.

◆ InverseTransform()

PLAYRHO_CONSTEXPR Length2 playrho::d2::InverseTransform ( const Length2  v,
const Transformation  T 
)
inlinenoexcept

Inverse transforms the given 2-D vector with the given transformation.

Inverse translate and rotate the given 2-D vector according to the translation and rotation defined by the given transformation.

Note
Passing the output of this function to Transform (with the same transformation again) will result in the original vector being returned.
See also
Transform.
Parameters
v2-D vector to inverse transform (inverse translate and inverse rotate).
TTransformation (a translation and rotation) to inversely apply to the given vector.
Returns
Inverse transformed vector.

Definition at line 831 of file Math.hpp.

◆ Mul()

PLAYRHO_CONSTEXPR Transformation playrho::d2::Mul ( const Transformation A,
const Transformation B 
)
inlinenoexcept

Multiplies a given transformation by another given transformation.

Note
v2 = A.q.Rot(B.q.Rot(v1) + B.p) + A.p = (A.q * B.q).Rot(v1) + A.q.Rot(B.p) + A.p

Definition at line 840 of file Math.hpp.

◆ MulT()

PLAYRHO_CONSTEXPR Transformation playrho::d2::MulT ( const Transformation A,
const Transformation B 
)
inlinenoexcept

Inverse multiplies a given transformation by another given transformation.

Note
v2 = A.q' * (B.q * v1 + B.p - A.p) = A.q' * B.q * v1 + A.q' * (B.p - A.p)

Definition at line 848 of file Math.hpp.

◆ GetTransformation() [1/5]

PLAYRHO_CONSTEXPR Transformation playrho::d2::GetTransformation ( const Length2  ctr,
const UnitVec  rot,
const Length2  localCtr 
)
inlinenoexcept

Gets the transformation for the given values.

Definition at line 855 of file Math.hpp.

◆ GetTransformation() [2/5]

Transformation playrho::d2::GetTransformation ( const Position  pos,
const Length2  local_ctr 
)
inlinenoexcept

Gets the transformation for the given values.

Definition at line 863 of file Math.hpp.

◆ GetTransformation() [3/5]

Transformation playrho::d2::GetTransformation ( const Sweep sweep,
const Real  beta 
)
inlinenoexcept

Gets the interpolated transform at a specific time.

Parameters
sweepSweep data to get the transform from.
betaTime factor in [0,1], where 0 indicates alpha 0.
Returns
Transformation of the given sweep at the specified time.

Definition at line 874 of file Math.hpp.

◆ GetTransform0()

Transformation playrho::d2::GetTransform0 ( const Sweep sweep)
inlinenoexcept

Gets the transform at "time" zero.

Note
This is like calling GetTransformation(sweep, 0), except more efficiently.
See also
GetTransformation(const Sweep& sweep, Real beta).
Parameters
sweepSweep data to get the transform from.
Returns
Transformation of the given sweep at time zero.

Definition at line 886 of file Math.hpp.

◆ GetTransform1()

Transformation playrho::d2::GetTransform1 ( const Sweep sweep)
inlinenoexcept

Gets the transform at "time" one.

Note
This is like calling GetTransformation(sweep, 1.0), except more efficiently.
See also
GetTransformation(const Sweep& sweep, Real beta).
Parameters
sweepSweep data to get the transform from.
Returns
Transformation of the given sweep at time one.

Definition at line 896 of file Math.hpp.

◆ IsUnderActive()

bool playrho::d2::IsUnderActive ( Velocity  velocity,
LinearVelocity  linSleepTol,
AngularVelocity  angSleepTol 
)
inlinenoexcept

Gets whether the given velocity is "under active" based on the given tolerances.

Definition at line 908 of file Math.hpp.

◆ GetReflectionMatrix()

PLAYRHO_CONSTEXPR auto playrho::d2::GetReflectionMatrix ( UnitVec  axis)
inline

Gets the reflection matrix for the given unit vector that defines the normal of the line through the origin that points should be reflected against.

See also
https://en.wikipedia.org/wiki/Transformation_matrix

Definition at line 919 of file Math.hpp.

◆ operator==() [11/14]

PLAYRHO_CONSTEXPR bool operator== ( const Position lhs,
const Position rhs 
)
inline

Equality operator.

Definition at line 44 of file Position.hpp.

◆ operator!=() [11/14]

PLAYRHO_CONSTEXPR bool operator!= ( const Position lhs,
const Position rhs 
)
inline

Inequality operator.

Definition at line 51 of file Position.hpp.

◆ operator-() [3/7]

PLAYRHO_CONSTEXPR Position operator- ( const Position value)
inline

Negation operator.

Definition at line 58 of file Position.hpp.

◆ operator+() [3/7]

PLAYRHO_CONSTEXPR Position operator+ ( const Position value)
inline

Positive operator.

Definition at line 65 of file Position.hpp.

◆ operator+=() [2/3]

PLAYRHO_CONSTEXPR Position & operator+= ( Position lhs,
const Position rhs 
)
inline

Addition assignment operator.

Definition at line 72 of file Position.hpp.

◆ operator+() [4/7]

PLAYRHO_CONSTEXPR Position operator+ ( const Position lhs,
const Position rhs 
)
inline

Addition operator.

Definition at line 81 of file Position.hpp.

◆ operator-=() [2/3]

PLAYRHO_CONSTEXPR Position & operator-= ( Position lhs,
const Position rhs 
)
inline

Subtraction assignment operator.

Definition at line 88 of file Position.hpp.

◆ operator-() [4/7]

PLAYRHO_CONSTEXPR Position operator- ( const Position lhs,
const Position rhs 
)
inline

Subtraction operator.

Definition at line 97 of file Position.hpp.

◆ operator*() [7/10]

PLAYRHO_CONSTEXPR Position playrho::d2::operator* ( const Position pos,
const Real  scalar 
)
inline

Multiplication operator.

Definition at line 103 of file Position.hpp.

◆ operator*() [8/10]

PLAYRHO_CONSTEXPR Position operator* ( const Real  scalar,
const Position pos 
)
inline

Multiplication operator.

Definition at line 110 of file Position.hpp.

◆ GetPosition() [1/2]

PLAYRHO_CONSTEXPR Position GetPosition ( const Position  pos0,
const Position  pos1,
const Real  beta 
)
inlinenoexcept

Gets the position between two positions at a given unit interval.

Parameters
pos0Position at unit interval value of 0.
pos1Position at unit interval value of 1.
betaUnit interval (value between 0 and 1) of travel between position 0 and position 1.
Returns
position 0 if pos0 == pos1 or beta == 0, position 1 if beta == 1, or at the given unit interval value between position 0 and position 1.

Definition at line 137 of file Position.hpp.

◆ operator==() [12/14]

PLAYRHO_CONSTEXPR bool operator== ( Transformation  lhs,
Transformation  rhs 
)
inlinenoexcept

Equality operator.

Definition at line 54 of file Transformation.hpp.

◆ operator!=() [12/14]

PLAYRHO_CONSTEXPR bool operator!= ( Transformation  lhs,
Transformation  rhs 
)
inlinenoexcept

Inequality operator.

Definition at line 61 of file Transformation.hpp.

◆ GetXAxis()

PLAYRHO_CONSTEXPR UnitVec playrho::d2::GetXAxis ( UnitVec  rot)
inlinenoexcept

Gets the "X-axis".

Definition at line 306 of file UnitVec.hpp.

◆ GetYAxis()

PLAYRHO_CONSTEXPR UnitVec playrho::d2::GetYAxis ( UnitVec  rot)
inlinenoexcept

Gets the "Y-axis".

Note
This is the reverse perpendicular vector of the given unit vector.

Definition at line 310 of file UnitVec.hpp.

◆ operator==() [13/14]

PLAYRHO_CONSTEXPR bool playrho::d2::operator== ( const UnitVec  a,
const UnitVec  b 
)
inlinenoexcept

Equality operator.

Definition at line 313 of file UnitVec.hpp.

◆ operator!=() [13/14]

PLAYRHO_CONSTEXPR bool playrho::d2::operator!= ( const UnitVec  a,
const UnitVec  b 
)
inlinenoexcept

Inequality operator.

Definition at line 319 of file UnitVec.hpp.

◆ GetRevPerpendicular()

PLAYRHO_CONSTEXPR UnitVec playrho::d2::GetRevPerpendicular ( const UnitVec  vector)
inlinenoexcept

Gets a vector counter-clockwise (reverse-clockwise) perpendicular to the given vector.

This takes a vector of form (x, y) and returns the vector (-y, x).

Parameters
vectorVector to return a counter-clockwise perpendicular equivalent for.
Returns
A counter-clockwise 90-degree rotation of the given vector.
See also
GetFwdPerpendicular.

Definition at line 330 of file UnitVec.hpp.

◆ GetFwdPerpendicular()

PLAYRHO_CONSTEXPR UnitVec playrho::d2::GetFwdPerpendicular ( const UnitVec  vector)
inlinenoexcept

Gets a vector clockwise (forward-clockwise) perpendicular to the given vector.

This takes a vector of form (x, y) and returns the vector (y, -x).

Parameters
vectorVector to return a clockwise perpendicular equivalent for.
Returns
A clockwise 90-degree rotation of the given vector.
See also
GetRevPerpendicular.

Definition at line 340 of file UnitVec.hpp.

◆ Rotate() [2/2]

PLAYRHO_CONSTEXPR UnitVec playrho::d2::Rotate ( const UnitVec  vector,
const UnitVec angle 
)
inlinenoexcept

Rotates a unit vector by the angle expressed by the second unit vector.

Returns
Unit vector for the angle that's the sum of the two angles expressed by the input unit vectors.

Definition at line 348 of file UnitVec.hpp.

◆ InverseRotate() [2/2]

PLAYRHO_CONSTEXPR UnitVec playrho::d2::InverseRotate ( const UnitVec  vector,
const UnitVec angle 
)
inlinenoexcept

Inverse rotates a vector.

Definition at line 354 of file UnitVec.hpp.

◆ get()

template<std::size_t I>
PLAYRHO_CONSTEXPR UnitVec::value_type playrho::d2::get ( UnitVec  v)
inlinenoexcept

Gets the specified element of the given collection.

Definition at line 361 of file UnitVec.hpp.

◆ get< 0 >()

template<>
PLAYRHO_CONSTEXPR UnitVec::value_type playrho::d2::get< 0 > ( UnitVec  v)
inlinenoexcept

Gets element 0 of the given collection.

Definition at line 373 of file UnitVec.hpp.

◆ get< 1 >()

template<>
PLAYRHO_CONSTEXPR UnitVec::value_type playrho::d2::get< 1 > ( UnitVec  v)
inlinenoexcept

Gets element 1 of the given collection.

Definition at line 380 of file UnitVec.hpp.

◆ operator<<()

inline ::std::ostream& playrho::d2::operator<< ( ::std::ostream &  os,
const UnitVec value 
)

Output stream operator.

Definition at line 386 of file UnitVec.hpp.

◆ CalcWarmStartVelocityDeltas()

VelocityPair playrho::d2::CalcWarmStartVelocityDeltas ( const VelocityConstraint vc)

Calculates the "warm start" velocity deltas for the given velocity constraint.

Definition at line 28 of file Velocity.cpp.

◆ operator==() [14/14]

PLAYRHO_CONSTEXPR bool operator== ( const Velocity lhs,
const Velocity rhs 
)
inline

Equality operator.

Definition at line 43 of file Velocity.hpp.

◆ operator!=() [14/14]

PLAYRHO_CONSTEXPR bool operator!= ( const Velocity lhs,
const Velocity rhs 
)
inline

Inequality operator.

Definition at line 50 of file Velocity.hpp.

◆ operator*=() [2/2]

PLAYRHO_CONSTEXPR Velocity & operator*= ( Velocity lhs,
const Real  rhs 
)
inline

Multiplication assignment operator.

Definition at line 57 of file Velocity.hpp.

◆ operator/=() [2/2]

PLAYRHO_CONSTEXPR Velocity & operator/= ( Velocity lhs,
const Real  rhs 
)
inline

Division assignment operator.

Definition at line 66 of file Velocity.hpp.

◆ operator+=() [3/3]

PLAYRHO_CONSTEXPR Velocity & operator+= ( Velocity lhs,
const Velocity rhs 
)
inline

Addition assignment operator.

Definition at line 75 of file Velocity.hpp.

◆ operator+() [5/7]

PLAYRHO_CONSTEXPR Velocity operator+ ( const Velocity lhs,
const Velocity rhs 
)
inline

Addition operator.

Definition at line 84 of file Velocity.hpp.

◆ operator-=() [3/3]

PLAYRHO_CONSTEXPR Velocity & operator-= ( Velocity lhs,
const Velocity rhs 
)
inline

Subtraction assignment operator.

Definition at line 91 of file Velocity.hpp.

◆ operator-() [5/7]

PLAYRHO_CONSTEXPR Velocity operator- ( const Velocity lhs,
const Velocity rhs 
)
inline

Subtraction operator.

Definition at line 100 of file Velocity.hpp.

◆ operator-() [6/7]

PLAYRHO_CONSTEXPR Velocity operator- ( const Velocity value)
inline

Negation operator.

Definition at line 107 of file Velocity.hpp.

◆ operator+() [6/7]

PLAYRHO_CONSTEXPR Velocity operator+ ( const Velocity value)
inline

Positive operator.

Definition at line 114 of file Velocity.hpp.

◆ operator*() [9/10]

PLAYRHO_CONSTEXPR Velocity operator* ( const Velocity lhs,
const Real  rhs 
)
inline

Multiplication operator.

Definition at line 121 of file Velocity.hpp.

◆ operator*() [10/10]

PLAYRHO_CONSTEXPR Velocity operator* ( const Real  lhs,
const Velocity rhs 
)
inline

Multiplication operator.

Definition at line 128 of file Velocity.hpp.

◆ operator/() [3/3]

PLAYRHO_CONSTEXPR Velocity operator/ ( const Velocity lhs,
const Real  rhs 
)
inline

Division operator.

Definition at line 135 of file Velocity.hpp.

◆ ShouldCollide() [1/2]

bool ShouldCollide ( const Body lhs,
const Body rhs 
)
noexcept

Should collide.

Determines whether a body should possibly be able to collide with the other body.

Returns
true if either body is dynamic and no joint prevents collision, false otherwise.

Definition at line 424 of file Body.cpp.

◆ GetWorldIndex() [1/2]

BodyCounter GetWorldIndex ( const Body body)
noexcept

Gets the world index for the given body.

Definition at line 440 of file Body.cpp.

◆ GetVelocity()

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 by the given configuration.

Warning
Behavior is undefined if the given elapsed time is an invalid value (like NaN).
Parameters
bodyBody to get the velocity for.
hTime elapsed to get velocity for. Behavior is undefined if this value is invalid.

Definition at line 458 of file Body.cpp.

◆ Cap()

Velocity Cap ( Velocity  velocity,
Time  h,
MovementConf  conf 
)
noexcept

Caps velocity.

Enforces maximums on the given velocity.

Parameters
velocityVelocity to cap. Behavior is undefined if this value is invalid.
hTime elapsed to get velocity for. Behavior is undefined if this value is invalid.
confMovement configuration. This defines caps on linear and angular speeds.

Definition at line 482 of file Body.cpp.

◆ GetFixtureCount() [1/2]

std::size_t GetFixtureCount ( const Body body)
noexcept

Gets the fixture count of the given body.

Examples
Body.cpp.

Definition at line 504 of file Body.cpp.

◆ RotateAboutWorldPoint()

void RotateAboutWorldPoint ( Body body,
Angle  amount,
Length2  worldPoint 
)

Rotates a body a given amount around a point in world coordinates.

This changes both the linear and angular positions of the body.

Note
Manipulating a body's position this way may cause non-physical behavior.
Parameters
bodyBody to rotate.
amountAmount to rotate body by (in counter-clockwise direction).
worldPointPoint in world coordinates.

Definition at line 510 of file Body.cpp.

◆ RotateAboutLocalPoint()

void RotateAboutLocalPoint ( Body body,
Angle  amount,
Length2  localPoint 
)

Rotates a body a given amount around a point in body local coordinates.

This changes both the linear and angular positions of the body.

Note
Manipulating a body's position this way may cause non-physical behavior.
This is a convenience function that translates the local point into world coordinates and then calls the RotateAboutWorldPoint function.
Parameters
bodyBody to rotate.
amountAmount to rotate body by (in counter-clockwise direction).
localPointPoint in local coordinates.

Definition at line 523 of file Body.cpp.

◆ GetCentripetalForce()

Force2 GetCentripetalForce ( const Body body,
Length2  axis 
)

Gets the centripetal force necessary to put the body into an orbit having the given radius.

Definition at line 528 of file Body.cpp.

◆ CalcGravitationalAcceleration()

Acceleration CalcGravitationalAcceleration ( const Body body)
noexcept

Calculates the gravitationally associated acceleration for the given body within its world.

Returns
Zero acceleration if given body is has no mass, else the acceleration of the body due to the gravitational attraction to the other bodies.

Definition at line 544 of file Body.cpp.

◆ GetAcceleration()

Acceleration GetAcceleration ( const Body body)
inlinenoexcept

Gets the given body's acceleration.

Parameters
bodyBody whose acceleration should be returned.

Definition at line 892 of file Body.hpp.

◆ SetAcceleration()

void SetAcceleration ( Body body,
Acceleration  value 
)
inlinenoexcept

Sets the accelerations on the given body.

Note
This has no effect on non-accelerable bodies.
A non-zero acceleration will also awaken the body.
Parameters
bodyBody whose acceleration should be set.
valueAcceleration value to set.

Definition at line 903 of file Body.hpp.

◆ Awaken() [1/2]

bool Awaken ( Body body)
inlinenoexcept

Awakens the body if it's asleep.

Examples
Body.cpp.

Definition at line 917 of file Body.hpp.

◆ Unawaken()

bool Unawaken ( Body body)
inlinenoexcept

Puts the body to sleep if it's awake.

Definition at line 929 of file Body.hpp.

◆ GetPosition1()

Position GetPosition1 ( const Body body)
inlinenoexcept

Gets the "position 1" Position information for the given body.

Definition at line 947 of file Body.hpp.

◆ GetMass()

Mass GetMass ( const Body body)
inlinenoexcept

Gets the mass of the body.

Note
This may be the total calculated mass or it may be the set mass of the body.
Returns
Value of zero or more representing the body's mass.
See also
GetInvMass, SetMassData

Definition at line 957 of file Body.hpp.

◆ SetLinearAcceleration()

void SetLinearAcceleration ( Body body,
LinearAcceleration2  value 
)
inlinenoexcept

Sets the given linear acceleration of the given body.

Definition at line 965 of file Body.hpp.

◆ SetAngularAcceleration()

void SetAngularAcceleration ( Body body,
AngularAcceleration  value 
)
inlinenoexcept

Sets the given angular acceleration of the given body.

Definition at line 972 of file Body.hpp.

◆ ApplyLinearAcceleration()

void ApplyLinearAcceleration ( Body body,
LinearAcceleration2  amount 
)
inline

Applies the given linear acceleration to the given body.

Definition at line 979 of file Body.hpp.

◆ SetForce()

void SetForce ( Body body,
Force2  force,
Length2  point 
)
inlinenoexcept

Sets the given amount of force at the given point to the given body.

Definition at line 986 of file Body.hpp.

◆ ApplyForce()

void ApplyForce ( Body body,
Force2  force,
Length2  point 
)
inlinenoexcept

Apply a force at a world point.

Note
If the force is not applied at the center of mass, it will generate a torque and affect the angular velocity.
Non-zero forces wakes up the body.
Parameters
bodyBody to apply the force to.
forceWorld force vector.
pointWorld position of the point of application.

Definition at line 1004 of file Body.hpp.

◆ ApplyForceToCenter()

void ApplyForceToCenter ( Body body,
Force2  force 
)
inlinenoexcept

Apply a force to the center of mass.

Note
Non-zero forces wakes up the body.
Parameters
bodyBody to apply the force to.
forceWorld force vector.

Definition at line 1022 of file Body.hpp.

◆ SetTorque()

void SetTorque ( Body body,
Torque  torque 
)
inlinenoexcept

Sets the given amount of torque to the given body.

Definition at line 1031 of file Body.hpp.

◆ ApplyTorque()

void ApplyTorque ( Body body,
Torque  torque 
)
inlinenoexcept

Applies a torque.

Note
This affects the angular velocity without affecting the linear velocity of the center of mass.
Non-zero forces wakes up the body.
Parameters
bodyBody to apply the torque to.
torqueabout the z-axis (out of the screen).

Definition at line 1046 of file Body.hpp.

◆ ApplyLinearImpulse()

void ApplyLinearImpulse ( Body body,
Momentum2  impulse,
Length2  point 
)
inlinenoexcept

Applies an impulse at a point.

Note
This immediately modifies the velocity.
This also modifies the angular velocity if the point of application is not at the center of mass.
Non-zero impulses wakes up the body.
Parameters
bodyBody to apply the impulse to.
impulsethe world impulse vector.
pointthe world position of the point of application.

Definition at line 1063 of file Body.hpp.

◆ ApplyAngularImpulse()

void ApplyAngularImpulse ( Body body,
AngularMomentum  impulse 
)
inlinenoexcept

Applies an angular impulse.

Parameters
bodyBody to apply the angular impulse to.
impulseAngular impulse to be applied.

Definition at line 1077 of file Body.hpp.

◆ GetRotInertia()

RotInertia GetRotInertia ( const Body body)
inlinenoexcept

Gets the rotational inertia of the body.

Parameters
bodyBody to get the rotational inertia for.
Returns
the rotational inertia.

Definition at line 1094 of file Body.hpp.

◆ GetLocalRotInertia()

RotInertia GetLocalRotInertia ( const Body body)
inlinenoexcept

Gets the rotational inertia of the body about the local origin.

Returns
the rotational inertia.

Definition at line 1102 of file Body.hpp.

◆ GetLinearVelocity() [1/2]

LinearVelocity2 GetLinearVelocity ( const Body body)
inlinenoexcept

Gets the linear velocity of the center of mass.

Parameters
bodyBody to get the linear velocity for.
Returns
the linear velocity of the center of mass.

Definition at line 1112 of file Body.hpp.

◆ GetAngularVelocity() [1/3]

AngularVelocity GetAngularVelocity ( const Body body)
inlinenoexcept

Gets the angular velocity.

Parameters
bodyBody to get the angular velocity for.
Returns
the angular velocity.

Definition at line 1121 of file Body.hpp.

◆ SetLinearVelocity()

void SetLinearVelocity ( Body body,
const LinearVelocity2  v 
)
inlinenoexcept

Sets the linear velocity of the center of mass.

Parameters
bodyBody to set the linear velocity of.
vthe new linear velocity of the center of mass.

Definition at line 1130 of file Body.hpp.

◆ SetAngularVelocity()

void SetAngularVelocity ( Body body,
AngularVelocity  omega 
)
inlinenoexcept

Sets the angular velocity.

Parameters
bodyBody to set the angular velocity of.
omegathe new angular velocity.

Definition at line 1139 of file Body.hpp.

◆ GetWorldPoint()

Length2 GetWorldPoint ( const Body body,
const Length2  localPoint 
)
inlinenoexcept

Gets the world coordinates of a point given in coordinates relative to the body's origin.

Parameters
bodyBody that the given point is relative to.
localPointa point measured relative the the body's origin.
Returns
the same point expressed in world coordinates.

Definition at line 1149 of file Body.hpp.

◆ GetWorldVector() [1/2]

Length2 GetWorldVector ( const Body body,
const Length2  localVector 
)
inlinenoexcept

Gets the world coordinates of a vector given the local coordinates.

Parameters
bodyBody that the given vector is relative to.
localVectora vector fixed in the body.
Returns
the same vector expressed in world coordinates.

Definition at line 1159 of file Body.hpp.

◆ GetWorldVector() [2/2]

UnitVec GetWorldVector ( const Body body,
const UnitVec  localVector 
)
inlinenoexcept

Gets the world vector for the given local vector from the given body's transformation.

Definition at line 1166 of file Body.hpp.

◆ GetLocalPoint()

Length2 GetLocalPoint ( const Body body,
const Length2  worldPoint 
)
inlinenoexcept

Gets a local point relative to the body's origin given a world point.

Parameters
bodyBody that the returned point should be relative to.
worldPointpoint in world coordinates.
Returns
the corresponding local point relative to the body's origin.

Definition at line 1176 of file Body.hpp.

◆ GetLocalVector()

UnitVec GetLocalVector ( const Body body,
const UnitVec  uv 
)
inlinenoexcept

Gets a locally oriented unit vector given a world oriented unit vector.

Parameters
bodyBody that the returned vector should be relative to.
uvUnit vector in world orientation.
Returns
the corresponding local vector.

Definition at line 1186 of file Body.hpp.

◆ GetLinearVelocityFromWorldPoint()

LinearVelocity2 GetLinearVelocityFromWorldPoint ( const Body body,
const Length2  worldPoint 
)
inlinenoexcept

Gets the linear velocity from a world point attached to this body.

Parameters
bodyBody to get the linear velocity for.
worldPointpoint in world coordinates.
Returns
the world velocity of a point.

Definition at line 1196 of file Body.hpp.

◆ GetLinearVelocityFromLocalPoint()

LinearVelocity2 GetLinearVelocityFromLocalPoint ( const Body body,
const Length2  localPoint 
)
inlinenoexcept

Gets the linear velocity from a local point.

Parameters
bodyBody to get the linear velocity for.
localPointpoint in local coordinates.
Returns
the world velocity of a point.

Definition at line 1211 of file Body.hpp.

◆ GetForce()

Force2 GetForce ( const Body body)
inlinenoexcept

Gets the net force that the given body is currently experiencing.

Definition at line 1219 of file Body.hpp.

◆ GetTorque()

Torque GetTorque ( const Body body)
inlinenoexcept

Gets the net torque that the given body is currently experiencing.

Definition at line 1226 of file Body.hpp.

◆ GetLocation()

Length2 GetLocation ( const Body body)
inlinenoexcept

Gets the body's origin location.

This is the location of the body's origin relative to its world. The location of the body after stepping the world's physics simulations is dependent on a number of factors:

  1. Location at the last time step.
  2. Forces acting on the body (gravity, applied force, applied impulse).
  3. The mass data of the body.
  4. Damping of the body.
  5. Restitution and friction values of the body's fixtures when they experience collisions.
    Returns
    World location of the body's origin.
    See also
    GetAngle.

Definition at line 1287 of file Body.hpp.

◆ GetAngle() [2/2]

Angle GetAngle ( const Body body)
inlinenoexcept

Gets the body's angle.

Returns
Body's angle relative to its World.

Definition at line 1295 of file Body.hpp.

◆ GetTransformation() [4/5]

Transformation playrho::d2::GetTransformation ( const Body body)
inlinenoexcept

Gets the body's transformation.

Definition at line 1301 of file Body.hpp.

◆ SetTransformation()

void playrho::d2::SetTransformation ( Body body,
const Transformation xfm 
)
inlinenoexcept

Sets the body's transformation.

Note
This operation isn't exact. I.e. don't expect that GetTransformation will return exactly the transformation that had been set.
Examples
Body.cpp.

Definition at line 1309 of file Body.hpp.

◆ GetPosition() [2/2]

Position playrho::d2::GetPosition ( const Body body)
inlinenoexcept

Gets the body's position.

Definition at line 1315 of file Body.hpp.

◆ SetLocation()

void SetLocation ( Body body,
Length2  value 
)
inlinenoexcept

Sets the body's location.

This instantly adjusts the body to be at the new location.

Warning
Manipulating a body's location this way can cause non-physical behavior!
Parameters
bodyBody to move.
valueValid world location of the body's local origin. Behavior is undefined if value is invalid.
See also
Body::SetTransform

Definition at line 1328 of file Body.hpp.

◆ SetAngle()

void SetAngle ( Body body,
Angle  value 
)
inlinenoexcept

Sets the body's angular orientation.

This instantly adjusts the body to be at the new angular orientation.

Warning
Manipulating a body's angle this way can cause non-physical behavior!
Parameters
bodyBody to move.
valueValid world angle of the body's local origin. Behavior is undefined if value is invalid.
See also
Body::SetTransform

Definition at line 1341 of file Body.hpp.

◆ GetBodyConf()

BodyConf GetBodyConf ( const Body body)
noexcept

Gets the body definition for the given body.

Parameters
bodyBody to get the BodyConf for.

Definition at line 28 of file BodyConf.cpp.

◆ GetDefaultBodyConf()

PLAYRHO_CONSTEXPR BodyConf GetDefaultBodyConf ( )
inlinenoexcept

Gets the default body definition.

Definition at line 283 of file BodyConf.hpp.

◆ GetContactImpulses()

ContactImpulsesList playrho::d2::GetContactImpulses ( const VelocityConstraint vc)

Gets the contact impulses for the given velocity constraint.

Definition at line 28 of file ContactImpulsesList.cpp.

◆ GetMaxNormalImpulse()

Momentum GetMaxNormalImpulse ( const ContactImpulsesList impulses)
inlinenoexcept

Gets the maximum normal impulse from the given contact impulses list.

Definition at line 70 of file ContactImpulsesList.hpp.

◆ GetBodyConstraint()

BodyConstraint playrho::d2::GetBodyConstraint ( const Body body,
Time  time,
MovementConf  conf 
)
inlinenoexcept

Gets the BodyConstraint based on the given parameters.

Definition at line 140 of file BodyConstraint.hpp.

◆ GetBodyA()

Body * GetBodyA ( const Contact contact)
noexcept

Gets the body A associated with the given contact.

Definition at line 227 of file Contact.cpp.

◆ GetBodyB()

Body * GetBodyB ( const Contact contact)
noexcept

Gets the body B associated with the given contact.

Definition at line 232 of file Contact.cpp.

◆ HasSensor()

bool HasSensor ( const Contact contact)
noexcept

Whether the given contact has a sensor.

Definition at line 237 of file Contact.cpp.

◆ IsImpenetrable()

bool IsImpenetrable ( const Contact contact)
noexcept

Whether the given contact is "impenetrable".

Definition at line 242 of file Contact.cpp.

◆ IsActive()

bool IsActive ( const Contact contact)
noexcept

Determines whether the given contact is "active".

Definition at line 249 of file Contact.cpp.

◆ SetAwake() [1/3]

void SetAwake ( const Contact c)
noexcept

Sets awake the fixtures of the given contact.

Examples
Contact.cpp.

Definition at line 264 of file Contact.cpp.

◆ ResetFriction()

void ResetFriction ( Contact contact)

Resets the friction mixture to the default value.

Resets the friction mixture to the default value.

Examples
Contact.cpp.

Definition at line 271 of file Contact.cpp.

◆ ResetRestitution()

void ResetRestitution ( Contact contact)
noexcept

Reset the restitution to the default value.

Reset the restitution to the default value.

Examples
Contact.cpp.

Definition at line 277 of file Contact.cpp.

◆ CalcToi()

TOIOutput CalcToi ( const Contact contact,
ToiConf  conf 
)

Calculates the Time Of Impact for the given contact with the given configuration.

Definition at line 284 of file Contact.cpp.

◆ GetFixtureA()

Fixture * GetFixtureA ( const Contact contact)
inlinenoexcept

Gets the fixture A associated with the given contact.

Definition at line 541 of file Contact.hpp.

◆ GetFixtureB()

Fixture * GetFixtureB ( const Contact contact)
inlinenoexcept

Gets the fixture B associated with the given contact.

Definition at line 548 of file Contact.hpp.

◆ GetChildIndexA()

ChildCounter GetChildIndexA ( const Contact contact)
inlinenoexcept

Gets the child index A of the given contact.

Definition at line 555 of file Contact.hpp.

◆ GetChildIndexB()

ChildCounter GetChildIndexB ( const Contact contact)
inlinenoexcept

Gets the child index B of the given contact.

Definition at line 562 of file Contact.hpp.

◆ GetContactKey() [1/2]

ContactKey playrho::d2::GetContactKey ( const Fixture fixtureA,
ChildCounter  childIndexA,
const Fixture fixtureB,
ChildCounter  childIndexB 
)
noexcept

Gets the ContactKey for the given parameters.

Definition at line 31 of file ContactKey.cpp.

◆ GetContactKey() [2/2]

ContactKey playrho::d2::GetContactKey ( const Contact contact)
noexcept

Gets the ContactKey for the given contact.

Definition at line 38 of file ContactKey.cpp.

◆ GetContactPtr()

Contact* playrho::d2::GetContactPtr ( KeyedContactPtr  value)
inline

Gets the contact pointer for the given value.

Definition at line 128 of file ContactKey.hpp.

◆ operator+() [7/7]

PositionSolution playrho::d2::operator+ ( PositionSolution  lhs,
PositionSolution  rhs 
)
inline

Addition operator.

Definition at line 44 of file ContactSolver.hpp.

◆ operator-() [7/7]

PositionSolution playrho::d2::operator- ( PositionSolution  lhs,
PositionSolution  rhs 
)
inline

Subtraction operator.

Definition at line 54 of file ContactSolver.hpp.

◆ GetPSM()

PositionSolverManifold playrho::d2::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.

Note
The returned normal is in the direction of shape A to shape B.
The returned separation distance does not account for vertex radiuses. It's simply the separation between the points of the manifold. To account for the vertex radiuses, the total vertex radius must be subtracted from this separation distance.

Definition at line 87 of file PositionSolverManifold.cpp.

◆ GetRegVelocityConstraintConf()

VelocityConstraint::Conf playrho::d2::GetRegVelocityConstraintConf ( const StepConf conf)
noexcept

Gets the regular phase velocity constraint configuration from the given step configuration.

Definition at line 187 of file VelocityConstraint.cpp.

◆ GetToiVelocityConstraintConf()

VelocityConstraint::Conf playrho::d2::GetToiVelocityConstraintConf ( const StepConf conf)
noexcept

Gets the TOI phase velocity constraint configuration from the given step configuration.

Definition at line 196 of file VelocityConstraint.cpp.

◆ GetNormal()

UnitVec playrho::d2::GetNormal ( const VelocityConstraint vc)
inlinenoexcept

Gets the normal of the velocity constraint contact in world coordinates.

Note
This value is set via the velocity constraint's SetNormal method.
Returns
Contact normal (in world coordinates) if previously set, an invalid value otherwise.

Definition at line 376 of file VelocityConstraint.hpp.

◆ GetTangent()

UnitVec playrho::d2::GetTangent ( const VelocityConstraint vc)
inlinenoexcept

Gets the tangent from the given velocity constraint data.

Definition at line 382 of file VelocityConstraint.hpp.

◆ GetInvMass()

InvMass playrho::d2::GetInvMass ( const VelocityConstraint vc)
inlinenoexcept

Gets the inverse mass from the given velocity constraint data.

Definition at line 388 of file VelocityConstraint.hpp.

◆ GetPointRelPosA()

Length2 playrho::d2::GetPointRelPosA ( const VelocityConstraint vc,
VelocityConstraint::size_type  index 
)
inline

Gets the point relative position A data.

Definition at line 394 of file VelocityConstraint.hpp.

◆ GetPointRelPosB()

Length2 playrho::d2::GetPointRelPosB ( const VelocityConstraint vc,
VelocityConstraint::size_type  index 
)
inline

Gets the point relative position B data.

Definition at line 401 of file VelocityConstraint.hpp.

◆ GetVelocityBiasAtPoint()

LinearVelocity playrho::d2::GetVelocityBiasAtPoint ( const VelocityConstraint vc,
VelocityConstraint::size_type  index 
)
inline

Gets the velocity bias at the given point from the given velocity constraint.

Definition at line 408 of file VelocityConstraint.hpp.

◆ GetNormalMassAtPoint()

Mass playrho::d2::GetNormalMassAtPoint ( const VelocityConstraint vc,
VelocityConstraint::size_type  index 
)
inline

Gets the normal mass at the given point from the given velocity constraint.

Definition at line 414 of file VelocityConstraint.hpp.

◆ GetTangentMassAtPoint()

Mass playrho::d2::GetTangentMassAtPoint ( const VelocityConstraint vc,
VelocityConstraint::size_type  index 
)
inline

Gets the tangent mass at the given point from the given velocity constraint.

Definition at line 421 of file VelocityConstraint.hpp.

◆ GetNormalImpulseAtPoint()

Momentum playrho::d2::GetNormalImpulseAtPoint ( const VelocityConstraint vc,
VelocityConstraint::size_type  index 
)
inline

Gets the normal impulse at the given point from the given velocity constraint.

Definition at line 428 of file VelocityConstraint.hpp.

◆ GetTangentImpulseAtPoint()

Momentum playrho::d2::GetTangentImpulseAtPoint ( const VelocityConstraint vc,
VelocityConstraint::size_type  index 
)
inline

Gets the tangent impulse at the given point from the given velocity constraint.

Definition at line 435 of file VelocityConstraint.hpp.

◆ GetNormalImpulses()

Momentum2 playrho::d2::GetNormalImpulses ( const VelocityConstraint vc)
inline

Gets the normal impulses of the given velocity constraint.

Definition at line 442 of file VelocityConstraint.hpp.

◆ GetTangentImpulses()

Momentum2 playrho::d2::GetTangentImpulses ( const VelocityConstraint vc)
inline

Gets the tangent impulses of the given velocity constraint.

Definition at line 448 of file VelocityConstraint.hpp.

◆ SetNormalImpulseAtPoint()

void playrho::d2::SetNormalImpulseAtPoint ( VelocityConstraint vc,
VelocityConstraint::size_type  index,
Momentum  value 
)
inline

Sets the normal impulse at the given point of the given velocity constraint.

Definition at line 454 of file VelocityConstraint.hpp.

◆ SetTangentImpulseAtPoint()

void playrho::d2::SetTangentImpulseAtPoint ( VelocityConstraint vc,
VelocityConstraint::size_type  index,
Momentum  value 
)
inline

Sets the tangent impulse at the given point of the given velocity constraint.

Definition at line 460 of file VelocityConstraint.hpp.

◆ SetNormalImpulses()

void playrho::d2::SetNormalImpulses ( VelocityConstraint vc,
const Momentum2  impulses 
)
inline

Sets the normal impulses of the given velocity constraint.

Definition at line 466 of file VelocityConstraint.hpp.

◆ SetTangentImpulses()

void playrho::d2::SetTangentImpulses ( VelocityConstraint vc,
const Momentum2  impulses 
)
inline

Sets the tangent impulses of the given velocity constraint.

Definition at line 473 of file VelocityConstraint.hpp.

◆ SetAwake() [2/3]

void SetAwake ( const Fixture f)
noexcept

Sets the associated body's sleep status to awake.

Note
This is a convenience function that simply looks up the fixture's body and calls that body' SetAwake method.
Parameters
fFixture whose body should be awoken.

Definition at line 85 of file Fixture.cpp.

◆ GetTransformation() [5/5]

Transformation GetTransformation ( const Fixture f)
noexcept

Gets the transformation associated with the given fixture.

Warning
Behavior is undefined if the fixture doesn't have an associated body - i.e. behavior is undefined if the fixture has nullptr as its associated body.

Definition at line 90 of file Fixture.cpp.

◆ ShouldCollide() [2/2]

bool ShouldCollide ( const Fixture fixtureA,
const Fixture fixtureB 
)
inlinenoexcept

Whether contact calculations should be performed between the two fixtures.

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

Definition at line 319 of file Fixture.hpp.

◆ GetFixtureConf()

FixtureConf GetFixtureConf ( const Fixture fixture)
noexcept

Gets the fixture definition for the given fixture.

Parameters
fixtureFixture to get the definition for.

Definition at line 28 of file FixtureConf.cpp.

◆ GetDefaultFixtureConf()

PLAYRHO_CONSTEXPR FixtureConf GetDefaultFixtureConf ( )
inlinenoexcept

Gets the default fixture definition.

Definition at line 83 of file FixtureConf.hpp.

◆ Count() [1/3]

std::size_t Count ( const Island island,
const Body entry 
)

Counts the number of occurrences of the given entry in the given island.

Definition at line 138 of file Island.cpp.

◆ Count() [2/3]

std::size_t Count ( const Island island,
const Contact entry 
)

Counts the number of occurrences of the given entry in the given island.

Definition at line 143 of file Island.cpp.

◆ Count() [3/3]

std::size_t Count ( const Island island,
const Joint entry 
)

Counts the number of occurrences of the given entry in the given island.

Definition at line 148 of file Island.cpp.

◆ IsFullOfBodies()

bool IsFullOfBodies ( const Island island)
inline

Determines whether the given island is full of bodies.

Definition at line 74 of file Island.hpp.

◆ IsFullOfContacts()

bool IsFullOfContacts ( const Island island)
inline

Determines whether the given island is full of contacts.

Definition at line 81 of file Island.hpp.

◆ GetDistanceJointConf()

DistanceJointConf GetDistanceJointConf ( const DistanceJoint joint)
noexcept

Gets the definition data for the given joint.

Definition at line 39 of file DistanceJointConf.cpp.

◆ GetFrictionJointConf()

FrictionJointConf GetFrictionJointConf ( const FrictionJoint joint)
noexcept

Gets the definition data for the given joint.

Definition at line 36 of file FrictionJointConf.cpp.

◆ GetGearJointConf()

GearJointConf GetGearJointConf ( const GearJoint joint)
noexcept

Gets the definition data for the given joint.

Definition at line 35 of file GearJointConf.cpp.

◆ IsEnabled()

bool IsEnabled ( const Joint j)
noexcept

Short-cut function to determine if both bodies are enabled.

Definition at line 105 of file Joint.cpp.

◆ SetAwake() [3/3]

void SetAwake ( Joint j)
noexcept

Wakes up the joined bodies.

Definition at line 112 of file Joint.cpp.

◆ GetWorldIndex() [2/2]

JointCounter GetWorldIndex ( const Joint joint)

Gets the world index of the given joint.

Definition at line 126 of file Joint.cpp.

◆ At()

BodyConstraintPtr & playrho::d2::At ( std::unordered_map< const Body *, BodyConstraint * > &  container,
const Body key 
)

Provides referenced access to the identified element of the given container.

Definition at line 166 of file Joint.cpp.

◆ ToString() [1/2]

const char * playrho::d2::ToString ( Joint::LimitState  val)
noexcept

Provides a human readable C-style string uniquely identifying the given limit state.

Definition at line 172 of file Joint.cpp.

◆ IncMotorSpeed()

template<class T >
void playrho::d2::IncMotorSpeed ( T &  j,
AngularVelocity  delta 
)
inline

Increment motor speed.

Template function for incrementally changing the motor speed of a joint that has the SetMotorSpeed and GetMotorSpeed methods.

Definition at line 295 of file Joint.hpp.

◆ Set()

void Set ( JointConf def,
const Joint joint 
)
noexcept

Sets the joint definition data for the given joint.

Definition at line 28 of file JointConf.cpp.

◆ GetJointKey()

JointKey playrho::d2::GetJointKey ( const Joint joint)
noexcept

Gets the JointKey for the given joint.

Definition at line 27 of file JointKey.cpp.

◆ Compare()

PLAYRHO_CONSTEXPR int playrho::d2::Compare ( const JointKey lhs,
const JointKey rhs 
)
inlinenoexcept

Compares the given joint keys.

Definition at line 81 of file JointKey.hpp.

◆ IsFor()

PLAYRHO_CONSTEXPR bool IsFor ( const JointKey  key,
const Body body 
)
inlinenoexcept

Determines whether the given key is for the given body.

Definition at line 104 of file JointKey.hpp.

◆ GetJointPtr()

Joint* playrho::d2::GetJointPtr ( std::pair< JointKey, Joint * >  value)
inline

Gets the joint pointer from the given value.

Definition at line 110 of file JointKey.hpp.

◆ GetType()

JointType GetType ( const Joint joint)
noexcept

Gets the type of the given joint.

Examples
World.cpp.

Definition at line 28 of file JointType.cpp.

◆ ToString() [2/2]

const char * playrho::d2::ToString ( JointType  type)
noexcept

Provides a C-style (null-terminated) string name for given joint type.

Returns
C-style English-language human-readable string uniquely identifying the joint type.

Definition at line 35 of file JointType.cpp.

◆ GetMotorJointConf()

MotorJointConf GetMotorJointConf ( const MotorJoint joint)
noexcept

Gets the definition data for the given joint.

Definition at line 37 of file MotorJointConf.cpp.

◆ GetJointTranslation() [1/2]

Length GetJointTranslation ( const PrismaticJoint joint)
noexcept

Get the current joint translation.

Definition at line 608 of file PrismaticJoint.cpp.

◆ GetLinearVelocity() [2/2]

LinearVelocity GetLinearVelocity ( const PrismaticJoint joint)
noexcept

Get the current joint translation speed.

Definition at line 615 of file PrismaticJoint.cpp.

◆ GetMotorForce()

Force GetMotorForce ( const PrismaticJoint joint,
Frequency  inv_dt 
)
inlinenoexcept

Gets the current motor force for the given joint, given the inverse time step.

Definition at line 192 of file PrismaticJoint.hpp.

◆ GetPrismaticJointConf()

PrismaticJointConf GetPrismaticJointConf ( const PrismaticJoint joint)
noexcept

Gets the definition data for the given joint.

Definition at line 40 of file PrismaticJointConf.cpp.

◆ GetCurrentLengthA()

Length GetCurrentLengthA ( const PulleyJoint joint)

Get the current length of the segment attached to body-A.

Definition at line 245 of file PulleyJoint.cpp.

◆ GetCurrentLengthB()

Length GetCurrentLengthB ( const PulleyJoint joint)

Get the current length of the segment attached to body-B.

Definition at line 251 of file PulleyJoint.cpp.

◆ GetPulleyJointConf()

PulleyJointConf GetPulleyJointConf ( const PulleyJoint joint)
noexcept

Gets the definition data for the given joint.

Definition at line 43 of file PulleyJointConf.cpp.

◆ GetJointAngle()

Angle GetJointAngle ( const RevoluteJoint joint)

Gets the current joint angle.

Definition at line 537 of file RevoluteJoint.cpp.

◆ GetAngularVelocity() [2/3]

AngularVelocity GetAngularVelocity ( const RevoluteJoint joint)

Gets the current joint angle speed.

Definition at line 542 of file RevoluteJoint.cpp.

◆ GetMotorTorque() [1/2]

Torque GetMotorTorque ( const RevoluteJoint joint,
Frequency  inv_dt 
)
inlinenoexcept

Gets the current motor torque for the given joint given the inverse time step.

Definition at line 214 of file RevoluteJoint.hpp.

◆ GetRevoluteJointConf()

RevoluteJointConf GetRevoluteJointConf ( const RevoluteJoint joint)
noexcept

Gets the definition data for the given joint.

Definition at line 39 of file RevoluteJointConf.cpp.

◆ GetRopeJointConf()

RopeJointConf GetRopeJointConf ( const RopeJoint joint)
noexcept

Gets the definition data for the given joint.

Definition at line 29 of file RopeJointConf.cpp.

◆ GetTargetJointConf()

TargetJointConf GetTargetJointConf ( const TargetJoint joint)
noexcept

Gets the definition data for the given joint.

Definition at line 28 of file TargetJointConf.cpp.

◆ GetWeldJointConf()

WeldJointConf GetWeldJointConf ( const WeldJoint joint)
noexcept

Gets the definition data for the given joint.

Definition at line 38 of file WeldJointConf.cpp.

◆ GetJointTranslation() [2/2]

Length GetJointTranslation ( const WheelJoint joint)
noexcept

Get the current joint translation.

Definition at line 365 of file WheelJoint.cpp.

◆ GetAngularVelocity() [3/3]

AngularVelocity GetAngularVelocity ( const WheelJoint joint)
noexcept

Get the current joint translation speed.

Definition at line 374 of file WheelJoint.cpp.

◆ GetMotorTorque() [2/2]

Torque playrho::d2::GetMotorTorque ( const WheelJoint joint,
Frequency  inv_dt 
)
inlinenoexcept

Gets the current motor torque for the given joint for the given the inverse time step.

Definition at line 194 of file WheelJoint.hpp.

◆ GetWheelJointConf()

WheelJointConf GetWheelJointConf ( const WheelJoint joint)
noexcept

Gets the definition data for the given joint.

Definition at line 39 of file WheelJointConf.cpp.

◆ Step()

StepStats Step ( World world,
Time  delta,
TimestepIters  velocityIterations = 8,
TimestepIters  positionIterations = 3 
)

Steps the world ahead by a given time amount.

Performs position and velocity updating, sleeping of non-moving bodies, updating of the contacts, and notifying the contact listener of begin-contact, end-contact, pre-solve, and post-solve events. If the given velocity and position iterations are more than zero, this method also respectively performs velocity and position resolution of the contacting bodies.

Note
While body velocities are updated accordingly (per the sum of forces acting on them), body positions (barring any collisions) are updated as if they had moved the entire time step at those resulting velocities. In other words, a body initially at p0 going v0 fast with a sum acceleration of a, after time t and barring any collisions, will have a new velocity (v1) of v0 + (a * t) and a new position (p1) of p0 + v1 * t.
Warning
Varying the time step may lead to non-physical behaviors.
Postcondition
Static bodies are unmoved.
Kinetic bodies are moved based on their previous velocities.
Dynamic bodies are moved based on their previous velocities, gravity, applied forces, applied impulses, masses, damping, and the restitution and friction values of their fixtures when they experience collisions.
Parameters
worldWorld to step.
deltaTime to simulate as a delta from the current state. This should not vary.
velocityIterationsNumber of iterations for the velocity constraint solver.
positionIterationsNumber of iterations for the position constraint solver. The position constraint solver resolves the positions of bodies that overlap.

Definition at line 2589 of file World.cpp.

◆ GetTouchingCount()

ContactCounter GetTouchingCount ( const World world)
noexcept

Gets the touching count for the given world.

Definition at line 2605 of file World.cpp.

◆ GetFixtureCount() [2/2]

std::size_t GetFixtureCount ( const World world)
noexcept

Gets the count of fixtures in the given world.

Definition at line 2614 of file World.cpp.

◆ GetShapeCount()

std::size_t GetShapeCount ( const World world)
noexcept

Gets the count of unique shapes in the given world.

Definition at line 2625 of file World.cpp.

◆ GetAwakeCount()

BodyCounter GetAwakeCount ( const World world)
noexcept

Gets the count of awake bodies in the given world.

Examples
World.cpp.

Definition at line 2638 of file World.cpp.

◆ Awaken() [2/2]

BodyCounter Awaken ( World world)
noexcept

Awakens all of the bodies in the given world.

Calls all of the world's bodies' SetAwake method.

Returns
Sum total of calls to bodies' SetAwake method that returned true.
See also
Body::SetAwake.

Definition at line 2646 of file World.cpp.

◆ SetAccelerations() [1/3]

void SetAccelerations ( World world,
Acceleration  acceleration 
)
noexcept

Sets the accelerations of all the world's bodies to the given value.

Definition at line 2660 of file World.cpp.

◆ SetAccelerations() [2/3]

void SetAccelerations ( World world,
LinearAcceleration2  acceleration 
)
noexcept

Sets the accelerations of all the world's bodies to the given value.

Note
This will leave the angular acceleration alone.
Examples
World.cpp.

Definition at line 2668 of file World.cpp.

◆ FindClosestBody()

Body * FindClosestBody ( const World world,
Length2  location 
)
noexcept

Finds body in given world that's closest to the given location.

Definition at line 2676 of file World.cpp.

◆ GetBodyCount()

BodyCounter GetBodyCount ( const World world)
inlinenoexcept

Gets the body count in the given world.

Returns
0 or higher.
Examples
World.cpp.

Definition at line 1036 of file World.hpp.

◆ GetJointCount()

JointCounter GetJointCount ( const World world)
inlinenoexcept

Gets the count of joints in the given world.

Returns
0 or higher.
Examples
World.cpp.

Definition at line 1044 of file World.hpp.

◆ GetContactCount()

ContactCounter GetContactCount ( const World world)
inlinenoexcept

Gets the count of contacts in the given world.

Note
Not all contacts are for shapes that are actually touching. Some contacts are for shapes which merely have overlapping AABBs.
Returns
0 or higher.
Examples
World.cpp.

Definition at line 1054 of file World.hpp.

◆ SetAccelerations() [3/3]

template<class F >
void SetAccelerations ( World world,
fn 
)
noexcept

Sets the accelerations of all the world's bodies.

Parameters
worldWorld instance to set the acceleration of all contained bodies for.
fnFunction or functor with a signature like: Acceleration (*fn)(const Body& body).

Definition at line 1123 of file World.hpp.

◆ ClearForces()

void ClearForces ( World world)
inlinenoexcept

Clears forces.

Manually clear the force buffer on all bodies.

Definition at line 1143 of file World.hpp.

◆ GetDefaultWorldConf()

PLAYRHO_CONSTEXPR WorldConf GetDefaultWorldConf ( )
inlinenoexcept

Gets the default definitions value.

Note
This method exists as a work-around for providing the World constructor a default value without otherwise getting a compiler error such as: "cannot use defaulted constructor of '<code>Conf</code>' within '<code>World</code>' outside of member functions because 'gravity' has an initializer"
Examples
World.cpp.

Definition at line 92 of file WorldConf.hpp.

Variable Documentation

◆ Transform_identity

const PLAYRHO_CONSTEXPR auto playrho::d2::Transform_identity
Initial value:
= Transformation{
Length2{0_m, 0_m}, UnitVec::GetRight()
}

Identity transformation value.

Definition at line 48 of file Transformation.hpp.

◆ EarthlyGravity

const PLAYRHO_CONSTEXPR auto playrho::d2::EarthlyGravity
Initial value:

Earthly gravity in 2-dimensions.

Linear acceleration in 2-dimensions of an earthly object due to Earth's mass.

See also
EarthlyLinearAcceleration
Examples
HelloWorld.cpp, and World.cpp.

Definition at line 154 of file Vector2.hpp.