libCIrrlicht_la_CPPFLAGS = -I$(top_srcdir)/include
libCIrrlicht_la_LDFLAGS = -version-info 0:1
pkginclude_HEADERS = \
+ include/aabbox3d.h \
include/cirrlicht.h \
include/dimension2d.h \
include/EDriverTypes.h \
include/IAnimatedMeshSceneNode.h \
include/ICameraSceneNode.h \
include/ICursorControl.h \
+ include/ICustomSceneNode.h \
include/IFileArchive.h \
include/IFileSystem.h \
include/IGUIElement.h \
include/SColor.h \
include/SExposedVideoData.h \
include/SKeyMap.h \
+ include/SMaterial.h \
include/vector3d.h
--- /dev/null
+/* 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_CUSTOM_SCENE_NODE_H_INCLUDED__
+#define __C_I_CUSTOM_SCENE_NODE_H_INCLUDED__
+
+typedef void irr_scene_ICustomSceneNode;
+
+#endif
#ifndef __C_I_SCENE_MANAGER_H_INCLUDED__
#define __C_I_SCENE_MANAGER_H_INCLUDED__
+#include "aabbox3d.h"
#include "IAnimatedMesh.h"
#include "IAnimatedMeshSceneNode.h"
#include "ICameraSceneNode.h"
+#include "ICustomSceneNode.h"
#include "IMeshSceneNode.h"
#include "ISceneNode.h"
#include "SKeyMap.h"
+#include "SMaterial.h"
#include "vector3d.h"
typedef void irr_scene_ISceneManager;
int invertMouse,
int makeActive);
+ irr_scene_ICustomSceneNode*
+ irr_scene_addCustomSceneNode(irr_scene_ISceneManager* smgr,
+ irr_scene_ISceneNode* parent,
+ int id,
+ irr_core_vector3df* position,
+ irr_core_vector3df* rotation,
+ irr_core_vector3df* scale,
+ void (*render)(),
+ irr_core_aabbox3d_f32* (*getBoundingBox)(),
+ int (*getMaterialCount)(),
+ irr_video_SMaterial* (*getMaterial)(unsigned int i));
+
irr_scene_IMeshSceneNode*
irr_scene_addOctreeSceneNodeAM(irr_scene_ISceneManager* smgr,
irr_scene_IAnimatedMesh* mesh,
--- /dev/null
+/* 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_IRR_S_MATERIAL_H_INCLUDED__
+#define __C_IRR_S_MATERIAL_H_INCLUDED__
+
+typedef struct
+{
+ int wireframe;
+ int lighting;
+} irr_video_SMaterial;
+
+#endif
--- /dev/null
+/* 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_IRR_AABBOX_3D_H_INCLUDED__
+#define __C_IRR_AABBOX_3D_H_INCLUDED__
+
+typedef struct{
+} irr_core_aabbox3d_f32;
+
+#endif
#ifndef __C_IRRLICHT_H_INCLUDED__
#define __C_IRRLICHT_H_INCLUDED__
+#include "aabbox3d.h"
#include "dimension2d.h"
#include "EDriverTypes.h"
#include "EMaterialFlags.h"
#include "IAnimatedMeshSceneNode.h"
#include "ICameraSceneNode.h"
#include "ICursorControl.h"
+#include "ICustomSceneNode.h"
#include "IFileArchive.h"
#include "IFileSystem.h"
#include "IGUIEnvironment.h"
#include "SColor.h"
#include "SExposedVideoData.h"
#include "SKeyMap.h"
+#include "SMaterial.h"
#include "vector3d.h"
#ifdef __cplusplus
#include <irrlicht/irrlicht.h>
#include "ISceneManager.h"
+class CustomSceneNode : public irr::scene::ISceneNode
+{
+ void (*Render)();
+ irr_core_aabbox3d_f32* (*GetBoundingBox)();
+ int (*GetMaterialCount)();
+ irr_video_SMaterial* (*GetMaterial)(unsigned int i);
+
+public:
+ CustomSceneNode(irr::scene::ISceneNode* parent,
+ irr::scene::ISceneManager* smgr,
+ irr::s32 id,
+ const irr::core::vector3df& position,
+ const irr::core::vector3df& rotation,
+ const irr::core::vector3df& scale,
+ void (*render)(),
+ irr_core_aabbox3d_f32* (*getBoundingBox)(),
+ int (*getMaterialCount)(),
+ irr_video_SMaterial* (*getMaterial)(unsigned int i))
+ : irr::scene::ISceneNode(parent, smgr, id, position, rotation, scale)
+ {
+ Render = render;
+ GetBoundingBox = getBoundingBox;
+ GetMaterialCount = getMaterialCount;
+ GetMaterial = getMaterial;
+ }
+
+ virtual void OnRegisterSceneNode()
+ {
+ if (IsVisible) {
+ SceneManager->registerNodeForRendering(this);
+ }
+
+ ISceneNode::OnRegisterSceneNode();
+ }
+
+ virtual void render()
+ {
+ Render();
+ }
+
+ virtual const irr::core::aabbox3d<irr::f32>& getBoundingBox() const
+ {
+ irr_core_aabbox3d_f32* box = GetBoundingBox();
+ irr::core::aabbox3d<irr::f32>* irrBox = new irr::core::aabbox3d<irr::f32>();
+ return *irrBox;
+ }
+
+ virtual irr::u32 getMaterialCount() const
+ {
+ return GetMaterialCount();
+ }
+
+ virtual irr::video::SMaterial& getMaterial(irr::u32 i)
+ {
+ irr_video_SMaterial* material = GetMaterial(i);
+ irr::video::SMaterial* irrMaterial = new irr::video::SMaterial();
+ irrMaterial->Wireframe = material->wireframe;
+ irrMaterial->Lighting = material->lighting;
+ return *irrMaterial;
+ }
+};
+
extern "C" {
irr_scene_IAnimatedMeshSceneNode*
irr_scene_addAnimatedMeshSceneNode(irr_scene_ISceneManager* smgr,
makeActive);
}
+ irr_scene_ICustomSceneNode*
+ irr_scene_addCustomSceneNode(irr_scene_ISceneManager* smgr,
+ irr_scene_ISceneNode* parent,
+ int id,
+ irr_core_vector3df* position,
+ irr_core_vector3df* rotation,
+ irr_core_vector3df* scale,
+ void (*render)(),
+ irr_core_aabbox3d_f32* (*getBoundingBox)(),
+ int (*getMaterialCount)(),
+ irr_video_SMaterial* (*getMaterial)(unsigned int i))
+ {
+ if (parent == NULL)
+ {
+ parent = irr_scene_getRootSceneNode(smgr);
+ }
+
+ const irr::core::vector3df iPosition =
+ position ?
+ irr::core::vector3df(position->x, position->y, position->z) :
+ irr::core::vector3df(0, 0, 0);
+
+ const irr::core::vector3df iRotation =
+ rotation ?
+ irr::core::vector3df(rotation->x, rotation->y, rotation->z) :
+ irr::core::vector3df(0, 0, 0);
+
+ const irr::core::vector3df& iScale =
+ scale ?
+ irr::core::vector3df(scale->x, scale->y, scale->z) :
+ irr::core::vector3df(1, 1, 1);
+
+ CustomSceneNode *node =
+ new CustomSceneNode((irr::scene::ISceneNode*)parent,
+ (irr::scene::ISceneManager*)smgr,
+ id,
+ iPosition,
+ iRotation,
+ iScale,
+ render,
+ getBoundingBox,
+ getMaterialCount,
+ getMaterial);
+ node->drop();
+ node = 0;
+ return NULL;
+ //return node;
+ }
+
irr_scene_IMeshSceneNode*
irr_scene_addOctreeSceneNodeAM(irr_scene_ISceneManager* smgr,
irr_scene_IAnimatedMesh* mesh,