]> git.jsancho.org Git - c-irrlicht.git/commitdiff
First Person Shooter (FPS) camera
authorJavier Sancho <jsf@jsancho.org>
Sun, 20 Oct 2019 16:29:12 +0000 (18:29 +0200)
committerJavier Sancho <jsf@jsancho.org>
Sun, 20 Oct 2019 16:29:12 +0000 (18:29 +0200)
Makefile.am
include/ISceneManager.h
include/SKeyMap.h [new file with mode: 0644]
include/cirrlicht.h
src/ISceneManager.cpp

index 5131ea14486e0bd8783dcffa255fb81f5aade74a..98935f0ce0ec950ea1974e8990575c61b2b9522d 100644 (file)
@@ -34,4 +34,5 @@ pkginclude_HEADERS = \
   include/rect.h \
   include/SColor.h \
   include/SExposedVideoData.h \
+  include/SKeyMap.h \
   include/vector3d.h
index 6153726051257321062590945e8c159596eccb7f..37cc7476714df0b8522504adb5555c010042be68 100644 (file)
@@ -27,6 +27,7 @@
 #include "ICameraSceneNode.h"
 #include "IMeshSceneNode.h"
 #include "ISceneNode.h"
+#include "SKeyMap.h"
 #include "vector3d.h"
 
 typedef void irr_scene_ISceneManager;
@@ -53,6 +54,19 @@ extern "C" {
                                int id,
                                int makeActive);
 
+  irr_scene_ICameraSceneNode*
+  irr_scene_addCameraSceneNodeFPS(irr_scene_ISceneManager* smgr,
+                                  irr_scene_ISceneNode* parent,
+                                  float rotateSpeed,
+                                  float moveSpeed,
+                                  int id,
+                                  irr_SkeyMap* keyMapArray,
+                                  int keyMapSize,
+                                  int noVerticalMovement,
+                                  float jumpSpeed,
+                                  int invertMouse,
+                                  int makeActive);
+
   irr_scene_IMeshSceneNode*
   irr_scene_addOctreeSceneNodeAM(irr_scene_ISceneManager* smgr,
                                  irr_scene_IAnimatedMesh* mesh,
diff --git a/include/SKeyMap.h b/include/SKeyMap.h
new file mode 100644 (file)
index 0000000..805e930
--- /dev/null
@@ -0,0 +1,27 @@
+/* c-irrlicht --- C bindings for Irrlicht Engine
+
+   Copyright (C) 2019 Javier Sancho <jsf@jsancho.org>
+
+   This file is part of c-irrlicht.
+
+   c-irrlicht is free software; you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 3 of the
+   License, or (at your option) any later version.
+
+   c-irrlicht 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 Lesser General Public
+   License along with guile-irrlicht.  If not, see
+   <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __C_S_KEY_MAP_H_INCLUDED__
+#define __C_S_KEY_MAP_H_INCLUDED__
+
+typedef void irr_SkeyMap;
+
+#endif
index 9846a48e4b88921b7c65d67f7611631f4c0dbf3a..ed0819a25201de4f08a183fbb70e5f63e1af8ad1 100644 (file)
@@ -42,6 +42,7 @@
 #include "rect.h"
 #include "SColor.h"
 #include "SExposedVideoData.h"
+#include "SKeyMap.h"
 #include "vector3d.h"
 
 #ifdef __cplusplus
index 71d421f801944d3024483d19e85a5df3c60528e2..a3a24b44e611dc0da351f813fee1f1a0a0137841 100644 (file)
@@ -86,6 +86,32 @@ extern "C" {
                            makeActive);
   }
 
+  irr_scene_ICameraSceneNode*
+  irr_scene_addCameraSceneNodeFPS(irr_scene_ISceneManager* smgr,
+                                  irr_scene_ISceneNode* parent,
+                                  float rotateSpeed,
+                                  float moveSpeed,
+                                  int id,
+                                  irr_SkeyMap* keyMapArray,
+                                  int keyMapSize,
+                                  int noVerticalMovement,
+                                  float jumpSpeed,
+                                  int invertMouse,
+                                  int makeActive)
+  {
+    return ((irr::scene::ISceneManager*)smgr)
+      ->addCameraSceneNodeFPS((irr::scene::ISceneNode*)parent,
+                              rotateSpeed,
+                              moveSpeed,
+                              id,
+                              (irr::SKeyMap*)keyMapArray,
+                              keyMapSize,
+                              noVerticalMovement,
+                              jumpSpeed,
+                              invertMouse,
+                              makeActive);
+  }
+
   irr_scene_IMeshSceneNode*
   irr_scene_addOctreeSceneNodeAM(irr_scene_ISceneManager* smgr,
                                  irr_scene_IAnimatedMesh* mesh,