re: Loki技法5-TypeMap ccsdu2009 2010-04-19 11:59
@空明流轉
我現在已經不大使用boost了
這個東西大的出奇
(當然我只在底層使用若干子庫)
re: Loki技法5-TypeMap ccsdu2009 2010-04-19 11:58
@luoweisong
我不太懂如何配置顏色
有空你可以教教我如何設置
re: Loki技法3-Typelist(2) ccsdu2009 2010-04-17 19:51
@tiny
boost是個龐然大物
loki比較小
re: 基于策略的一種高效內存池的實現 ccsdu2009 2010-04-15 08:45
不錯
從純技術的觀點說也許使用ffmpeg感覺沒多大挑戰性
但是從商業角度考慮 能復用別人的東西則更好
從非流媒體工程師而言 基于這些第三方庫是最好的選擇
我使用過vlc,ffmpeg
re: loki技法(2).CheckReturn ccsdu2009 2010-04-13 19:19
@欲三更
不一定
re: loki技法(1).靜態斷言[未登錄] ccsdu2009 2010-04-10 19:01
@螞蟻終結者
boost里面有這個東西
typedef char type_must_be_complete[ sizeof(T)? 1: -1 ];
(void) sizeof(type_must_be_complete);
delete x;
re: Loki技法3-Typelist(1) ccsdu2009 2010-04-10 12:36
TypeList是Loki工廠等其他幾個模塊的基礎
雖然這里還沒有看出其實際的用途
re: loki技法(1).靜態斷言 ccsdu2009 2010-04-09 08:24
@欲三更
恩 這個很有可能
re: 蓋莫游戲引擎2.1.1-多線程資源載入類 ccsdu2009 2010-04-07 18:31
@expter
從理論上講多線程打包似乎不可行
因為這是個寫操作
re: loki技法(2).CheckReturn ccsdu2009 2010-04-07 14:16
@~
似乎不大可能使用模板編譯時提供代碼測試吧
re: 蓋莫游戲引擎2.1.1-多線程資源載入類 ccsdu2009 2010-04-07 08:43
@expter
no
當前只處理資源"解包"
這個以后會加入的
re: 對 C++ 歷史的個人觀點 ccsdu2009 2010-04-07 08:40
搞不明白的是很多國人做ppt總喜歡搞英文的 納悶
re: 你不再需要TinyXML,推薦RapidXML ccsdu2009 2010-04-06 19:58
和libxml相比如何?
re: loki技法(2).CheckReturn ccsdu2009 2010-04-06 14:28
@欣萌
據我個人看法 這個應該于代碼測試有關
如果測試的時候檢查了函數返回值則不會有問題
如果沒有檢測函數返回值則根據定制規則做處理
re: loki技法(2).CheckReturn ccsdu2009 2010-04-06 11:14
不過我覺得這種方法實際意義似乎很小
re: 蓋莫游戲引擎2.1.1之渲染器設計 ccsdu2009 2010-04-02 08:33
先簡后難啊
re: loki技法(1).靜態斷言 ccsdu2009 2010-04-01 21:53
說實話 我感覺這個設計的很巧妙
聯合使用模板特化和前向聲明來
@清風
這是當然
不過當前使用多線程計算粒子數據 可以彌補一點損失
re: 蓋莫游戲引擎線程相關模塊設計[未登錄] ccsdu2009 2010-03-25 11:35
線程實現和平臺有關
re: 蓋莫游戲引擎的對象基類設計[未登錄] ccsdu2009 2010-03-21 17:22
@陳梓瀚(vczh)
hehe
re: 蓋莫游戲引擎的對象基類設計 ccsdu2009 2010-03-21 17:15
@陳梓瀚(vczh)
那對象的動態生成呢?
re: 蓋莫游戲引擎中的文件系統測試demo ccsdu2009 2010-03-10 15:41
@陳梓瀚(vczh)
那你覺得應該如何書寫之?
re: 蓋莫游戲引擎中的文件系統測試demo ccsdu2009 2010-03-09 18:42
@陳昱(CY)
你看過irr引擎嗎?
re: 蓋莫游戲引擎中的范管理器類 ccsdu2009 2010-03-09 15:51
map的erase有三個版本
1 關于map的erase
2 void
3 erase(iterator __position)
4 { _M_t.erase(__position); }
5
6 /**
7 * @brief Erases elements according to the provided key.
8 * @param x Key of element to be erased.
9 * @return The number of elements erased.
10 *
11 * This function erases all the elements located by the given key from
12 * a %map.
13 * Note that this function only erases the element, and that if
14 * the element is itself a pointer, the pointed-to memory is not touched
15 * in any way. Managing the pointer is the user's responsibilty.
16 */
17 size_type
18 erase(const key_type& __x)
19 { return _M_t.erase(__x); }
20
21 /**
22 * @brief Erases a [first,last) range of elements from a %map.
23 * @param first Iterator pointing to the start of the range to be
24 * erased.
25 * @param last Iterator pointing to the end of the range to be erased.
26 *
27 * This function erases a sequence of elements from a %map.
28 * Note that this function only erases the element, and that if
29 * the element is itself a pointer, the pointed-to memory is not touched
30 * in any way. Managing the pointer is the user's responsibilty.
31 */
32 void
33 erase(iterator __first, iterator __last)
34 { _M_t.erase(__first, __last); }
我以前只注意到map.erase(itr);
謝謝提醒O(∩_∩)O~
re: 蓋莫游戲引擎中的范管理器類 ccsdu2009 2010-03-09 10:58
@cui
謝謝
完成功能是第一要務
效率是其次的
re: 蓋莫游戲引擎中的范管理器類 ccsdu2009 2010-03-08 20:53
////////////////////////////////////////////////////////////
49 /// 銷毀指定名字的對象
50 ////////////////////////////////////////////////////////////
51 inline bool KillObject(const Type& name)
52 {
53 std::map<std::string,RefPtr<Model> >::iterator itr = objects.find(name);
54 if(itr == objects.end())
55 return false;
56 objects.erase(name);
57 return true;
58 }
re: 使用蓋莫游戲引擎設計的簡單物理場景 ccsdu2009 2010-03-03 18:38
貼圖次序反了
re: 使用蓋莫游戲引擎繪制立方體 ccsdu2009 2010-03-03 15:47
@陳梓瀚(vczh)
其存在的必要是為物理引擎Demo做準備的
函數和這個例子一樣都是暫時的
re: 使用簡單腳本配置下的天空盒和地形測試[未登錄] ccsdu2009 2010-03-03 14:37
@陳梓瀚(vczh)
xiexie
你弄得這個腳本引擎最大優點是什么?
好的話我可以拿去作為引擎備用腳本引擎
re: 洗牌的學問 ccsdu2009 2010-02-25 20:59
呵呵 看到問題我首先想到的就是std::random_shuffle
不過文章結尾很有意思
re: sigslot簡介 ccsdu2009 2010-02-25 17:24
呵呵 你也關注過這個庫啊
其實不考慮線程安全的話
gui庫glooey總改造了的sigslot是很簡單的
re: c++中使用成員函數作為函數參數的方法 ccsdu2009 2010-02-24 08:27
@sanit
沒問題的
re: 封裝固定長度字符數組的模板容器類 ccsdu2009 2010-02-23 18:48
boost中就有array!
re: 蓋莫游戲引擎中的便利宏和及幾個小類 ccsdu2009 2010-02-22 14:56
@陳梓瀚(vczh)
StrToInt? 有這個函數?
re: Vczh Library++3.0 開源啦! ccsdu2009 2010-02-22 14:53
這是做什么的啊?
re: 蓋莫游戲引擎中的便利宏和及幾個小類 ccsdu2009 2010-02-10 15:18
引擎只在底層使用boost并沒有在頭文件中使用之
一個重要的原因就是為了提高代碼的可讀性
引擎是給別人使用的
保持良好的可讀性是十分重要的
re: 人工智能——弈心1.0.1.4 ccsdu2009 2010-02-09 18:40
棋力不錯
re: 蓋莫游戲引擎中的坐標系統設計 ccsdu2009 2010-02-08 21:24
1 ////////////////////////////////////////////////////////////
2 /// 坐標軸枚舉
3 ////////////////////////////////////////////////////////////
4 enum AXIS_TYPE
5 {
6 AXIS_X = 1,
7 AXIS_Y = 1 << 2,
8 AXIS_Z = 1 << 4
9 };
10
11 ////////////////////////////////////////////////////////////
12 /// 坐標軸方向枚舉
13 ////////////////////////////////////////////////////////////
14 enum AXIS_DIRECTION
15 {
16 AXIS_DIRECTION_UP = 1,
17 AXIS_DIRECTION_DOWN = -1
18 };
re: 蓋莫游戲引擎音頻測試 ccsdu2009 2010-02-08 20:00
@陳梓瀚(vczh)
fmod要錢的 不打算使用之
re: 蓋莫游戲引擎的Transform類設計 ccsdu2009 2010-02-07 20:07
在涉及渲染的時候會有問題
我修改了下
1
2 ///////////////////////////////////////////////////////
3 /// 定義引擎場景節點基類
4 ///////////////////////////////////////////////////////
5 class G_DLL_API SceneNode : public Object, public Parent<RefPtr<SceneNode> >, public Renderable
6 {
7 public:
8 typedef std::map<const std::string,RefPtr<SceneNode> > SceneList;
9 typedef std::map<const std::string,RefPtr<SceneNode> >::iterator SceneItr;
10 public:
11 ///////////////////////////////////////////////////////
12 /// 構造,析構場景節點
13 ///////////////////////////////////////////////////////
14 inline SceneNode(){}
15 inline SceneNode(RefPtr<SceneNode> parent):Parent<RefPtr<SceneNode> >(parent){}
16 inline SceneNode(const Matrix4f &matrix):world_matrix(matrix){}
17 inline SceneNode(RefPtr<SceneNode> parent,const Matrix4f &matrix):Parent<RefPtr<SceneNode> >(parent),world_matrix(matrix){}
18 virtual ~SceneNode();
19 public:
20 ///////////////////////////////////////////////////////
21 /// 場景渲染虛函數
22 ///////////////////////////////////////////////////////
23 virtual void BeginRender();
24 virtual void Render();
25 virtual void AfterRender();
26
27 ///////////////////////////////////////////////////////
28 /// 節點操作
29 ///////////////////////////////////////////////////////
30 void PushScene(RefPtr<SceneNode> child);
31 bool PopScene(RefPtr<SceneNode> child);
32 void ClearAllScene();
33 void ClearAllSceneRecursive();
34 uint GetSceneCount(){return children.size();}
35 RefPtr<SceneNode> GetScene(const std::string &name);
36
37 ///////////////////////////////////////////////////////
38 /// 獲取,設置場景矩陣
39 ///////////////////////////////////////////////////////
40 inline Matrix4f GetWorldMatrix()const{return world_matrix;}
41 //!inline Matrix4f SetWorldMatrix(const Matrix4f &matrix){this->world_matrix = matrix;}
42 inline Matrix4f GetLocalMatrix()const{return local_matrix;}
43 //!inline Matrix4f SetLocalMatrix(const Matrix4f &matrix){this->local_matrix = matrix;}
44
45 ///////////////////////////////////////////////////////
46 /// 場景平移,縮放,旋轉(子場景矩陣也會發生變化)
47 ///////////////////////////////////////////////////////
48 void Translate(const Vector3f &offset);
49 void Scale(const Vector3f &scale);
50 void Rotate(float angle, float x, float y, float z);
51
52 ///////////////////////////////////////////////////////
53 /// 獲取,設置場景盒子,球
54 ///////////////////////////////////////////////////////
55 inline Box GetSceneBox()const{return box;}
56 inline void SetSceneBox(const Box &box){this->box = box;}
57 inline Spheref GetSceneSphere()const{return shpere;}
58 inline void SetSceneSphere(const Spheref &sphere){this->shpere = sphere;}
59 protected:
60 SceneList children;
61 Matrix4f world_matrix;
62 Matrix4f local_matrix;
63 Box box;
64 Spheref shpere;
65
66 DECLARE_OBJECT(SceneNode);
67 };
68
如下:
使用std::map來存儲場景
當然不存在重復名字的場景是最基本的前體
re: 蓋莫游戲引擎的Transform類設計 ccsdu2009 2010-02-07 16:48
這個東西寫的很有問題!
re: c++單態的一個變種實現 ccsdu2009 2010-02-06 10:57
恩 后面的逗號是多余的 謝謝
雙模板好處? 1個是可以避免針對純虛的單態構造對象
我不太喜歡寫字丷丷
re: c++單態的一個變種實現 ccsdu2009 2010-02-05 20:32
比如:
Singleton<Audio,OpenALAudio>;
Singleton<Window,LinuxWindow>;
re: 蓋莫引擎的矩陣模板實現 ccsdu2009 2010-02-05 19:55
@陳梓瀚(vczh)
呵呵? 是先獲取行列式值的然后求逆矩陣的
這個是我先在mat上面弄得之后復制到
不過求逆矩的確比較煩
這還沒考慮病態矩陣
re: 使用蓋莫游戲引擎做的天空面 ccsdu2009 2010-02-05 15:25
謝謝你的提醒
只是我對opengl不是太熟悉
不這樣做的話畫面會抖動
還沒來得及找原因