From: Javier Sancho Date: Sun, 20 Oct 2019 14:59:40 +0000 (+0200) Subject: addOctreeSceneNode for animated meshes X-Git-Url: https://git.jsancho.org/?p=c-irrlicht.git;a=commitdiff_plain;h=d468712229faeb7fdcce0836145572e0018d62d0 addOctreeSceneNode for animated meshes --- diff --git a/Makefile.am b/Makefile.am index 336eacd..5131ea1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -25,6 +25,7 @@ pkginclude_HEADERS = \ include/IGUIElement.h \ include/IGUIEnvironment.h \ include/IGUIStaticText.h \ + include/IMeshSceneNode.h \ include/IrrlichtDevice.h \ include/ISceneManager.h \ include/ISceneNode.h \ diff --git a/include/IMeshSceneNode.h b/include/IMeshSceneNode.h new file mode 100644 index 0000000..21e76e9 --- /dev/null +++ b/include/IMeshSceneNode.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_I_MESH_SCENE_NODE_H_INCLUDED__ +#define __C_I_MESH_SCENE_NODE_H_INCLUDED__ + +typedef void irr_scene_IMeshSceneNode; + +#endif diff --git a/include/ISceneManager.h b/include/ISceneManager.h index 509836b..6153726 100644 --- a/include/ISceneManager.h +++ b/include/ISceneManager.h @@ -25,6 +25,7 @@ #include "IAnimatedMesh.h" #include "IAnimatedMeshSceneNode.h" #include "ICameraSceneNode.h" +#include "IMeshSceneNode.h" #include "ISceneNode.h" #include "vector3d.h" @@ -52,6 +53,14 @@ extern "C" { int id, int makeActive); + irr_scene_IMeshSceneNode* + irr_scene_addOctreeSceneNodeAM(irr_scene_ISceneManager* smgr, + irr_scene_IAnimatedMesh* mesh, + irr_scene_ISceneNode* parent, + int id, + int minimalPolysPerNode, + int alsoAddIfMeshPointerZero); + void irr_scene_drawAll(irr_scene_ISceneManager* smgr); diff --git a/include/cirrlicht.h b/include/cirrlicht.h index 3901e08..9846a48 100644 --- a/include/cirrlicht.h +++ b/include/cirrlicht.h @@ -33,6 +33,7 @@ #include "IGUIEnvironment.h" #include "IGUIElement.h" #include "IGUIStaticText.h" +#include "IMeshSceneNode.h" #include "IrrlichtDevice.h" #include "ISceneManager.h" #include "ISceneNode.h" diff --git a/src/ISceneManager.cpp b/src/ISceneManager.cpp index bef569b..71d421f 100644 --- a/src/ISceneManager.cpp +++ b/src/ISceneManager.cpp @@ -86,6 +86,22 @@ extern "C" { makeActive); } + irr_scene_IMeshSceneNode* + irr_scene_addOctreeSceneNodeAM(irr_scene_ISceneManager* smgr, + irr_scene_IAnimatedMesh* mesh, + irr_scene_ISceneNode* parent, + int id, + int minimalPolysPerNode, + int alsoAddIfMeshPointerZero) + { + return ((irr::scene::ISceneManager*)smgr) + ->addOctreeSceneNode((irr::scene::IAnimatedMesh*)mesh, + (irr::scene::ISceneNode*)parent, + id, + minimalPolysPerNode, + alsoAddIfMeshPointerZero); + } + void irr_scene_drawAll(irr_scene_ISceneManager* smgr) {