如果在游戏里面你需要把一个Mesh贴到不同的地方
First some basics about the scene graph API. The scene graph consists of objects that are subclassed from Node. Each Node can have only one parent.
This means that you cannot reuse the same Mesh instance in the same scene graph.
所以你可以使用duplicate 复制一个Mesh
This means that you cannot reuse the same Mesh instance in the same scene graph.
所以你可以使用duplicate 复制一个Mesh
duplicate不会消耗很多内存,因为duplicate后,那些vertex, index, appearance数据都是和源Mesh共用的
---------------------------------------------------------------------------------------------
updated 12/14/2006
如果我把第一个mesh1.scale(0.5f, 0.5f, 0.5f)
然后mesh2 = (Mesh)mesh1.duplicate();
mesh1的scale效果不会影响到mesh2
由此可见
duplicate的过程不会复制Mesh的Transform这些东西的
本文介绍了在游戏中如何通过场景图API中的Mesh复制来实现Mesh的高效复用,包括如何利用duplicate方法避免大量内存消耗,并说明了duplicate操作对Mesh实例属性的影响。
895

被折叠的 条评论
为什么被折叠?



