Ejemplo n.º 1
0
        internal static void ProjectTextureGroup(ProBuilderMesh mesh, int group, AutoUnwrapSettings unwrapSettings)
        {
            Projection.PlanarProject(mesh, group, unwrapSettings);

            foreach (var face in mesh.facesInternal)
            {
                if (face.textureGroup == group)
                {
                    ApplyUVSettings(mesh.texturesInternal, face.distinctIndexesInternal, unwrapSettings);
                }
            }
        }
Ejemplo n.º 2
0
        internal static void ProjectTextureGroup(ProBuilderMesh mesh, int group, AutoUnwrapSettings unwrapSettings)
        {
            Projection.PlanarProject(mesh, group, unwrapSettings);

            s_IndexBuffer.Clear();
            foreach (var face in mesh.facesInternal)
            {
                if (face.textureGroup == group)
                {
                    s_IndexBuffer.AddRange(face.distinctIndexesInternal);
                }
            }

            ApplyUVSettings(mesh.texturesInternal, s_IndexBuffer, unwrapSettings);
        }
Ejemplo n.º 3
0
 internal static void Project(ProBuilderMesh mesh, Face face)
 {
     Projection.PlanarProject(mesh, face);
     ApplyUVSettings(mesh.texturesInternal, face.distinctIndexesInternal, face.uv);
 }
 /// <summary>
 /// Attempt to calculate the UV transform for a face. In cases where the face is auto unwrapped
 /// (manualUV = false), this returns the offset, rotation, and scale from <see cref="Face.uv"/>. If the face is
 /// manually unwrapped, a transform will be calculated by trying to match an unmodified planar projection to the
 /// current UVs. The results
 /// </summary>
 /// <returns></returns>
 internal static UVTransform GetUVTransform(ProBuilderMesh mesh, Face face)
 {
     Projection.PlanarProject(mesh.positionsInternal, face.indexesInternal, Math.Normal(mesh, face), s_UVTransformProjectionBuffer);
     return(CalculateDelta(mesh.texturesInternal, face.indexesInternal, s_UVTransformProjectionBuffer, null));
 }
 internal static void Unwrap(ProBuilderMesh mesh, Face face, Vector3 projection = default)
 {
     Projection.PlanarProject(mesh, face, projection != Vector3.zero? projection : Vector3.zero);
     ApplyUVSettings(mesh.texturesInternal, face.distinctIndexesInternal, face.uv);
 }