Ejemplo n.º 1
0
        public static MeshBuilder Stretch(this MeshBuilder mb, aabb3 oldSize, aabb3 newSize)
        {
            var scale = newSize.size / oldSize.size;

            for (int i = 0; i < mb.vertices.Count; i++)
            {
                var v = mb.vertices[i];
                mb.vertices[i] = newSize.a + (v - oldSize.a) * scale;
            }

            return(mb);
        }
Ejemplo n.º 2
0
 public static MeshBuilder Stretch(this MeshBuilder mb, aabb3 newSize)
 => mb.Stretch(new aabb3(vec3.one / 2.0f), newSize);