#include <libguile.h>
#include "animated-mesh-scene-node.h"
+#include "camera-scene-node.h"
#include "gsubr.h"
#include "material-flags.h"
#include "matrix4.h"
DEFINE_GSUBR ("add-animator!", 2, 0, 0, irr_scene_addAnimator);
DEFINE_GSUBR ("get-absolute-transformation", 1, 0, 0, irr_scene_getAbsoluteTransformation);
DEFINE_GSUBR ("set-material-texture!", 3, 0, 0, irr_scene_setMaterialTexture);
+ DEFINE_GSUBR ("set-rotation!", 2, 0, 0, irr_scene_setRotation);
+ DEFINE_GSUBR ("set-scale!", 2, 0, 0, irr_scene_setScale);
}
DEFINE_WRAPPED_TYPE (irr::scene::ISceneNode*, "scene-node",
return SCM_UNSPECIFIED;
}
+ SCM
+ irr_scene_setRotation (SCM wrapped_scene_node,
+ SCM rotation)
+ {
+#define SET_ROTATION(NODE) NODE->setRotation (scm_to_vector3df (rotation));
+
+ if (animated_mesh_scene_node_p (wrapped_scene_node))
+ {
+ SET_ROTATION (unwrap_animated_mesh_scene_node (wrapped_scene_node));
+ }
+ else if (camera_scene_node_p (wrapped_scene_node))
+ {
+ SET_ROTATION (unwrap_camera_scene_node (wrapped_scene_node));
+ }
+ else if (scene_node_p (wrapped_scene_node))
+ {
+ SET_ROTATION (unwrap_scene_node (wrapped_scene_node));
+ }
+ else
+ {
+ scm_error (scm_arg_type_key, NULL, "Cannot set rotation to object: ~S",
+ scm_list_1 (wrapped_scene_node), scm_list_1 (wrapped_scene_node));
+ }
+
+ return SCM_UNSPECIFIED;
+ }
+
+ SCM
+ irr_scene_setScale (SCM wrapped_scene_node,
+ SCM scale)
+ {
+#define SET_SCALE(NODE) NODE->setScale (scm_to_vector3df (scale));
+
+ if (animated_mesh_scene_node_p (wrapped_scene_node))
+ {
+ SET_SCALE (unwrap_animated_mesh_scene_node (wrapped_scene_node));
+ }
+ else if (scene_node_p (wrapped_scene_node))
+ {
+ SET_SCALE (unwrap_scene_node (wrapped_scene_node));
+ }
+ else
+ {
+ scm_error (scm_arg_type_key, NULL, "Cannot set scale to object: ~S",
+ scm_list_1 (wrapped_scene_node), scm_list_1 (wrapped_scene_node));
+ }
+
+ return SCM_UNSPECIFIED;
+ }
+
}