public LookupEntry(MeshColliderInstance instance)
 {
     this.transform = instance.transform;
     this.rigidbody = instance.rigidbody;
     this.collider  = instance.collider;
     this.bounds    = instance.bounds;
 }
        public void Add(MeshColliderInstance instance)
        {
            this.data.Add(new MeshColliderLookup.LookupEntry(instance));
            int count  = this.data.Count - 1;
            int length = (int)instance.data.triangles.Length / 3;

            for (int i = 0; i < length; i++)
            {
                this.indices.Add(count);
            }
        }
        public void Add(MeshColliderInstance instance)
        {
            data.Add(new LookupEntry(instance));
            int item = data.Count - 1;
            int num  = instance.data.triangles.Length / 3;

            for (int i = 0; i < num; i++)
            {
                indices.Add(item);
            }
        }
Exemple #4
0
        public void Add(MeshColliderInstance instance)
        {
            this.data.Add(new MeshColliderLookup.LookupEntry(instance));
            int num1 = this.data.Count - 1;
            int num2 = instance.data.triangles.Length / 3;

            for (int index = 0; index < num2; ++index)
            {
                this.indices.Add(num1);
            }
        }
Exemple #5
0
    public void CreateBatches()
    {
        if (this.TempInstances.Count == 0)
        {
            return;
        }
        MeshColliderBatch meshColliderBatch = this.CreateBatch();

        for (int i = 0; i < this.TempInstances.Count; i++)
        {
            MeshColliderInstance item = this.TempInstances[i];
            if (meshColliderBatch.AvailableVertices < item.mesh.vertexCount)
            {
                meshColliderBatch = this.CreateBatch();
            }
            meshColliderBatch.Add(item);
        }
        this.TempInstances.Clear();
    }
Exemple #6
0
    public void CreateBatches()
    {
        if (this.TempInstances.Count == 0)
        {
            return;
        }
        MeshColliderBatch batch = this.CreateBatch();

        for (int index = 0; index < this.TempInstances.Count; ++index)
        {
            MeshColliderInstance tempInstance = this.TempInstances[index];
            if (batch.AvailableVertices < tempInstance.mesh.get_vertexCount())
            {
                batch = this.CreateBatch();
            }
            batch.Add(tempInstance);
        }
        this.TempInstances.Clear();
    }
Exemple #7
0
 public void Combine(MeshColliderGroup meshGroup)
 {
     for (int i = 0; i < meshGroup.data.Count; i++)
     {
         MeshColliderInstance meshColliderInstance = meshGroup.data[i];
         Matrix4x4            matrix4x             = Matrix4x4.TRS(meshColliderInstance.position, meshColliderInstance.rotation, meshColliderInstance.scale);
         int count = vertices.Count;
         for (int j = 0; j < meshColliderInstance.data.triangles.Length; j++)
         {
             triangles.Add(count + meshColliderInstance.data.triangles[j]);
         }
         for (int k = 0; k < meshColliderInstance.data.vertices.Length; k++)
         {
             vertices.Add(matrix4x.MultiplyPoint3x4(meshColliderInstance.data.vertices[k]));
         }
         for (int l = 0; l < meshColliderInstance.data.normals.Length; l++)
         {
             normals.Add(matrix4x.MultiplyVector(meshColliderInstance.data.normals[l]));
         }
     }
 }
 public void Combine(MeshColliderGroup meshGroup)
 {
     for (int i = 0; i < meshGroup.data.Count; i++)
     {
         MeshColliderInstance 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]));
         }
         for (int l = 0; l < (int)item.data.normals.Length; l++)
         {
             this.normals.Add(matrix4x4.MultiplyVector(item.data.normals[l]));
         }
     }
 }
 public void Combine(MeshColliderGroup meshGroup)
 {
     for (int index1 = 0; index1 < meshGroup.data.Count; ++index1)
     {
         MeshColliderInstance colliderInstance = meshGroup.data[index1];
         Matrix4x4            matrix4x4        = Matrix4x4.TRS(colliderInstance.position, colliderInstance.rotation, colliderInstance.scale);
         int count = this.vertices.Count;
         for (int index2 = 0; index2 < colliderInstance.data.triangles.Length; ++index2)
         {
             this.triangles.Add(count + colliderInstance.data.triangles[index2]);
         }
         for (int index2 = 0; index2 < colliderInstance.data.vertices.Length; ++index2)
         {
             this.vertices.Add(((Matrix4x4) ref matrix4x4).MultiplyPoint3x4(colliderInstance.data.vertices[index2]));
         }
         for (int index2 = 0; index2 < colliderInstance.data.normals.Length; ++index2)
         {
             this.normals.Add(((Matrix4x4) ref matrix4x4).MultiplyVector(colliderInstance.data.normals[index2]));
         }
     }
 }
Exemple #10
0
 public void Add(MeshColliderInstance instance)
 {
     this.TempInstances.Add(instance);
 }
 public void Add(MeshColliderInstance instance)
 {
     this.dst.Add(instance);
 }
Exemple #12
0
 public void Add(MeshColliderInstance instance)
 {
     ref Vector3 local = ref instance.position;
 public void Add(MeshColliderInstance instance)
 {
     instance.position -= this.position;
     this.meshGroup.data.Add(instance);
     base.AddVertices(instance.mesh.vertexCount);
 }