-
-
Notifications
You must be signed in to change notification settings - Fork 180
/
Copy pathPhysicsWorld.h
54 lines (41 loc) · 1.23 KB
/
PhysicsWorld.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
* Copyright (c) scott.cgi All Rights Reserved.
*
* This source code belongs to project Mojoc, which is a pure C Game Engine hosted on GitHub.
* The Mojoc Game Engine is licensed under the MIT License, and will continue to be iterated with coding passion.
*
* License : https://github.com/scottcgi/Mojoc/blob/master/LICENSE
* GitHub : https://github.com/scottcgi/Mojoc
* CodeStyle: https://github.com/scottcgi/Mojoc/blob/master/Docs/CodeStyle.md
*
* Since : 2014-5-30
* Update : 2019-1-18
* Author : scott.cgi
*/
#ifndef PHYSICS_WORLD_H
#define PHYSICS_WORLD_H
#include "Engine/Physics/PhysicsBody.h"
#include "Engine/Toolkit/Math/Vector.h"
/**
* Control and set up physics world.
*/
struct APhysicsWorld
{
Vector2 gravity;
/**
* Create body and add in PhysicsWorld.
*/
PhysicsBody* (*AddBody) (PhysicsShape shape, Array(float)* vertexArr);
/**
* Remove PhysicsBody from world and free it.
*
* important: after DestroyBody the body will be invalidated.
*/
void (*DestroyBody)(PhysicsBody* body);
/**
* Called every frame by loop.
*/
void (*Update) (float deltaSeconds);
};
extern struct APhysicsWorld APhysicsWorld[1];
#endif