CheeseEngine
A 2D Game Engine
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
phys2d Namespace Reference

Namespaces

namespace  ColliderLayers
 

Classes

struct  AABB
 
struct  CapsuleGeometry
 
struct  CircleGeometry
 
struct  ColliderComponent
 
class  PhysicsSystem
 
struct  PolygonGeometry
 
struct  RigidBodyComponent
 
struct  SegmentChain
 
struct  SegmentGeometry
 
struct  TransformComponent
 

Typedefs

using ShapeData = std::variant< PolygonGeometry, CircleGeometry >
 

Enumerations

enum class  BodyType { Static , Kinematic , Dynamic }
 
enum class  BodyShape {
  Polygon , Circle , Capsule , Segment ,
  SegmentChain
}
 

Functions

bool checkCollision (const AABB &aabb1, const AABB &aabb2)
 checks the collision between two AABB-objects
 

Variables

constexpr float pi = 3.14159265
 
constexpr float pi2 = pi * 2
 
constexpr float inf = 2e5
 
constexpr float epsilon = 1e-6
 
constexpr float rb_defaultDamping = 0.01f
 
constexpr float rb_defaultRestitution = 0.5f
 
constexpr float rb_defaultFriction = 0.2f
 
constexpr float rb_defaultInvMass = 1.0f
 
constexpr float rb_defaultInvInertia = 1.0f
 
constexpr float rb_defaultGravityScale = 1.0f
 
constexpr glm::vec2 cd_defaultLocalOffset = {0.0f, 0.0f}
 
constexpr bool cd_defaultTriggerStatus = false
 

Typedef Documentation

◆ ShapeData

using phys2d::ShapeData = typedef std::variant<PolygonGeometry, CircleGeometry>

Enumeration Type Documentation

◆ BodyShape

enum class phys2d::BodyShape
strong
Enumerator
Polygon 

convex polygon, has an array of points

Circle 

perfect geometric circle, has radius

Capsule 

capsule form, is constructed of two circles with same radius and rectangle

Segment 

simple segment, has length

SegmentChain 

chain of segments, has array of points to connect sequently

◆ BodyType

enum class phys2d::BodyType
strong
Enumerator
Static 

zero mass, zero velocity, can be manually moved

Kinematic 

zero mass, velocity is set by user, is moved by System

Dynamic 

non-negative mass, velocity is determined by outer forces, is moved by physics system

Function Documentation

◆ checkCollision()

bool phys2d::checkCollision ( const AABB aabb1,
const AABB aabb2 
)

checks the collision between two AABB-objects

Parameters
aabb1first box
aabb2second box
Return values
trueif the objects collide and false else

Variable Documentation

◆ cd_defaultLocalOffset

constexpr glm::vec2 phys2d::cd_defaultLocalOffset = {0.0f, 0.0f}
constexpr

◆ cd_defaultTriggerStatus

constexpr bool phys2d::cd_defaultTriggerStatus = false
constexpr

◆ epsilon

constexpr float phys2d::epsilon = 1e-6
constexpr

◆ inf

constexpr float phys2d::inf = 2e5
constexpr

◆ pi

constexpr float phys2d::pi = 3.14159265
constexpr

◆ pi2

constexpr float phys2d::pi2 = pi * 2
constexpr

◆ rb_defaultDamping

constexpr float phys2d::rb_defaultDamping = 0.01f
constexpr

◆ rb_defaultFriction

constexpr float phys2d::rb_defaultFriction = 0.2f
constexpr

◆ rb_defaultGravityScale

constexpr float phys2d::rb_defaultGravityScale = 1.0f
constexpr

◆ rb_defaultInvInertia

constexpr float phys2d::rb_defaultInvInertia = 1.0f
constexpr

◆ rb_defaultInvMass

constexpr float phys2d::rb_defaultInvMass = 1.0f
constexpr

◆ rb_defaultRestitution

constexpr float phys2d::rb_defaultRestitution = 0.5f
constexpr