]> git.jsancho.org Git - guile-irrlicht.git/commitdiff
create-fly-circle-animator
authorJavier Sancho <jsf@jsancho.org>
Wed, 8 Apr 2020 18:28:42 +0000 (20:28 +0200)
committerJavier Sancho <jsf@jsancho.org>
Wed, 8 Apr 2020 18:28:42 +0000 (20:28 +0200)
src/scene-manager.cpp
src/scene-manager.h

index f7a2b12f094104c9b106c96622e5fe7bdeca5454..c8bd6679c3c0942ef94898b27788cbd8eaa7822c 100644 (file)
@@ -57,6 +57,8 @@ extern "C" {
                         (scm_t_subr)irr_scene_addOctreeSceneNode);
     scm_c_define_gsubr ("add-sphere-scene-node!", 1, 0, 1,
                         (scm_t_subr)irr_scene_addSphereSceneNode);
+    scm_c_define_gsubr ("create-fly-circle-animator", 1, 0, 1,
+                        (scm_t_subr)irr_scene_createFlyCircleAnimator);
     scm_c_define_gsubr ("create-rotation-animator", 2, 0, 0,
                         (scm_t_subr)irr_scene_createRotationAnimator);
     scm_c_define_gsubr ("get-mesh", 2, 0, 0, (scm_t_subr)irr_scene_getMesh);
@@ -64,8 +66,9 @@ extern "C" {
     scm_c_define_gsubr ("get-scene-manager", 1, 0, 0, (scm_t_subr)irr_getSceneManager);
     scm_c_export ("add-animated-mesh-scene-node!", "add-camera-scene-node!",
                   "add-camera-scene-node-fps!", "add-custom-scene-node!", "add-cube-scene-node!",
-                  "add-octree-scene-node!", "add-sphere-scene-node!", "create-rotation-animator",
-                  "get-mesh", "get-root-scene-node", "get-scene-manager", NULL);
+                  "add-octree-scene-node!", "add-sphere-scene-node!", "create-fly-circle-animator",
+                  "create-rotation-animator", "get-mesh", "get-root-scene-node",
+                  "get-scene-manager", NULL);
   }
 
   DEFINE_WRAPPED_TYPE (irr::scene::ISceneManager*, "scene-manager",
@@ -403,6 +406,41 @@ extern "C" {
     return wrap_mesh_scene_node (node);
   }
 
+  SCM
+  irr_scene_createFlyCircleAnimator (SCM wrapped_scene_manager,
+                                     SCM rest)
+  {
+    SCM center = scm_list_3 (scm_from_double (0),
+                             scm_from_double (0),
+                             scm_from_double (0));
+    SCM radius = scm_from_double (100);
+    SCM speed = scm_from_double (0.001);
+    SCM direction = scm_list_3 (scm_from_double (0),
+                                scm_from_double (1),
+                                scm_from_double (0));
+    SCM start_position = scm_from_double (0);
+    SCM radius_ellipsoid = scm_from_double (0);
+
+    scm_c_bind_keyword_arguments ("create-fly-circle-animator", rest, (scm_t_keyword_arguments_flags)0,
+                                  scm_from_utf8_keyword ("center"), &center,
+                                  scm_from_utf8_keyword ("radius"), &radius,
+                                  scm_from_utf8_keyword ("speed"), &speed,
+                                  scm_from_utf8_keyword ("direction"), &direction,
+                                  scm_from_utf8_keyword ("start-position"), &start_position,
+                                  scm_from_utf8_keyword ("radius-ellipsoid"), &radius_ellipsoid,
+                                  SCM_UNDEFINED);
+
+    irr::scene::ISceneManager* smgr = unwrap_scene_manager (wrapped_scene_manager);
+    irr::scene::ISceneNodeAnimator* anim =
+      smgr->createFlyCircleAnimator (scm_to_vector3df (center),
+                                     scm_to_double (radius),
+                                     scm_to_double (speed),
+                                     scm_to_vector3df (direction),
+                                     scm_to_double (start_position),
+                                     scm_to_double (radius_ellipsoid));
+    return wrap_scene_node_animator (anim);
+  }
+
   SCM
   irr_scene_createRotationAnimator (SCM wrapped_scene_manager,
                                     SCM rotation_speed)
index e5ab953c7cecbcb76842d0dc91231e4572331f33..a2c0a5c125cfd35dd08391e9ff465b9493572171 100644 (file)
@@ -68,6 +68,10 @@ extern "C" {
   irr_scene_addSphereSceneNode (SCM wrapped_scene_manager,
                                 SCM rest);
 
+  SCM
+  irr_scene_createFlyCircleAnimator (SCM wrapped_scene_manager,
+                                     SCM rest);
+
   SCM
   irr_scene_createRotationAnimator (SCM wrapped_scene_manager,
                                     SCM rotation_speed);