コード例 #1
0
        public static Mesh MergeMeshes(GameObject gameObject)
        {
            List <Mesh>     meshes;
            List <Matrix4f> transforms = new List <Matrix4f>();

            meshes = RenderUtil.GatherMeshes(gameObject, transforms);
            return(MergeMeshes(meshes, transforms));
        }
コード例 #2
0
        public static Geometry MergeGeometry(GameObject gameObject)
        {
            List <Mesh>     meshes;
            List <Matrix4f> transforms = new List <Matrix4f>();
            List <Shader>   shaders    = new List <Shader>();

            meshes = RenderUtil.GatherMeshes(gameObject, transforms, shaders);
            Mesh     m    = MergeMeshes(meshes, transforms);
            Geometry geom = new Geometry(m);

            if (shaders.Count > 0)
            {
                geom.SetShader(shaders[0]);
            }
            return(geom);
        }