X-Git-Url: https://git.jsancho.org/?p=guile-irrlicht.git;a=blobdiff_plain;f=src%2Fscene-node.cpp;fp=src%2Fscene-node.cpp;h=0000000000000000000000000000000000000000;hp=3700818f4c290eeeea6dff21c33f046347b87e7e;hb=d392bfc335713faab44275624d8fd78139880975;hpb=3bb58c2b45af12c0f9c9eac648e67ac6fa90e104 diff --git a/src/scene-node.cpp b/src/scene-node.cpp deleted file mode 100644 index 3700818..0000000 --- a/src/scene-node.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - This file is part of guile-irrlicht. - - guile-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. - - guile-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 - . -*/ - -#include -#include -#include "gsubr.h" -#include "material-flags.h" -#include "matrix4.h" -#include "scene-node.h" -#include "vector3d.h" -#include "wrapped.h" - -using namespace irr; - -template -SCM -ISceneNode_addAnimator (SCM scene_node, - SCM animator) -{ - TSceneNode node = (TSceneNode) scm_to_irr_pointer (scene_node); - node->addAnimator ((scene::ISceneNodeAnimator*) scm_to_irr_pointer (animator)); - return SCM_UNSPECIFIED; -} - -template -SCM -ISceneNode_getAbsoluteTransformation (SCM scene_node) -{ - TSceneNode node = (TSceneNode) scm_to_irr_pointer (scene_node); - return scm_from_matrix4 (node->getAbsoluteTransformation ()); -} - -template -SCM -ISceneNode_getPosition (SCM scene_node) -{ - TSceneNode node = (TSceneNode) scm_to_irr_pointer (scene_node); - return scm_from_vector3df (node->getPosition ()); -} - -template -SCM -ISceneNode_setMaterialFlag (SCM scene_node, - SCM flag, - SCM newvalue) -{ - TSceneNode node = (TSceneNode) scm_to_irr_pointer (scene_node); - node->setMaterialFlag (scm_to_material_flag (flag), scm_to_bool (newvalue)); - return SCM_UNSPECIFIED; -} - -template -SCM -ISceneNode_setMaterialTexture (SCM scene_node, - SCM texture_layer, - SCM texture) -{ - TSceneNode node = (TSceneNode) scm_to_irr_pointer (scene_node); - node->setMaterialTexture (scm_to_uint32 (texture_layer), - (video::ITexture*) scm_to_irr_pointer (texture)); - return SCM_UNSPECIFIED; -} - -template -SCM -ISceneNode_setPosition (SCM scene_node, - SCM position) -{ - TSceneNode node = (TSceneNode) scm_to_irr_pointer (scene_node); - node->setPosition (scm_to_vector3df (position)); - return SCM_UNSPECIFIED; -} - -template -SCM -ISceneNode_setRotation (SCM scene_node, - SCM rotation) -{ - TSceneNode node = (TSceneNode) scm_to_irr_pointer (scene_node); - node->setRotation (scm_to_vector3df (rotation)); - return SCM_UNSPECIFIED; -} - -template -SCM -ISceneNode_setScale (SCM scene_node, - SCM scale) -{ - TSceneNode node = (TSceneNode) scm_to_irr_pointer (scene_node); - node->setScale (scm_to_vector3df (scale)); - return SCM_UNSPECIFIED; -} - -void -init_scene_node (void) -{ - DEFINE_GSUBR ("IAnimatedMeshSceneNode_addAnimator", 2, 0, 0, - ISceneNode_addAnimator); - DEFINE_GSUBR ("IMeshSceneNode_addAnimator", 2, 0, 0, - ISceneNode_addAnimator); - DEFINE_GSUBR ("ISceneNode_addAnimator", 2, 0, 0, - ISceneNode_addAnimator); - - DEFINE_GSUBR ("ISceneNode_getAbsoluteTransformation", 1, 0, 0, - ISceneNode_getAbsoluteTransformation); - - DEFINE_GSUBR ("IMeshSceneNode_getPosition", 1, 0, 0, - ISceneNode_getPosition); - DEFINE_GSUBR ("ISceneNode_getPosition", 1, 0, 0, - ISceneNode_getPosition); - - DEFINE_GSUBR ("IAnimatedMeshSceneNode_setMaterialFlag", 3, 0, 0, - ISceneNode_setMaterialFlag); - DEFINE_GSUBR ("IMeshSceneNode_setMaterialFlag", 3, 0, 0, - ISceneNode_setMaterialFlag); - DEFINE_GSUBR ("ISceneNode_setMaterialFlag", 3, 0, 0, - ISceneNode_setMaterialFlag); - - DEFINE_GSUBR ("IAnimatedMeshSceneNode_setMaterialTexture", 3, 0, 0, - ISceneNode_setMaterialTexture); - DEFINE_GSUBR ("IMeshSceneNode_setMaterialTexture", 3, 0, 0, - ISceneNode_setMaterialTexture); - DEFINE_GSUBR ("ISceneNode_setMaterialTexture", 3, 0, 0, - ISceneNode_setMaterialTexture); - - DEFINE_GSUBR ("IMeshSceneNode_setPosition", 2, 0, 0, - ISceneNode_setPosition); - DEFINE_GSUBR ("ISceneNode_setPosition", 2, 0, 0, - ISceneNode_setPosition); - - DEFINE_GSUBR ("IAnimatedMeshSceneNode_setRotation", 2, 0, 0, - ISceneNode_setRotation); - DEFINE_GSUBR ("ICameraSceneNode_setRotation", 2, 0, 0, - ISceneNode_setRotation); - DEFINE_GSUBR ("ISceneNode_setRotation", 2, 0, 0, - ISceneNode_setRotation); - - DEFINE_GSUBR ("IAnimatedMeshSceneNode_setScale", 2, 0, 0, - ISceneNode_setScale); - DEFINE_GSUBR ("ISceneNode_setScale", 2, 0, 0, - ISceneNode_setScale); -}