From: Javier Sancho Date: Sun, 20 Oct 2019 16:29:12 +0000 (+0200) Subject: First Person Shooter (FPS) camera X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=c4148299267b63f38053b3ba15efd76db0d8bdc4;p=c-irrlicht.git First Person Shooter (FPS) camera --- diff --git a/Makefile.am b/Makefile.am index 5131ea1..98935f0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -34,4 +34,5 @@ pkginclude_HEADERS = \ include/rect.h \ include/SColor.h \ include/SExposedVideoData.h \ + include/SKeyMap.h \ include/vector3d.h diff --git a/include/ISceneManager.h b/include/ISceneManager.h index 6153726..37cc747 100644 --- a/include/ISceneManager.h +++ b/include/ISceneManager.h @@ -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 index 0000000..805e930 --- /dev/null +++ b/include/SKeyMap.h @@ -0,0 +1,27 @@ +/* c-irrlicht --- C bindings for Irrlicht Engine + + Copyright (C) 2019 Javier Sancho + + 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 + . +*/ + +#ifndef __C_S_KEY_MAP_H_INCLUDED__ +#define __C_S_KEY_MAP_H_INCLUDED__ + +typedef void irr_SkeyMap; + +#endif diff --git a/include/cirrlicht.h b/include/cirrlicht.h index 9846a48..ed0819a 100644 --- a/include/cirrlicht.h +++ b/include/cirrlicht.h @@ -42,6 +42,7 @@ #include "rect.h" #include "SColor.h" #include "SExposedVideoData.h" +#include "SKeyMap.h" #include "vector3d.h" #ifdef __cplusplus diff --git a/src/ISceneManager.cpp b/src/ISceneManager.cpp index 71d421f..a3a24b4 100644 --- a/src/ISceneManager.cpp +++ b/src/ISceneManager.cpp @@ -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,