예제 #1
0
 public void Combine(MeshRendererGroup meshGroup, MeshRendererLookup rendererLookup)
 {
     for (int index1 = 0; index1 < meshGroup.data.Count; ++index1)
     {
         MeshRendererInstance instance  = meshGroup.data[index1];
         Matrix4x4            matrix4x4 = Matrix4x4.TRS(instance.position, instance.rotation, instance.scale);
         int count = this.vertices.Count;
         for (int index2 = 0; index2 < instance.data.triangles.Length; ++index2)
         {
             this.triangles.Add(count + instance.data.triangles[index2]);
         }
         for (int index2 = 0; index2 < instance.data.vertices.Length; ++index2)
         {
             this.vertices.Add(((Matrix4x4) ref matrix4x4).MultiplyPoint3x4(instance.data.vertices[index2]));
             this.positions.Add(Vector4.op_Implicit(instance.position));
         }
         for (int index2 = 0; index2 < instance.data.normals.Length; ++index2)
         {
             this.normals.Add(((Matrix4x4) ref matrix4x4).MultiplyVector(instance.data.normals[index2]));
         }
         for (int index2 = 0; index2 < instance.data.tangents.Length; ++index2)
         {
             Vector4 tangent = instance.data.tangents[index2];
             Vector3 vector3_1;
             ((Vector3) ref vector3_1).\u002Ector((float)tangent.x, (float)tangent.y, (float)tangent.z);
             Vector3 vector3_2 = ((Matrix4x4) ref matrix4x4).MultiplyVector(vector3_1);
             this.tangents.Add(new Vector4((float)vector3_2.x, (float)vector3_2.y, (float)vector3_2.z, (float)tangent.w));
         }
         for (int index2 = 0; index2 < instance.data.colors32.Length; ++index2)
         {
             this.colors32.Add(instance.data.colors32[index2]);
         }
         for (int index2 = 0; index2 < instance.data.uv.Length; ++index2)
         {
             this.uv.Add(instance.data.uv[index2]);
         }
         for (int index2 = 0; index2 < instance.data.uv2.Length; ++index2)
         {
             this.uv2.Add(instance.data.uv2[index2]);
         }
         rendererLookup.Add(instance);
     }
 }
예제 #2
0
 public void Combine(MeshRendererGroup meshGroup, MeshRendererLookup rendererLookup)
 {
     for (int i = 0; i < meshGroup.data.Count; i++)
     {
         MeshRendererInstance instance = meshGroup.data[i];
         Matrix4x4            matrix4x = Matrix4x4.TRS(instance.position, instance.rotation, instance.scale);
         int count = vertices.Count;
         for (int j = 0; j < instance.data.triangles.Length; j++)
         {
             triangles.Add(count + instance.data.triangles[j]);
         }
         for (int k = 0; k < instance.data.vertices.Length; k++)
         {
             vertices.Add(matrix4x.MultiplyPoint3x4(instance.data.vertices[k]));
             positions.Add(instance.position);
         }
         for (int l = 0; l < instance.data.normals.Length; l++)
         {
             normals.Add(matrix4x.MultiplyVector(instance.data.normals[l]));
         }
         for (int m = 0; m < instance.data.tangents.Length; m++)
         {
             Vector4 vector  = instance.data.tangents[m];
             Vector3 vector2 = new Vector3(vector.x, vector.y, vector.z);
             Vector3 vector3 = matrix4x.MultiplyVector(vector2);
             tangents.Add(new Vector4(vector3.x, vector3.y, vector3.z, vector.w));
         }
         for (int n = 0; n < instance.data.colors32.Length; n++)
         {
             colors32.Add(instance.data.colors32[n]);
         }
         for (int num = 0; num < instance.data.uv.Length; num++)
         {
             uv.Add(instance.data.uv[num]);
         }
         for (int num2 = 0; num2 < instance.data.uv2.Length; num2++)
         {
             uv2.Add(instance.data.uv2[num2]);
         }
         rendererLookup.Add(instance);
     }
 }
예제 #3
0
 public void Combine(MeshRendererGroup meshGroup, MeshRendererLookup rendererLookup)
 {
     for (int i = 0; i < meshGroup.data.Count; i++)
     {
         MeshRendererInstance item      = meshGroup.data[i];
         Matrix4x4            matrix4x4 = Matrix4x4.TRS(item.position, item.rotation, item.scale);
         int count = this.vertices.Count;
         for (int j = 0; j < (int)item.data.triangles.Length; j++)
         {
             this.triangles.Add(count + item.data.triangles[j]);
         }
         for (int k = 0; k < (int)item.data.vertices.Length; k++)
         {
             this.vertices.Add(matrix4x4.MultiplyPoint3x4(item.data.vertices[k]));
             this.positions.Add(item.position);
         }
         for (int l = 0; l < (int)item.data.normals.Length; l++)
         {
             this.normals.Add(matrix4x4.MultiplyVector(item.data.normals[l]));
         }
         for (int m = 0; m < (int)item.data.tangents.Length; m++)
         {
             Vector4 vector4  = item.data.tangents[m];
             Vector3 vector3  = new Vector3(vector4.x, vector4.y, vector4.z);
             Vector3 vector31 = matrix4x4.MultiplyVector(vector3);
             this.tangents.Add(new Vector4(vector31.x, vector31.y, vector31.z, vector4.w));
         }
         for (int n = 0; n < (int)item.data.colors32.Length; n++)
         {
             this.colors32.Add(item.data.colors32[n]);
         }
         for (int o = 0; o < (int)item.data.uv.Length; o++)
         {
             this.uv.Add(item.data.uv[o]);
         }
         for (int p = 0; p < (int)item.data.uv2.Length; p++)
         {
             this.uv2.Add(item.data.uv2[p]);
         }
         rendererLookup.Add(item);
     }
 }
 public LookupEntry(MeshRendererInstance instance)
 {
     this.renderer = instance.renderer;
 }
 public void Add(MeshRendererInstance instance)
 {
     this.data.Add(new MeshRendererLookup.LookupEntry(instance));
 }
 public void Add(MeshRendererInstance instance)
 {
     this.dst.Add(instance);
 }
예제 #7
0
 public void Add(MeshRendererInstance instance)
 {
     data.Add(new LookupEntry(instance));
 }
예제 #8
0
 public void Add(MeshRendererInstance instance)
 {
     instance.position -= position;
     meshGroup.data.Add(instance);
     AddVertices(instance.mesh.vertexCount);
 }
 public void Add(MeshRendererInstance instance)
 {
     ref Vector3 local = ref instance.position;