From 33d362afbc8bb1e216e405177680255cbd44256b Mon Sep 17 00:00:00 2001 From: Dane Johnson Date: Wed, 21 Apr 2021 15:06:03 -0500 Subject: [PATCH] Add some documentation to World --- core/World.cpp | 21 +++++++++++++++++++++ core/World.h | 36 ++++++++++++++++++++++++++++++++++++ core/couch.cpp | 1 + 3 files changed, 58 insertions(+) diff --git a/core/World.cpp b/core/World.cpp index 4ff2fea..cac4579 100644 --- a/core/World.cpp +++ b/core/World.cpp @@ -1,3 +1,24 @@ +/* + Dane Johnson + + 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() { diff --git a/core/World.h b/core/World.h index 772020b..8c709a5 100644 --- a/core/World.h +++ b/core/World.h @@ -1,3 +1,25 @@ +/** + @file + @author Dane Johnson + + @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; diff --git a/core/couch.cpp b/core/couch.cpp index 1a410ed..639aa3c 100644 --- a/core/couch.cpp +++ b/core/couch.cpp @@ -80,6 +80,7 @@ int main() { Lua *lua = new Lua(); lua->Initialize(); + double lastTime = glfwGetTime(); double delta = 0.0;