|
Fx2D
A C++20 2D rigid-body physics engine
|
Unified circle, capsule, polygon, edge, and chain representation. More...
#include <Geometry.h>
Inheritance diagram for FxShape:
Collaboration diagram for FxShape:Classes | |
| struct | ChainTag |
Public Member Functions | |
| FxShape () | |
| FxShape (float radius) | |
| FxShape (float length, float radius) | |
| FxShape (const FxVec2f &a, const FxVec2f &b) | |
| FxShape (const FxVec2fArray &points, ChainTag) | |
| FxShape (const FxVec2fArray &vertices, float skin_radius=0.0f) | |
| FxShape (const FxVec2f &size, float skin_radius=0.0f) | |
| FxShapeType | shape_type () const |
| float | radius () const |
| float | skin_radius () const |
| const FxVec2fArray & | vertices () const |
| FxVec2fArray | __vertices () const |
| FxVec2f | centroid () const |
| bool | is_circle () const |
| bool | is_capsule () const |
| bool | is_polygon () const |
| bool | is_chain () const |
| std::size_t | segment_count () const |
| FxShape | segment (std::size_t i) const |
| bool | is_edge () const |
| bool | contains (const FxVec2f &p) const |
| float | area () const |
| float | calc_inertia (float mass) const |
| void | set_offset_pose (const FxVec3f &o_pose) |
| FxVec3f | offset_pose () const |
| FxArray< float > | set_world_pose (const FxVec3f &world_pose) |
| void | set_world_pose (const FxVec3f &world_pose, FxArray< float > &out_aabb) |
| FxVec3f | world_pose () const |
| void | set_position (const FxVec2f &pos) |
| void | set_rotation (float theta) |
| void | move (const FxVec2f &delta) |
| void | rotate (float delta_theta) |
| std::pair< std::size_t, float > | min_projection (const FxVec2f &axis, const FxVec2f &origin) const |
| FxVec2f | get_closest_vertex (const FxVec2f &point) const |
Static Public Member Functions | |
| static float | polygon_area (const FxVec2fArray &verts) |
| static FxShape | make_chain (const FxVec2fArray &points) |
Static Protected Member Functions | |
| static float | calc_radius (const FxVec2fArray &verts) |
| static bool | is_convex (const FxVec2fArray &verts) |
Protected Attributes | |
| FxShapeType | m_shape_type |
| float | m_radius |
| float | m_skin_radius = 0.0f |
| FxVec2fArray | m_vertices |
| FxVec3f | m_offset_pose {0.0f, 0.0f, 0.0f} |
| FxVec3f | m_world_pose {0.0f, 0.0f, 0.0f} |
| FxVec2f | m_centroid {0.0f, 0.0f} |
| FxVec2fArray | m_world_vertices |
Unified circle, capsule, polygon, edge, and chain representation.
Definition at line 46 of file Geometry.h.
|
inline |
Definition at line 86 of file Geometry.h.
|
inline |
Definition at line 89 of file Geometry.h.
|
inline |
Definition at line 98 of file Geometry.h.
Definition at line 114 of file Geometry.h.
|
inline |
Definition at line 128 of file Geometry.h.
|
inline |
Definition at line 143 of file Geometry.h.
|
inline |
Definition at line 163 of file Geometry.h.
|
inline |
Definition at line 198 of file Geometry.h.
|
inline |
Definition at line 252 of file Geometry.h.
|
inline |
Definition at line 277 of file Geometry.h.
|
inlinestaticprotected |
Definition at line 58 of file Geometry.h.
|
inline |
Definition at line 201 of file Geometry.h.
|
inline |
Definition at line 227 of file Geometry.h.
Definition at line 445 of file Geometry.h.
|
inline |
Definition at line 206 of file Geometry.h.
|
inline |
Definition at line 213 of file Geometry.h.
|
inline |
Definition at line 204 of file Geometry.h.
|
inlinestaticprotected |
Definition at line 69 of file Geometry.h.
|
inline |
Definition at line 224 of file Geometry.h.
|
inline |
Definition at line 208 of file Geometry.h.
|
inlinestatic |
Definition at line 211 of file Geometry.h.
|
inline |
Definition at line 418 of file Geometry.h.
|
inline |
Definition at line 404 of file Geometry.h.
|
inline |
Definition at line 332 of file Geometry.h.
|
inlinestatic |
Definition at line 180 of file Geometry.h.
|
inline |
Definition at line 193 of file Geometry.h.
|
inline |
Definition at line 410 of file Geometry.h.
|
inline |
Definition at line 219 of file Geometry.h.
|
inline |
Definition at line 216 of file Geometry.h.
|
inline |
Definition at line 331 of file Geometry.h.
|
inline |
Definition at line 392 of file Geometry.h.
|
inline |
Definition at line 398 of file Geometry.h.
Definition at line 335 of file Geometry.h.
Definition at line 344 of file Geometry.h.
|
inline |
Definition at line 192 of file Geometry.h.
|
inline |
Definition at line 194 of file Geometry.h.
|
inline |
Definition at line 197 of file Geometry.h.
|
inline |
Definition at line 389 of file Geometry.h.
|
protected |
Definition at line 54 of file Geometry.h.
|
protected |
Definition at line 52 of file Geometry.h.
|
protected |
Definition at line 49 of file Geometry.h.
|
protected |
Definition at line 48 of file Geometry.h.
|
protected |
Definition at line 50 of file Geometry.h.
|
protected |
Definition at line 51 of file Geometry.h.
|
protected |
Definition at line 53 of file Geometry.h.
|
protected |
Definition at line 55 of file Geometry.h.