diff TaskManager/Test/test_render/SceneGraph.h @ 138:3fd24be89d02

オブジェクトを増やして複数の表示に成功。 TODO:オブジェクトの削除
author gongo@charles.cr.ie.u-ryukyu.ac.jp
date Fri, 28 Nov 2008 12:16:24 +0900
parents 6cf991f28c6c
children 861271089c43
line wrap: on
line diff
--- a/TaskManager/Test/test_render/SceneGraph.h	Fri Nov 28 10:07:48 2008 +0900
+++ b/TaskManager/Test/test_render/SceneGraph.h	Fri Nov 28 12:16:24 2008 +0900
@@ -5,36 +5,49 @@
 #  include "polygon.h"
 #endif
 
+class SceneGraph;
+
+typedef void (*move_func)(SceneGraph* node, int screen_w, int screen_h);
+typedef void (*collision_func)(SceneGraph* node, int screen_w, int screen_h,
+			       SceneGraph* tree);
+typedef SceneGraph* SceneGraphPtr;
+
 class SceneGraph : public Polygon {
 public:
     SceneGraph(void);
     SceneGraph(xmlNodePtr surface);
 
+    // Node がもつ状態変数(というべきか否か
+    // xyz,angle ぐらいあればおk?
+    float stack_xyz[3];
+    float stack_angle[3];
+
     // xml ファイルから生成した時のオブジェクトリスト
     SceneGraph* next;
     SceneGraph* last;
 
-    // Tree Node
+    // Tree Structure
     SceneGraph *parent;
     SceneGraph *brother;
     SceneGraph *children;
     SceneGraph *lastChild;
 
     // 関数ポインタ
-    void (*move)(SceneGraph *node);
-    void (*collision)(SceneGraph *node, SceneGraph* tree);
+    move_func move;
+    collision_func collision;
 
-    void move_execute(void);
-    void collision_check(SceneGraph *tree);
-    void all_execute(void);
+    void move_execute(int screen_w, int screen_h);
+    void collision_check(int screen_w, int screen_h, SceneGraph *tree);
+    void all_execute(int screen_w, int screen_h);
 
     void add_next(SceneGraph *next);
     SceneGraph* addChild(SceneGraph *child);
+    SceneGraph* addBrother(SceneGraph *bro);
+    SceneGraph* clone(void);
     SceneGraph* searchSceneGraph(char *name);
     void set_move_collision(SceneGraph *node,
-			    void (*new_move)(SceneGraph *node),
-			    void (*new_collision)(SceneGraph *node,
-						  SceneGraph *collision));
+			    move_func new_move, collision_func new_collision);
+
 
     static SceneGraph* createFromXMLfile(char *);
 
@@ -44,11 +57,6 @@
     void delete_data(void);
 };
 
-
-typedef void (*move_func)(SceneGraph* node);
-typedef void (*collision_func)(SceneGraph* node, SceneGraph* tree);
-typedef SceneGraph* SceneGraphPtr;
-
 #endif
 
 extern SceneGraphPtr scene_graph;