/// <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));
 }
Exemplo n.º 2
0
 internal static void Project(ProBuilderMesh mesh, Face face)
 {
     Projection.PlanarProject(mesh, face);
     ApplyUVSettings(mesh.texturesInternal, face.distinctIndexesInternal, face.uv);
 }
 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);
 }