ACLOCAL_AMFLAGS = -I m4
lib_LTLIBRARIES = libCIrrlicht.la
libCIrrlicht_la_SOURCES = \
+ src/aabbox3d.cpp \
src/CIrrlicht.cpp \
src/IAnimatedMeshSceneNode.cpp \
src/ICursorControl.cpp \
include/IAnimatedMeshSceneNode.h \
include/ICameraSceneNode.h \
include/ICursorControl.h \
- include/ICustomSceneNode.h \
include/IFileArchive.h \
include/IFileSystem.h \
include/IGUIElement.h \
include/ISceneNode.h \
include/ITexture.h \
include/IVideoDriver.h \
+ include/matrix4.h \
include/rect.h \
+ include/S3DVertex.h \
include/SColor.h \
include/SExposedVideoData.h \
include/SKeyMap.h \
include/SMaterial.h \
+ include/vector2d.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
#include "IAnimatedMesh.h"
#include "IAnimatedMeshSceneNode.h"
#include "ICameraSceneNode.h"
-#include "ICustomSceneNode.h"
#include "IMeshSceneNode.h"
#include "ISceneNode.h"
#include "SKeyMap.h"
int invertMouse,
int makeActive);
- irr_scene_ICustomSceneNode*
+ irr_scene_ISceneNode*
irr_scene_addCustomSceneNode(irr_scene_ISceneManager* smgr,
irr_scene_ISceneNode* parent,
int id,
#include "EMaterialFlags.h"
#include "ITexture.h"
+#include "matrix4.h"
#include "vector3d.h"
typedef void irr_scene_ISceneNode;
extern "C" {
#endif
+ irr_core_matrix4*
+ irr_scene_getAbsoluteTransformation(irr_scene_ISceneNode* node);
+
void
irr_scene_setMaterialFlag(irr_scene_ISceneNode* node,
irr_video_E_MATERIAL_FLAG flag,
#define __C_I_VIDEO_DRIVER_H_INCLUDED__
#include "ITexture.h"
+#include "matrix4.h"
#include "SColor.h"
#include "SExposedVideoData.h"
+#include "SMaterial.h"
#include "rect.h"
+//! enumeration for geometry transformation states
+typedef enum
+ {
+ //! View transformation
+ irr_video_ETS_VIEW = 0,
+ //! World transformation
+ irr_video_ETS_WORLD,
+ //! Projection transformation
+ irr_video_ETS_PROJECTION,
+ //! Texture transformation
+ irr_video_ETS_TEXTURE_0,
+ //! Texture transformation
+ irr_video_ETS_TEXTURE_1,
+ //! Texture transformation
+ irr_video_ETS_TEXTURE_2,
+ //! Texture transformation
+ irr_video_ETS_TEXTURE_3,
+#if _C_IRR_MATERIAL_MAX_TEXTURES_>4
+ //! Texture transformation
+ irr_video_ETS_TEXTURE_4,
+#if _C_IRR_MATERIAL_MAX_TEXTURES_>5
+ //! Texture transformation
+ irr_video_ETS_TEXTURE_5,
+#if _C_IRR_MATERIAL_MAX_TEXTURES_>6
+ //! Texture transformation
+ irr_video_ETS_TEXTURE_6,
+#if _C_IRR_MATERIAL_MAX_TEXTURES_>7
+ //! Texture transformation
+ irr_video_ETS_TEXTURE_7,
+#endif
+#endif
+#endif
+#endif
+ //! Not used
+ irr_video_ETS_COUNT
+ } irr_video_E_TRANSFORMATION_STATE;
+
+// types
typedef void irr_video_IVideoDriver;
#ifdef __cplusplus
irr_video_getTexture(irr_video_IVideoDriver* driver,
const char* filename);
+ void
+ irr_video_setMaterial(irr_video_IVideoDriver* driver,
+ const irr_video_SMaterial material);
+
+ void
+ irr_video_setTransform(irr_video_IVideoDriver* driver,
+ irr_video_E_TRANSFORMATION_STATE state,
+ irr_core_matrix4* mat);
+
#ifdef __cplusplus
}
#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_S_3D_VERTEX_H_INCLUDED__
+#define __C_IRR_S_3D_VERTEX_H_INCLUDED__
+
+#include "SColor.h"
+#include "vector2d.h"
+#include "vector3d.h"
+
+typedef struct
+{
+ irr_core_vector3df pos;
+ irr_core_vector3df normal;
+ irr_video_SColor color;
+ irr_core_vector2df tCoords;
+} irr_video_S3DVertex;
+
+#endif
#ifndef __C_IRR_AABBOX_3D_H_INCLUDED__
#define __C_IRR_AABBOX_3D_H_INCLUDED__
-typedef struct{
+#include "vector3d.h"
+
+typedef struct {
+ irr_core_vector3df minEdge;
+ irr_core_vector3df maxEdge;
} irr_core_aabbox3d_f32;
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ void
+ irr_core_aabbox3d_addInternalPoint(irr_core_aabbox3d_f32 box,
+ irr_core_vector3df p);
+
+ void
+ irr_core_aabbox3d_reset(irr_core_aabbox3d_f32 box,
+ irr_core_vector3df initValue);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif
#include "IAnimatedMeshSceneNode.h"
#include "ICameraSceneNode.h"
#include "ICursorControl.h"
-#include "ICustomSceneNode.h"
#include "IFileArchive.h"
#include "IFileSystem.h"
#include "IGUIEnvironment.h"
#include "ISceneNode.h"
#include "ITexture.h"
#include "IVideoDriver.h"
+#include "matrix4.h"
#include "rect.h"
+#include "S3DVertex.h"
#include "SColor.h"
#include "SExposedVideoData.h"
#include "SKeyMap.h"
#include "SMaterial.h"
+#include "vector2d.h"
#include "vector3d.h"
#ifdef __cplusplus
--- /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_MATRIX_H_INCLUDED__
+#define __C_IRR_MATRIX_H_INCLUDED__
+
+typedef void irr_core_matrix4;
+
+#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_VECTOR_2D_H_INCLUDED__
+#define __C_IRR_VECTOR_2D_H_INCLUDED__
+
+typedef struct
+{
+ float x;
+ float y;
+} irr_core_vector2df;
+
+#endif
makeActive);
}
- irr_scene_ICustomSceneNode*
+ irr_scene_ISceneNode*
irr_scene_addCustomSceneNode(irr_scene_ISceneManager* smgr,
irr_scene_ISceneNode* parent,
int id,
getBoundingBox,
getMaterialCount,
getMaterial);
- node->drop();
- node = 0;
- return NULL;
- //return node;
+ //node->drop();
+ //node = 0;
+ //return NULL;
+ return node;
}
irr_scene_IMeshSceneNode*
#include "ISceneNode.h"
extern "C" {
+ irr_core_matrix4*
+ irr_scene_getAbsoluteTransformation(irr_scene_ISceneNode* node)
+ {
+ return (irr_core_matrix4*)
+ &((irr::scene::ISceneNode*)node)->getAbsoluteTransformation();
+ }
+
void
irr_scene_setMaterialFlag(irr_scene_ISceneNode* node,
irr_video_E_MATERIAL_FLAG flag,
((irr::video::IVideoDriver*)driver)->getTexture(filename);
}
+ void
+ irr_video_setMaterial(irr_video_IVideoDriver* driver,
+ const irr_video_SMaterial material)
+ {
+ irr::video::SMaterial irrMaterial = irr::video::SMaterial();
+ irrMaterial.Lighting = material.lighting;
+ irrMaterial.Wireframe = material.wireframe;
+
+ ((irr::video::IVideoDriver*)driver)->setMaterial(irrMaterial);
+ }
+
+ void
+ irr_video_setTransform(irr_video_IVideoDriver* driver,
+ irr_video_E_TRANSFORMATION_STATE state,
+ irr_core_matrix4* mat)
+ {
+ ((irr::video::IVideoDriver*)driver)
+ ->setTransform((irr::video::E_TRANSFORMATION_STATE)state,
+ *(irr::core::matrix4*)mat);
+ }
}
--- /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/>.
+*/
+
+#include "aabbox3d.h"
+
+extern "C" {
+ void
+ irr_core_aabbox3d_addInternalPoint(irr_core_aabbox3d_f32 box,
+ irr_core_vector3df p)
+ {
+ if (p.x > box.maxEdge.x) box.maxEdge.x = p.x;
+ if (p.y > box.maxEdge.y) box.maxEdge.y = p.y;
+ if (p.z > box.maxEdge.z) box.maxEdge.z = p.z;
+
+ if (p.x < box.minEdge.x) box.minEdge.x = p.x;
+ if (p.y < box.minEdge.y) box.minEdge.y = p.y;
+ if (p.z < box.minEdge.z) box.minEdge.z = p.z;
+ }
+
+ void
+ irr_core_aabbox3d_reset(irr_core_aabbox3d_f32 box,
+ irr_core_vector3df initValue)
+ {
+ box.minEdge = initValue;
+ box.maxEdge = initValue;
+ }
+}