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

Edge shape configuration. More...

#include <EdgeShapeConf.hpp>

Inheritance diagram for playrho::d2::EdgeShapeConf:
[legend]
Collaboration diagram for playrho::d2::EdgeShapeConf:
[legend]

Public Member Functions

 EdgeShapeConf (Length2 vA, Length2 vB, const EdgeShapeConf &conf=GetDefaultConf()) noexcept
 Initializing constructor.
 
EdgeShapeConfSet (Length2 vA, Length2 vB) noexcept
 Sets both vertices in one call.
 
EdgeShapeConfUseVertexRadius (NonNegative< Length > value) noexcept
 Uses the given vertex radius.
 
EdgeShapeConfTransform (const Mat22 &m) noexcept
 Transforms both vertices by the given transformation matrix. More...
 
Length2 GetVertexA () const noexcept
 Gets vertex A.
 
Length2 GetVertexB () const noexcept
 Gets vertex B.
 
DistanceProxy GetChild () const noexcept
 Gets the "child" shape.
 
- Public Member Functions inherited from playrho::d2::ShapeBuilder< EdgeShapeConf >
constexpr ShapeBuilder ()=default
 Default constructor.
 
constexpr ShapeBuilder (const BaseShapeConf &value) noexcept
 Initializing constructor.
 
constexpr EdgeShapeConfUseFriction (NonNegative< Real > value) noexcept
 Uses the given friction.
 
constexpr EdgeShapeConfUseRestitution (Finite< Real > value) noexcept
 Uses the given restitution.
 
constexpr EdgeShapeConfUseDensity (NonNegative< AreaDensity > value) noexcept
 Uses the given density.
 

Static Public Member Functions

static constexpr NonNegative< LengthGetDefaultVertexRadius () noexcept
 Gets the default vertex radius.
 
static EdgeShapeConf GetDefaultConf () noexcept
 Gets the default configuration.
 

Public Attributes

NonNegative< LengthvertexRadius = GetDefaultVertexRadius()
 Vertex radius. More...
 
- Public Attributes inherited from playrho::d2::BaseShapeConf
NonNegative< Realfriction = NonNegative<Real>{Real{2} / Real{10}}
 Friction coefficient. More...
 
Finite< Realrestitution = Finite<Real>{0}
 Restitution (elasticity) of the associated shape. More...
 
NonNegative< AreaDensitydensity = NonNegative<AreaDensity>{0_kgpm2}
 Area density of the associated shape. More...
 

Private Attributes

Length2 m_vertices [2] = {Length2{}, Length2{}}
 Vertices.
 
UnitVec m_normals [2] = {UnitVec{}, UnitVec{}}
 Normals.
 

Detailed Description

Edge shape configuration.

A line segment (edge) shape. These can be connected in chains or loops to other edge shapes. The connectivity information is used to ensure correct contact normals.

Note
This data structure is 56-bytes.
Examples
Shape.cpp, and World.cpp.

Member Function Documentation

◆ Transform()

EdgeShapeConf & playrho::d2::EdgeShapeConf::Transform ( const Mat22 m)
noexcept

Transforms both vertices by the given transformation matrix.

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

Member Data Documentation

◆ vertexRadius

NonNegative<Length> playrho::d2::EdgeShapeConf::vertexRadius = GetDefaultVertexRadius()

Vertex radius.

This is 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.

Note
This should be a non-negative value.

Referenced by GetChild().


The documentation for this class was generated from the following files: