]> git.jsancho.org Git - c-irrlicht.git/commitdiff
ICameraSceneNode and addCameraSceneNode
authorJavier Sancho <jsf@jsancho.org>
Sun, 13 Oct 2019 13:30:13 +0000 (15:30 +0200)
committerJavier Sancho <jsf@jsancho.org>
Sun, 13 Oct 2019 13:30:13 +0000 (15:30 +0200)
Makefile.am
include/ICameraSceneNode.h [new file with mode: 0644]
include/ISceneManager.h
include/cirrlicht.h
src/ISceneManager.cpp

index 45b7bdbfd4043f9112e905fa42585112ba6f37f2..63eccfe2c12f3ff698d6d3117beffd09cdddcff2 100644 (file)
@@ -17,6 +17,7 @@ include_HEADERS = \
   include/EMaterialFlags.h \
   include/IAnimatedMeshMD2.h \
   include/IAnimatedMeshSceneNode.h \
+  include/ICameraSceneNode.h \
   include/IGUIElement.h \
   include/IGUIEnvironment.h \
   include/IGUIStaticText.h \
diff --git a/include/ICameraSceneNode.h b/include/ICameraSceneNode.h
new file mode 100644 (file)
index 0000000..2793124
--- /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_I_CAMERA_SCENE_NODE_H_INCLUDED__
+#define __C_I_CAMERA_SCENE_NODE_H_INCLUDED__
+
+typedef void irr_scene_ICameraSceneNode;
+
+#endif
index 728c60753d635068236ce388044cd907699795ca..d3ee3aeb01b1fb09361f7c223ad06c59894ed940 100644 (file)
@@ -23,6 +23,7 @@
 #define __C_SCENE_MANAGER_H_INCLUDED__
 
 #include "IAnimatedMeshSceneNode.h"
+#include "ICameraSceneNode.h"
 #include "vector3d.h"
 
 typedef void irr_scene_IAnimatedMesh;
@@ -43,6 +44,14 @@ extern "C" {
                                                    irr_core_vector3df* scale,
                                                    bool alsoAddIfMeshPointerZero);
 
+  irr_scene_ICameraSceneNode*
+  addCameraSceneNode(irr_scene_ISceneManager* smgr,
+                     irr_scene_ISceneNode* parent,
+                     irr_core_vector3df* position,
+                     irr_core_vector3df* lookat,
+                     int32_t id,
+                     bool makeActive);
+
   irr_scene_IAnimatedMesh*
   irr_scene_ISceneManager_getMesh(irr_scene_ISceneManager* smgr,
                                   const char* filename);
index a091b5fc260de3faf1653313fae71995851b2449..8faa0e3de020d5d3fc31247545e242831a9e8f5a 100644 (file)
@@ -27,6 +27,7 @@
 #include "EMaterialFlags.h"
 #include "IAnimatedMeshMD2.h"
 #include "IAnimatedMeshSceneNode.h"
+#include "ICameraSceneNode.h"
 #include "IGUIEnvironment.h"
 #include "IGUIElement.h"
 #include "IGUIStaticText.h"
index 83dcda1a8997e23046ed6a704e4917bb847d0938..230a3eacfb5e00bbe9c5df0825d82c4ab70c62b4 100644 (file)
@@ -52,6 +52,28 @@ extern "C" {
                                                                    alsoAddIfMeshPointerZero);
   }
 
+  irr_scene_ICameraSceneNode*
+  addCameraSceneNode(irr_scene_ISceneManager* smgr,
+                     irr_scene_ISceneNode* parent,
+                     irr_core_vector3df* position,
+                     irr_core_vector3df* lookat,
+                     int32_t id,
+                     bool makeActive)
+  {
+    const irr::core::vector3df& iPosition = irr::core::vector3df(position->x,
+                                                                 position->y,
+                                                                 position->z);
+    const irr::core::vector3df& iLookat = irr::core::vector3df(lookat->x,
+                                                               lookat->y,
+                                                               lookat->z);
+    return (irr_scene_ICameraSceneNode*)
+      ((irr::scene::ISceneManager*)smgr)->addCameraSceneNode((irr::scene::ISceneNode*)parent,
+                                                             iPosition,
+                                                             iLookat,
+                                                             id,
+                                                             makeActive);
+  }
+
   irr_scene_IAnimatedMesh*
   irr_scene_ISceneManager_getMesh(irr_scene_ISceneManager* smgr,
                                   const char* filename)