]> git.jsancho.org Git - c-irrlicht.git/commitdiff
Scene node animator
authorJavier Sancho <jsf@jsancho.org>
Thu, 5 Dec 2019 12:21:18 +0000 (13:21 +0100)
committerJavier Sancho <jsf@jsancho.org>
Thu, 5 Dec 2019 12:21:18 +0000 (13:21 +0100)
Makefile.am
include/IFileSystem.h
include/ISceneManager.h
include/ISceneNode.h
include/ISceneNodeAnimator.h [new file with mode: 0644]
include/cirrlicht.h
src/IFileSystem.cpp
src/ISceneManager.cpp
src/ISceneNode.cpp

index f136bcb65d100082c49b2b2edbaf9368b7c8f24c..641b6d1943a2ef7969bd23157e7e1ad2337d9221 100644 (file)
@@ -35,6 +35,7 @@ pkginclude_HEADERS = \
   include/irrTypes.h \
   include/ISceneManager.h \
   include/ISceneNode.h \
+  include/ISceneNodeAnimator.h \
   include/ITexture.h \
   include/IVideoDriver.h \
   include/matrix4.h \
index 26ab0f313e400ffcd51d41e7c0210be67343d619..e1942a34591d3982a08df330cf1acb9add702fc9 100644 (file)
@@ -31,13 +31,14 @@ typedef void irr_io_IFileSystem;
 extern "C" {
 #endif
 
-  int irr_io_addFileArchive(irr_io_IFileSystem* filesystem,
-                            const char* filename,
-                            bool ignoreCase,
-                            bool ignorePaths,
-                            irr_io_E_FILE_ARCHIVE_TYPE archiveType,
-                            const char* password,
-                            irr_io_IFileArchive** retArchive);
+  int
+  irr_io_addFileArchive(irr_io_IFileSystem* filesystem,
+                        const char* filename,
+                        bool ignoreCase,
+                        bool ignorePaths,
+                        irr_io_E_FILE_ARCHIVE_TYPE archiveType,
+                        const char* password,
+                        irr_io_IFileArchive** retArchive);
 
 #ifdef __cplusplus
 }
index 3074f577035ffaaaf9b6a5f1043e697b7f480ecd..4e276864ad04d23e4d2c71ef2ebcc040cbafb813 100644 (file)
@@ -32,6 +32,7 @@
 #include "ICameraSceneNode.h"
 #include "IMeshSceneNode.h"
 #include "ISceneNode.h"
+#include "ISceneNodeAnimator.h"
 #include "SKeyMap.h"
 #include "SMaterial.h"
 #include "vector3d.h"
@@ -93,6 +94,10 @@ extern "C" {
                                int32_t minimalPolysPerNode,
                                bool alsoAddIfMeshPointerZero);
 
+  irr_scene_ISceneNodeAnimator*
+  irr_scene_createRotationAnimator(irr_scene_ISceneManager* smgr,
+                                   irr_core_vector3df* rotationSpeed);
+
   void
   irr_scene_drawAll(irr_scene_ISceneManager* smgr);
 
index c7b1916fece663b5eced0657c724a4154700f42e..27a63f06bfa8bd84e2003ce5633de93770614d79 100644 (file)
@@ -26,6 +26,7 @@
 #include <stdbool.h>
 
 #include "EMaterialFlags.h"
+#include "ISceneNodeAnimator.h"
 #include "ITexture.h"
 #include "matrix4.h"
 #include "vector3d.h"
@@ -36,6 +37,10 @@ typedef void irr_scene_ISceneNode;
 extern "C" {
 #endif
 
+  void
+  irr_scene_addAnimator(irr_scene_ISceneNode* node,
+                        irr_scene_ISceneNodeAnimator* animator);
+
   irr_core_matrix4*
   irr_scene_getAbsoluteTransformation(irr_scene_ISceneNode* node);
 
diff --git a/include/ISceneNodeAnimator.h b/include/ISceneNodeAnimator.h
new file mode 100644 (file)
index 0000000..227dd70
--- /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_SCENE_NODE_ANIMATOR_H_INCLUDED__
+#define __C_I_SCENE_NODE_ANIMATOR_H_INCLUDED__
+
+typedef void irr_scene_ISceneNodeAnimator;
+
+#endif
index 8841fe41a6ac8f6b0b35442a73031fee04b7ac57..828a892a1cb5f6dc24ad81caa4224a83c3a7813b 100644 (file)
@@ -44,6 +44,7 @@
 #include "irrTypes.h"
 #include "ISceneManager.h"
 #include "ISceneNode.h"
+#include "ISceneNodeAnimator.h"
 #include "ITexture.h"
 #include "IVideoDriver.h"
 #include "matrix4.h"
index 42ff300eb5491f30097977494dbcc625ac537ca0..4ed4917f7cc846f08bd251e3a4f6a7dea9c852cd 100644 (file)
 #include "IFileSystem.h"
 
 extern "C" {
-  int irr_io_addFileArchive(irr_io_IFileSystem* filesystem,
-                            const char* filename,
-                            bool ignoreCase,
-                            bool ignorePaths,
-                            irr_io_E_FILE_ARCHIVE_TYPE archiveType,
-                            const char* password,
-                            irr_io_IFileArchive** retArchive)
+  int
+  irr_io_addFileArchive(irr_io_IFileSystem* filesystem,
+                        const char* filename,
+                        bool ignoreCase,
+                        bool ignorePaths,
+                        irr_io_E_FILE_ARCHIVE_TYPE archiveType,
+                        const char* password,
+                        irr_io_IFileArchive** retArchive)
   {
     return ((irr::io::IFileSystem*)filesystem)
       ->addFileArchive(filename,
index f4f2c87e6b05b757a0e8a024f01ec9b85eaa8b63..e7cefb8ec742f9bac47028a3ed4a10dbdcb91055 100644 (file)
@@ -236,6 +236,17 @@ extern "C" {
                            alsoAddIfMeshPointerZero);
   }
 
+  irr_scene_ISceneNodeAnimator*
+  irr_scene_createRotationAnimator(irr_scene_ISceneManager* smgr,
+                                   irr_core_vector3df* rotationSpeed)
+  {
+    const irr::core::vector3df& irrRotationSpeed =
+      irr::core::vector3df(rotationSpeed->x, rotationSpeed->y, rotationSpeed->z);
+
+    return ((irr::scene::ISceneManager*)smgr)
+      ->createRotationAnimator(irrRotationSpeed);
+  }
+
   void
   irr_scene_drawAll(irr_scene_ISceneManager* smgr)
   {
index 57273ab22038eb58ea1fd9ecf3a7ad77f5420fb1..a2c90a7f9392633fede8d690663b923dad827d88 100644 (file)
 #include "ISceneNode.h"
 
 extern "C" {
+  void
+  irr_scene_addAnimator(irr_scene_ISceneNode* node,
+                        irr_scene_ISceneNodeAnimator* animator)
+  {
+    ((irr::scene::ISceneNode*)node)
+      ->addAnimator((irr::scene::ISceneNodeAnimator*)animator);
+  }
+
   irr_core_matrix4*
   irr_scene_getAbsoluteTransformation(irr_scene_ISceneNode* node)
   {