PlayRho  2.0.0
An interactive physics engine & library.
playrho::d2::part::StaticRectangle< W, H, V > Class Template Reference

Static rectangle. More...

#include <playrho/d2/part/Compositor.hpp>

Public Member Functions

DistanceProxy GetChild (ChildCounter index) const
 Gets the "child" shape for the given shape configuration.
 
ChildCounter GetChildCount () const noexcept
 Gets the child count. More...
 
constexpr Length2 GetDimensions () const noexcept
 Gets the dimensions of this rectangle. More...
 
MassData GetMassData (NonNegative< AreaDensity > density) const noexcept
 Gets the mass data for the geometry.
 
const std::array< UnitVec, 4u > & GetNormals () const noexcept
 Gets this rectangle's normals. More...
 
constexpr Length2 GetOffset () const noexcept
 Gets the x and y offset of this rectangle. More...
 
constexpr NonNegative< LengthGetVertexRadius () const noexcept
 Gets the vertex radius.
 
const std::array< Length2, 4u > & GetVertices () const noexcept
 Gets this rectangle's vertices. More...
 
void SetDimensions (Length2 val)
 Sets the dimensions of this rectangle. More...
 
void SetOffset (Length2 val)
 Sets the x and y offset of this rectangle. More...
 
void SetVertexRadius (ChildCounter, NonNegative< Length > value)
 Sets the vertex radius for the specified child to the given value. More...
 

Detailed Description

template<int W = 1, int H = 1, int V = 2>
class playrho::d2::part::StaticRectangle< W, H, V >

Static rectangle.

Provides a rectangular compile-time static class implementation of the geometry policy of the Compositor host class template.

Note
This class is not intended for standalone use.
// Here's an example use of this class for a 3m-wide by 2m-high rectangular part...
auto comp = Compositor<GeometryIs<StaticRectangle<3, 2>>>{};
See also
DynamicRectangle, Compositor.

Member Function Documentation

◆ GetChildCount()

template<int W = 1, int H = 1, int V = 2>
ChildCounter playrho::d2::part::StaticRectangle< W, H, V >::GetChildCount ( ) const
inlinenoexcept

Gets the child count.

See also
GetChild.

◆ GetDimensions()

template<int W = 1, int H = 1, int V = 2>
constexpr Length2 playrho::d2::part::StaticRectangle< W, H, V >::GetDimensions ( ) const
inlineconstexprnoexcept

Gets the dimensions of this rectangle.

See also
SetDimensions.

Referenced by playrho::d2::part::StaticRectangle< W, H, V >::SetDimensions().

◆ GetNormals()

template<int W = 1, int H = 1, int V = 2>
const std::array<UnitVec, 4u>& playrho::d2::part::StaticRectangle< W, H, V >::GetNormals ( ) const
inlinenoexcept

Gets this rectangle's normals.

See also
GetVertices.

Referenced by playrho::d2::part::StaticRectangle< W, H, V >::GetChild().

◆ GetOffset()

template<int W = 1, int H = 1, int V = 2>
constexpr Length2 playrho::d2::part::StaticRectangle< W, H, V >::GetOffset ( ) const
inlineconstexprnoexcept

Gets the x and y offset of this rectangle.

See also
SetOffset.

Referenced by playrho::d2::part::StaticRectangle< W, H, V >::SetOffset().

◆ GetVertices()

template<int W = 1, int H = 1, int V = 2>
const std::array<Length2, 4u>& playrho::d2::part::StaticRectangle< W, H, V >::GetVertices ( ) const
inlinenoexcept

◆ SetDimensions()

template<int W = 1, int H = 1, int V = 2>
void playrho::d2::part::StaticRectangle< W, H, V >::SetDimensions ( Length2  val)
inline

Sets the dimensions of this rectangle.

Exceptions
InvalidArgumentIf called to change the dimensions.
See also
GetDimensions.

◆ SetOffset()

template<int W = 1, int H = 1, int V = 2>
void playrho::d2::part::StaticRectangle< W, H, V >::SetOffset ( Length2  val)
inline

Sets the x and y offset of this rectangle.

Exceptions
InvalidArgumentIf called to change the offset.
See also
GetOffset.

◆ SetVertexRadius()

template<int W = 1, int H = 1, int V = 2>
void playrho::d2::part::StaticRectangle< W, H, V >::SetVertexRadius ( ChildCounter  ,
NonNegative< Length value 
)
inline

Sets the vertex radius for the specified child to the given value.

Note
This class doesn't support changing the vertex radius.

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