CoriEngine
Loading...
Searching...
No Matches
Physics.hpp File Reference
#include <box2cpp/box2cpp.h>
#include <tmxlite/Map.hpp>
#include "WorldSystem/Entity.hpp"
Include dependency graph for Physics/Physics.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Cori::Physics::ShapeUserData
struct  Cori::Physics::CastResult
class  Cori::Physics::ConvexHull
class  Cori::Physics::Polygon
class  Cori::Physics::Circle
class  Cori::Physics::Capsule
class  Cori::Physics::Segment

Namespaces

namespace  Cori
 Global engine namespace.
namespace  Cori::World
 Anything connected to WorldSystem (ECS) is in this namespace.
namespace  Cori::World::Components
 Components that are used with the WorldSystem (ECS).
namespace  Cori::World::Components::Scene
 Components designed to be used with scenes.
namespace  Cori::Physics
 Anything connected to physics is in this namespace. Please refer to Box2D docs 'https://box2d.org/' for any details regarding physics.

Macros

#define CORI_PIXELS_PER_METER   16

Typedefs

using Cori::Physics::Vec2 = b2Vec2
 An alias for Box2D native vec2 type, if you see it somewhere, be sure data there is in meters contrary to when glm used, there data is in camera pixels.
using Cori::Physics::Rot = b2Rot
using Cori::Physics::Transform = b2Transform
using Cori::Physics::CollisionPlane = b2CollisionPlane
using Cori::Physics::RayResult = b2RayResult

Enumerations

enum  Cori::Physics::CollisionBits : uint64_t {
  Cori::Physics::StaticBit = 1ull << 0 , Cori::Physics::MoverBit = 1ull << 1 , Cori::Physics::DynamicBit = 1ull << 2 , Cori::Physics::DebrisBit = 1ull << 3 ,
  Cori::Physics::SensorBit = 1ull << 4 , Cori::Physics::CustomBit5 = 1ull << 5 , Cori::Physics::CustomBit6 = 1ull << 6 , Cori::Physics::CustomBit7 = 1ull << 7 ,
  Cori::Physics::CustomBit8 = 1ull << 8 , Cori::Physics::CustomBit9 = 1ull << 9 , Cori::Physics::CustomBit10 = 1ull << 10 , Cori::Physics::CustomBit11 = 1ull << 11 ,
  Cori::Physics::CustomBit12 = 1ull << 12 , Cori::Physics::CustomBit13 = 1ull << 13 , Cori::Physics::CustomBit14 = 1ull << 14 , Cori::Physics::CustomBit15 = 1ull << 15 ,
  Cori::Physics::CustomBit16 = 1ull << 16 , Cori::Physics::CustomBit17 = 1ull << 17 , Cori::Physics::CustomBit18 = 1ull << 18 , Cori::Physics::CustomBit19 = 1ull << 19 ,
  Cori::Physics::CustomBit20 = 1ull << 20 , Cori::Physics::CustomBit21 = 1ull << 21 , Cori::Physics::CustomBit22 = 1ull << 22 , Cori::Physics::CustomBit23 = 1ull << 23 ,
  Cori::Physics::CustomBit24 = 1ull << 24 , Cori::Physics::CustomBit25 = 1ull << 25 , Cori::Physics::CustomBit26 = 1ull << 26 , Cori::Physics::CustomBit27 = 1ull << 27 ,
  Cori::Physics::CustomBit28 = 1ull << 28 , Cori::Physics::CustomBit29 = 1ull << 29 , Cori::Physics::CustomBit30 = 1ull << 30 , Cori::Physics::CustomBit31 = 1ull << 31 ,
  Cori::Physics::CustomBit32 = 1ull << 32 , Cori::Physics::CustomBit33 = 1ull << 33 , Cori::Physics::CustomBit34 = 1ull << 34 , Cori::Physics::CustomBit35 = 1ull << 35 ,
  Cori::Physics::CustomBit36 = 1ull << 36 , Cori::Physics::CustomBit37 = 1ull << 37 , Cori::Physics::CustomBit38 = 1ull << 38 , Cori::Physics::CustomBit39 = 1ull << 39 ,
  Cori::Physics::CustomBit40 = 1ull << 40 , Cori::Physics::CustomBit41 = 1ull << 41 , Cori::Physics::CustomBit42 = 1ull << 42 , Cori::Physics::CustomBit43 = 1ull << 43 ,
  Cori::Physics::CustomBit44 = 1ull << 44 , Cori::Physics::CustomBit45 = 1ull << 45 , Cori::Physics::CustomBit46 = 1ull << 46 , Cori::Physics::CustomBit47 = 1ull << 47 ,
  Cori::Physics::CustomBit48 = 1ull << 48 , Cori::Physics::CustomBit49 = 1ull << 49 , Cori::Physics::CustomBit50 = 1ull << 50 , Cori::Physics::CustomBit51 = 1ull << 51 ,
  Cori::Physics::CustomBit52 = 1ull << 52 , Cori::Physics::CustomBit53 = 1ull << 53 , Cori::Physics::CustomBit54 = 1ull << 54 , Cori::Physics::CustomBit55 = 1ull << 55 ,
  Cori::Physics::CustomBit56 = 1ull << 56 , Cori::Physics::CustomBit57 = 1ull << 57 , Cori::Physics::CustomBit58 = 1ull << 58 , Cori::Physics::CustomBit59 = 1ull << 59 ,
  Cori::Physics::CustomBit60 = 1ull << 60 , Cori::Physics::CustomBit61 = 1ull << 61 , Cori::Physics::CustomBit62 = 1ull << 62 , Cori::Physics::CustomBit63 = 1ull << 63 ,
  Cori::Physics::AllBits = ~0u
}
enum class  Cori::Physics::WindingOrder : uint8_t { Cori::Physics::COLLINEAR , Cori::Physics::CLOCKWISE , Cori::Physics::COUNTER_CLOCKWISE }

Functions

WindingOrder Cori::Physics::GetPolygonWindingOrder (const std::vector< Vec2 > &polygon)
 Calculates the winding order of the polygon made up from individual points. Box2D version. Takes Box2Ds vec2s.
WindingOrder Cori::Physics::GetPolygonWindingOrder (const std::vector< tmx::Vector2f > &polygon)
 Calculates the winding order of the polygon made up from individual points. TMXLite version. Takes TMXLite vec2s.
const char * Cori::Physics::WindingOrderToString (WindingOrder order)
 Converts the WindingOrder enumerator to string, for logging.
glm::vec2 Cori::Physics::ToPixels (const Vec2 vec)
 Converts physical meters to camera space pixels.
Vec2 Cori::Physics::ToMeters (const glm::vec2 vec)
 Converts camera space pixels to physical meters.
std::string Cori::Physics::Vec2ToString (Vec2 vec)
 Converts a native Box2D vec2 to string, for logging.
void operator*= (Cori::Physics::Vec2 &a, Cori::Physics::Vec2 b)

Macro Definition Documentation

◆ CORI_PIXELS_PER_METER

#define CORI_PIXELS_PER_METER   16

Definition at line 7 of file Physics/Physics.hpp.

Function Documentation

◆ operator*=()

void operator*= ( Cori::Physics::Vec2 & a,
Cori::Physics::Vec2 b )
inline

Definition at line 289 of file Physics/Physics.hpp.