Add some documentation to World

This commit is contained in:
Dane Johnson 2021-04-21 15:06:03 -05:00
parent 588032dd1f
commit 33d362afbc
3 changed files with 58 additions and 0 deletions

View File

@ -1,3 +1,24 @@
/*
Dane Johnson <dane@danejohnson.org>
LICENSE
Couch Copyright (C) 2021 Dane Johnson
This program comes with ABSOLUTELY NO WARRANTY; without event the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for details at
https://www.gnu.org/licenses/gpl-3.0.html
This is free software, and you are welcome to redistribute it
under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 3 of the License,
or (at your option) any later version.
DESCRIPTION
The physics world
*/
#include "World.h"
World* World::GetWorld() {

View File

@ -1,3 +1,25 @@
/**
@file
@author Dane Johnson <dane@danejohnson.org>
@section LICENSE
Couch Copyright (C) 2021 Dane Johnson
This program comes with ABSOLUTELY NO WARRANTY; without event the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for details at
https://www.gnu.org/licenses/gpl-3.0.html
This is free software, and you are welcome to redistribute it
under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 3 of the License,
or (at your option) any later version.
@section DESCRIPTION
The physics world
*/
#ifndef WORLD_H
#define WORLD_H
@ -5,10 +27,24 @@
#include "Rigidbody.h"
/**
World is the object that performs the rigidbody physics simulation. Presently there is only one world.
*/
class World {
public:
/**
@returns the World singleton
*/
static World* GetWorld();
/**
Add a rigidbody to the physics simulation
@param rigidbody the rigidbody to add
*/
void AddRigidbody(Rigidbody *rigidbody);
/**
Advance the physics simulation
@param delta the time that has passed since the last physics update
*/
void Step(float delta);
private:
static World* world;

View File

@ -80,6 +80,7 @@ int main() {
Lua *lua = new Lua();
lua->Initialize();
double lastTime = glfwGetTime();
double delta = 0.0;