Dura2D  v0.1.0
An educational 2D game physics library
Loading...
Searching...
No Matches
d2Force.h
Go to the documentation of this file.
1#ifndef FORCE_H
2#define FORCE_H
3
4#include "d2api.h"
5#include "d2Types.h"
6
7class d2Body;
8struct d2Vec2;
9
11{
12 static d2Vec2 GenerateDragForce(const d2Body &body, real k);
13
14 static d2Vec2 GenerateFrictionForce(const d2Body &body, real k);
15
16 static d2Vec2 GenerateSpringForce(const d2Body &body, d2Vec2 anchor, real restLength, real k);
17
18 static d2Vec2 GenerateGravitationalForce(const d2Body &a, const d2Body &b, real G, real minDistance, real maxDistance);
19};
20
21#endif
A class representing a 2D rigid body.
Definition d2Body.h:28
float real
Definition d2Types.h:10
#define D2_API
Definition d2api.h:27
Definition d2Force.h:11
static d2Vec2 GenerateGravitationalForce(const d2Body &a, const d2Body &b, real G, real minDistance, real maxDistance)
static d2Vec2 GenerateFrictionForce(const d2Body &body, real k)
static d2Vec2 GenerateSpringForce(const d2Body &body, d2Vec2 anchor, real restLength, real k)
static d2Vec2 GenerateDragForce(const d2Body &body, real k)
Represents a 2D vector.
Definition d2Math.h:22