1 /* c-irrlicht --- C bindings for Irrlicht Engine
3 Copyright (C) 2019 Javier Sancho <jsf@jsancho.org>
5 This file is part of c-irrlicht.
7 c-irrlicht is free software; you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License as
9 published by the Free Software Foundation; either version 3 of the
10 License, or (at your option) any later version.
12 c-irrlicht is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
17 You should have received a copy of the GNU Lesser General Public
18 License along with guile-irrlicht. If not, see
19 <http://www.gnu.org/licenses/>.
22 #include <irrlicht/irrlicht.h>
23 #include "ISceneManager.h"
26 irr_scene_IAnimatedMeshSceneNode*
27 irr_scene_addAnimatedMeshSceneNode(irr_scene_ISceneManager* smgr,
28 irr_scene_IAnimatedMesh* mesh,
29 irr_scene_ISceneNode* parent,
31 irr_core_vector3df* position,
32 irr_core_vector3df* rotation,
33 irr_core_vector3df* scale,
34 int alsoAddIfMeshPointerZero)
36 const irr::core::vector3df iPosition =
38 irr::core::vector3df(position->x, position->y, position->z) :
39 irr::core::vector3df(0, 0, 0);
41 const irr::core::vector3df iRotation =
43 irr::core::vector3df(rotation->x, rotation->y, rotation->z) :
44 irr::core::vector3df(0, 0, 0);
46 const irr::core::vector3df& iScale =
48 irr::core::vector3df(scale->x, scale->y, scale->z) :
49 irr::core::vector3df(1, 1, 1);
51 return (irr_scene_IAnimatedMeshSceneNode*)
52 ((irr::scene::ISceneManager*)smgr)
53 ->addAnimatedMeshSceneNode((irr::scene::IAnimatedMesh*)mesh,
54 (irr::scene::ISceneNode*)parent,
59 alsoAddIfMeshPointerZero);
62 irr_scene_ICameraSceneNode*
63 irr_scene_addCameraSceneNode(irr_scene_ISceneManager* smgr,
64 irr_scene_ISceneNode* parent,
65 irr_core_vector3df* position,
66 irr_core_vector3df* lookat,
70 const irr::core::vector3df& iPosition =
72 irr::core::vector3df(position->x, position->y, position->z) :
73 irr::core::vector3df(0, 0, 0);
75 const irr::core::vector3df& iLookat =
77 irr::core::vector3df(lookat->x, lookat->y, lookat->z) :
78 irr::core::vector3df(0, 0, 100);
80 return (irr_scene_ICameraSceneNode*)
81 ((irr::scene::ISceneManager*)smgr)
82 ->addCameraSceneNode((irr::scene::ISceneNode*)parent,
89 irr_scene_IMeshSceneNode*
90 irr_scene_addOctreeSceneNodeAM(irr_scene_ISceneManager* smgr,
91 irr_scene_IAnimatedMesh* mesh,
92 irr_scene_ISceneNode* parent,
94 int minimalPolysPerNode,
95 int alsoAddIfMeshPointerZero)
97 return ((irr::scene::ISceneManager*)smgr)
98 ->addOctreeSceneNode((irr::scene::IAnimatedMesh*)mesh,
99 (irr::scene::ISceneNode*)parent,
102 alsoAddIfMeshPointerZero);
106 irr_scene_drawAll(irr_scene_ISceneManager* smgr)
108 ((irr::scene::ISceneManager*)smgr)->drawAll();
112 irr_scene_IAnimatedMesh*
113 irr_scene_getMesh(irr_scene_ISceneManager* smgr,
114 const char* filename)
116 return (irr_scene_IAnimatedMesh*)
117 ((irr::scene::ISceneManager*)smgr)->getMesh(filename);