Mercurial > hg > Members > e085722 > Cerium
annotate Renderer/Test_/cube_action.cc @ 4:b5b462ac9b3b
Cerium Blender ball_bound
author | Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 29 Nov 2010 16:42:42 +0900 |
parents | |
children |
rev | line source |
---|---|
4
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1 #include <math.h> |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 #include "SceneGraphRoot.h" |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
3 #include "SGList.h" |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
4 |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 static void cube_move_left(SceneGraphPtr node, int screen_w, int screen_h); |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6 static void cube_move_right(SceneGraphPtr node, int screen_w, int screen_h); |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
7 static void cube_move_idle(SceneGraphPtr node, int screen_w, int screen_h); |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
8 static void cube_collision(SceneGraphPtr node, int screen_w, int screen_h, |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
9 SceneGraphPtr tree); |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
10 |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
11 static void cube_split(SceneGraphPtr root); |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
12 |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
13 static void |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
14 cube_move_left(SceneGraphPtr node, int screen_w, int screen_h) |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
15 { |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
16 node->xyz[0] -= node->stack_xyz[0]; |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
17 node->xyz[1] -= node->stack_xyz[0] * node->stack_xyz[1]; |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
18 node->xyz[2] -= node->stack_xyz[0] * node->stack_xyz[2]; |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
19 |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
20 if (node->xyz[0] < 0) { |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
21 node->set_move_collision(cube_move_right, cube_collision); |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
22 } |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
23 |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
24 if (node->xyz[1] < 0 || node->xyz[1] > screen_h) { |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
25 node->stack_xyz[1] = -node->stack_xyz[1]; |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
26 } |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
27 |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
28 node->angle[0] += 2.0f; |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
29 node->angle[1] += 2.0f * node->stack_xyz[1]; |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
30 node->angle[2] += 2.0f * node->stack_xyz[2]; |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
31 |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
32 node->angle[0] = fmodf(node->angle[0], 360.0f); |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
33 node->angle[1] = fmodf(node->angle[1], 360.0f); |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
34 node->angle[2] = fmodf(node->angle[2], 360.0f); |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
35 |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
36 if (node->frame > 10 && sgroot->controller->circle.isPush()) { |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
37 cube_split(node); |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
38 } |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
39 } |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
40 |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
41 static void |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
42 cube_move_right(SceneGraphPtr node, int screen_w, int screen_h) |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
43 { |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
44 node->xyz[0] += node->stack_xyz[0]; |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
45 node->xyz[1] -= node->stack_xyz[0] * node->stack_xyz[1]; |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
46 node->xyz[2] -= node->stack_xyz[0] * node->stack_xyz[2]; |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
47 |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
48 if (node->xyz[0] > screen_w) { |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
49 node->set_move_collision(cube_move_left, cube_collision); |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
50 } |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
51 |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
52 if (node->xyz[1] < 0 || node->xyz[1] > screen_h) { |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
53 node->stack_xyz[1] = -node->stack_xyz[1]; |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
54 } |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
55 |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
56 node->angle[0] += 2.0f; |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
57 node->angle[1] += 2.0f * node->stack_xyz[1]; |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
58 node->angle[2] += 2.0f * node->stack_xyz[2]; |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
59 |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
60 node->angle[0] = fmodf(node->angle[0], 360.0f); |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
61 node->angle[1] = fmodf(node->angle[1], 360.0f); |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
62 node->angle[2] = fmodf(node->angle[2], 360.0f); |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
63 |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
64 if (node->frame > 10 && sgroot->controller->circle.isPush()) { |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
65 cube_split(node); |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
66 } |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
67 } |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
68 |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
69 static void |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
70 cube_split(SceneGraphPtr root) |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
71 { |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
72 SceneGraphPtr p = root->clone(); |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
73 root->addBrother(p); |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
74 |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
75 root->set_move_collision(cube_move_left, cube_collision); |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
76 p->set_move_collision(cube_move_right, cube_collision); |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
77 |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
78 p->xyz[0] = root->xyz[0] + 2; |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
79 p->xyz[1] = root->xyz[1]; |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
80 p->xyz[2] = root->xyz[2]; |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
81 |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
82 p->stack_xyz[0] = 2.0f; |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
83 p->stack_xyz[1] = random()%3-1; |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
84 p->stack_xyz[2] = random()%3-1; |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
85 |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
86 root->xyz[0] -= 2; |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
87 root->stack_xyz[0] = 2.0f; |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
88 root->stack_xyz[1] = random()%3-1; |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
89 root->stack_xyz[2] = random()%3-1; |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
90 } |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
91 |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
92 |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
93 static void |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
94 cube_move_idle(SceneGraphPtr node, int screen_w, int screen_h) |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
95 { |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
96 node->xyz[0] = screen_w/2; |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
97 node->xyz[1] = screen_h/2; |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
98 //node->xyz[2] = -300.0f; |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
99 |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
100 if (sgroot->controller->circle.isPush()) { |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
101 cube_split(node); |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
102 } |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
103 } |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
104 |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
105 static void |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
106 cube_collision(SceneGraphPtr node, int screen_w, int screen_h, |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
107 SceneGraphPtr tree) |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
108 { |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
109 } |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
110 |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
111 void |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
112 create_cube_split(TaskManager *manager, int number) |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
113 { |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
114 SceneGraphPtr cube; |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
115 SceneGraphPtr back; |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
116 |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
117 sgroot->createFromXMLfile(manager, "xml_file/cube.xml"); |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
118 |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
119 // 何もしない親 |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
120 // cube は brother として繋がっていくので |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
121 // 親が居ないとだめ。 |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
122 back = sgroot->createSceneGraph(); |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
123 |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
124 cube = sgroot->createSceneGraph(Cube); |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
125 cube->xyz[0] = 960.0f; |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
126 cube->xyz[1] = 540.0f; |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
127 cube->set_move_collision(cube_move_idle, cube_collision); |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
128 |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
129 back->addChild(cube); |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
130 |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
131 sgroot->setSceneData(back); |
b5b462ac9b3b
Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
132 } |