Dura2D  v0.1.0
An educational 2D game physics library
Loading...
Searching...
No Matches
d2PolygonShape Struct Reference

#include <d2Shape.h>

Inheritance diagram for d2PolygonShape:
d2Shape d2BoxShape

Public Member Functions

 d2PolygonShape ()=default
 
 d2PolygonShape (const d2Vec2 *vertices, int vertexCount)
 
virtual ~d2PolygonShape ()
 
d2ShapeType GetType () const override
 
d2ShapeClone () const override
 
d2Vec2 EdgeAt (int index) const
 
real FindMinSeparation (const d2PolygonShape *other, int &indexReferenceEdge, d2Vec2 &supportPoint) const
 
int FindIncidentEdge (const d2Vec2 &normal) const
 
int ClipSegmentToLine (const std::vector< d2Vec2 > &contactsIn, std::vector< d2Vec2 > &contactsOut, const d2Vec2 &c0, const d2Vec2 &c1) const
 
real PolygonArea () const
 
d2Vec2 PolygonCentroid () const
 
real GetMomentOfInertia () const override
 
void UpdateVertices (const d2Transform &transform) override
 
- Public Member Functions inherited from d2Shape
virtual ~d2Shape ()=default
 

Public Attributes

real width
 
real height
 
int m_vertexCount
 
d2Vec2localVertices
 
d2Vec2worldVertices
 

Friends

class d2World
 

Constructor & Destructor Documentation

◆ d2PolygonShape() [1/2]

d2PolygonShape::d2PolygonShape ( )
default

◆ d2PolygonShape() [2/2]

d2PolygonShape::d2PolygonShape ( const d2Vec2 * vertices,
int vertexCount )

◆ ~d2PolygonShape()

virtual d2PolygonShape::~d2PolygonShape ( )
virtual

Member Function Documentation

◆ ClipSegmentToLine()

int d2PolygonShape::ClipSegmentToLine ( const std::vector< d2Vec2 > & contactsIn,
std::vector< d2Vec2 > & contactsOut,
const d2Vec2 & c0,
const d2Vec2 & c1 ) const

◆ Clone()

d2Shape * d2PolygonShape::Clone ( ) const
overridevirtual

Implements d2Shape.

◆ EdgeAt()

d2Vec2 d2PolygonShape::EdgeAt ( int index) const

◆ FindIncidentEdge()

int d2PolygonShape::FindIncidentEdge ( const d2Vec2 & normal) const

◆ FindMinSeparation()

real d2PolygonShape::FindMinSeparation ( const d2PolygonShape * other,
int & indexReferenceEdge,
d2Vec2 & supportPoint ) const

◆ GetMomentOfInertia()

real d2PolygonShape::GetMomentOfInertia ( ) const
overridevirtual

Implements d2Shape.

◆ GetType()

d2ShapeType d2PolygonShape::GetType ( ) const
overridevirtual

Implements d2Shape.

◆ PolygonArea()

real d2PolygonShape::PolygonArea ( ) const

◆ PolygonCentroid()

d2Vec2 d2PolygonShape::PolygonCentroid ( ) const

◆ UpdateVertices()

void d2PolygonShape::UpdateVertices ( const d2Transform & transform)
overridevirtual

Implements d2Shape.

Friends And Related Symbol Documentation

◆ d2World

friend class d2World
friend

Member Data Documentation

◆ height

real d2PolygonShape::height

◆ localVertices

d2Vec2* d2PolygonShape::localVertices

◆ m_vertexCount

int d2PolygonShape::m_vertexCount

◆ width

real d2PolygonShape::width

◆ worldVertices

d2Vec2* d2PolygonShape::worldVertices

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