2
|
1 #include "dandy.h"
|
|
2
|
|
3 void stage_move(SceneGraphPtr node, void *sgroot_, int w, int h);
|
|
4 void stage_coll(SceneGraphPtr node, void *sgroot_, int w, int h,SceneGraphPtr tree);
|
|
5
|
|
6 void
|
|
7 create_title(void *sgroot_, int w, int h)
|
|
8 {
|
|
9 Viewer *sgroot = (Viewer *)sgroot_;
|
|
10 SceneGraphPtr back, title;
|
|
11
|
|
12 back = sgroot->createSceneGraph();
|
|
13 title = sgroot->createSceneGraph("title001");
|
|
14 title->xyz[0] = w/2;
|
|
15 title->xyz[1] = h/2;
|
|
16 title->set_move_collision(title_move, title_coll);
|
|
17 back->addChild(title);
|
|
18
|
|
19 sgroot->setSceneData(back);
|
|
20 }
|
|
21
|
|
22 void
|
|
23 create_stage(void *sgroot_, int w, int h)
|
|
24 {
|
|
25 SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_;
|
|
26
|
|
27 SceneGraphPtr stage = sgroot->createSceneGraph();
|
|
28 SceneGraphPtr mydandy = sgroot->createSceneGraph("mydandy");
|
|
29
|
|
30 mydandy->set_move_collision(dandy_move, dandy_coll);
|
|
31 stage->set_move_collision(stage_move, stage_coll);
|
|
32
|
|
33 mydandy->xyz[0] = w/2;
|
|
34 mydandy->xyz[1] = h*0.9;
|
|
35 mydandy->xyz[2] = 0.0f;
|
|
36
|
|
37 stage->addChild(mydandy);
|
|
38 sgroot->setSceneData(stage);
|
|
39 }
|
|
40
|
|
41 void
|
|
42 stage_move(SceneGraphPtr node, void *sgroot_, int w, int h)
|
|
43 {
|
|
44
|
|
45 //stage_plan(node, sgroot_, w, h);
|
|
46 node->frame += 1;
|
|
47
|
|
48 }
|
|
49
|
|
50 void
|
|
51 stage_coll(SceneGraphPtr node, void *sgroot_, int w, int h,SceneGraphPtr tree)
|
|
52 {
|
|
53 }
|
|
54
|
|
55
|