Calamity Engine 1.0.0
A cross-platform 2D game engine written in C++ and SDL3.
Loading...
Searching...
No Matches
Polygon Struct Reference

#include <definitions.hpp>

Public Member Functions

 Polygon ()
 
 Polygon (const b2Polygon &polygon)
 
 operator b2Polygon () const
 
template<class Archive >
void serialize (Archive &ar)
 

Public Attributes

Vector2 centroid
 
int count
 
Vector2 normals [B2_MAX_POLYGON_VERTICES]
 
float radius
 
Vector2 vertices [B2_MAX_POLYGON_VERTICES]
 

Detailed Description

Polygon

A simple polygon class, which basically mirrors the Box2D polygon class.

By the way, you should never manually fill these out. Instead, when using PolygonShape ["PolygonShapes"], use the PolygonShapes constructor.

Constructor & Destructor Documentation

◆ Polygon() [1/2]

Polygon::Polygon ( )

◆ Polygon() [2/2]

Polygon::Polygon ( const b2Polygon &  polygon)
explicit

Member Function Documentation

◆ operator b2Polygon()

Polygon::operator b2Polygon ( ) const

◆ serialize()

template<class Archive >
void Polygon::serialize ( Archive &  ar)
inline

Member Data Documentation

◆ centroid

Vector2 Polygon::centroid

◆ count

int Polygon::count

◆ normals

Vector2 Polygon::normals[B2_MAX_POLYGON_VERTICES]

◆ radius

float Polygon::radius

◆ vertices

Vector2 Polygon::vertices[B2_MAX_POLYGON_VERTICES]

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