]> code.bitgloo.com Git - clyne/gamedev2.git/commitdiff
Added new physics component that allows entities to fall
authorAndy Belle-Isle <drumsetmonkey@gmail.com>
Sat, 7 Sep 2019 05:11:57 +0000 (01:11 -0400)
committerAndy Belle-Isle <drumsetmonkey@gmail.com>
Sat, 7 Sep 2019 05:11:57 +0000 (01:11 -0400)
src/components/Physics.hpp [new file with mode: 0644]
src/components/Player.hpp

diff --git a/src/components/Physics.hpp b/src/components/Physics.hpp
new file mode 100644 (file)
index 0000000..378e87f
--- /dev/null
@@ -0,0 +1,41 @@
+/**
+ * @file Physics.hpp
+ * Copyright (C) 2019  Belle-Isle, Andrew <drumsetmonkey@gmail.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef COMPONENT_PHYSICS_HPP_
+#define COMPONENT_PHYSICS_HPP_
+
+#include "Component.hpp"
+
+struct Physics : Component<Physics>
+{
+public:
+    bool standing = true;
+    Physics FromLua([[maybe_unused]] sol::object ref)
+    {
+        return *this;
+    }
+
+    void serialize([[maybe_unused]] cereal::JSONOutputArchive& ar) final {}
+    void serialize([[maybe_unused]] cereal::JSONInputArchive& ar) final {}
+
+    std::string serializeName(void) const final {
+        return "Physics";
+    }
+};
+
+#endif//COMPONENT_PHYSICS_HPP_
index 33db1eb3dd788930140d7fc45488e138640a2876..a550c4fabfdfd3fad45d4d6e2193b907174b2f49 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * @file Player.h
+ * @file Player.hpp
  * Component for designating player-controlled entities.
  *
  * Copyright (C) 2019 Clyne Sullivan