aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/extantz/Evas_3D_demo.c
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-06-02 00:18:32 +1000
committerDavid Walter Seikel2014-06-02 00:18:32 +1000
commit923cdbef0a76190006a1a175b97836d0c3444214 (patch)
treede35b9975133929d30010b8deb18c5729d13264b /src/extantz/Evas_3D_demo.c
parentGet the from disk sim loading to work. (diff)
downloadSledjHamr-923cdbef0a76190006a1a175b97836d0c3444214.zip
SledjHamr-923cdbef0a76190006a1a175b97836d0c3444214.tar.gz
SledjHamr-923cdbef0a76190006a1a175b97836d0c3444214.tar.bz2
SledjHamr-923cdbef0a76190006a1a175b97836d0c3444214.tar.xz
Load and rez stuffs in an idler, also fix some bugs in that part.
Diffstat (limited to 'src/extantz/Evas_3D_demo.c')
-rw-r--r--src/extantz/Evas_3D_demo.c96
1 files changed, 0 insertions, 96 deletions
diff --git a/src/extantz/Evas_3D_demo.c b/src/extantz/Evas_3D_demo.c
deleted file mode 100644
index e9265da..0000000
--- a/src/extantz/Evas_3D_demo.c
+++ /dev/null
@@ -1,96 +0,0 @@
1#include "extantz.h"
2
3
4static void _animateCube(ExtantzStuffs *stuffs)
5{
6 static float angle = 0.0f;
7 static int frame = 0;
8 static int inc = 1;
9 Evas_3D_Mesh *m;
10
11 eina_accessor_data_get(stuffs->aMesh, 0, (void **) &m);
12
13 angle += 0.5;
14 if (angle > 360.0) angle -= 360.0f;
15
16 frame += inc;
17 if (frame >= 20) inc = -1;
18 else if (frame <= 0) inc = 1;
19
20 eo_do(stuffs->mesh_node,
21 evas_3d_node_orientation_angle_axis_set(angle, 1.0, 1.0, 1.0),
22 evas_3d_node_mesh_frame_set(m, frame)
23 );
24}
25
26static void _animateSphere(ExtantzStuffs *stuffs)
27{
28 static float earthAngle = 0.0f;
29
30 earthAngle += 0.3;
31 if (earthAngle > 360.0) earthAngle -= 360.0f;
32 eo_do(stuffs->mesh_node,
33 evas_3d_node_orientation_angle_axis_set(earthAngle, 0.0, 1.0, 0.0)
34 );
35}
36
37static void _animateSonic(ExtantzStuffs *stuffs)
38{
39 static int sonicFrame = 0;
40 Evas_3D_Mesh *m;
41
42 eina_accessor_data_get(stuffs->aMesh, 0, (void **) &m);
43 sonicFrame += 32;
44 if (sonicFrame > 256 * 50) sonicFrame = 0;
45 eo_do(stuffs->mesh_node,
46 evas_3d_node_mesh_frame_set(m, sonicFrame)
47 );
48}
49
50void Evas_3D_Demo_add(globals *ourGlobals)
51{
52 char buf[PATH_MAX];
53 ExtantzStuffs *eStuffs;
54
55 ourGlobals->scene = scenriAdd(ourGlobals->win);
56
57 // TODO - For now lets just pretend we got stuffs sent from our love.
58 sprintf(buf, FAKE_UUID);
59 eStuffs = addStuffs(buf, "onefang's test bed",
60 "Just a pretend bed with MLP scripts for testing SledjHamr.",
61 "12345678-1234-4321-abcd-0123456789ab",
62 "onefang%%27s%%20test%%20bed.omg",
63 MT_CUBE,
64 0.0, 4.0, 10.0,
65 1.0, 0.0, 0.0, 0.0
66 );
67 addMaterial(eStuffs, -1, TT_NORMAL, "normal_lego.png");
68 eStuffs->animateStuffs = (aniStuffs) _animateCube;
69 stuffsSetup(eStuffs, ourGlobals, ourGlobals->scene, 1);
70
71 sprintf(buf, FAKE_UUID);
72 eStuffs = addStuffs(buf, "onefang's left testicle",
73 "Just a pretend world for testing SledjHamr.",
74 "12345678-1234-4321-abcd-0123456789ab",
75 "earth.omg",
76 MT_SPHERE,
77 0.0, 0.0, 0.0,
78 1.0, 0.0, 0.0, 0.0
79 );
80 addMaterial(eStuffs, 1, TT_FACE, "EarthDiffuse.png");
81 eStuffs->animateStuffs = (aniStuffs) _animateSphere;
82 stuffsSetup(eStuffs, ourGlobals, ourGlobals->scene, 2);
83
84 sprintf(buf, FAKE_UUID);
85 eStuffs = addStuffs(buf, "Sonic the bed hog.",
86 "Just a pretend avatar for testing SledjHamr.",
87 "12345678-1234-4321-abcd-0123456789ab",
88 "sonic.md2",
89 MT_MESH,
90 0.0, 0.0, 0.0,
91 -0.7071067811865475, 0.0, 0.0, 0.7071067811865475
92 );
93 addMaterial(eStuffs, -1, TT_FACE, "sonic.png");
94 eStuffs->animateStuffs = (aniStuffs) _animateSonic;
95 stuffsSetup(eStuffs, ourGlobals, ourGlobals->scene, 3);
96}