Esempio n. 1
0
        public override void Evaluate(int SpreadMax)
        {
            int spmax = ArrayMax.Max(FVertices.SliceCount,
                FIndices.SliceCount,
                this.BasePinsSpreadMax);

            if (this.FApply[0])
            {
                this.FShapes.SliceCount = spmax;

                for (int i = 0; i < spmax; i++)
                {
                    //Vector3D size = this.FSize[i];
                    Vector3[] vertices = new Vector3[this.FVertices[i].SliceCount];
                    int[] inds = new int[this.FIndices[i].SliceCount];

                    for (int j = 0; j < this.FVertices[i].SliceCount; j++)
                    {
                        vertices[j] = this.FVertices[i][j].ToBulletVector();
                    }

                    for (int j = 0; j < this.FIndices[i].SliceCount; j++)
                    {
                        inds[j] = Convert.ToInt16(this.FIndices[i][j]);
                    }

                    BvhShapeDefinition chull = new BvhShapeDefinition(vertices, inds);
                    chull.Mass = this.FMass[i];
                    this.SetBaseParams(chull, i);

                    this.FShapes[i] = chull;
                }
            }
        }
        public override void Evaluate(int SpreadMax)
        {
            if ((this.FInMesh.IsChanged || this.BasePinsChanged) && this.FInMesh.PluginIO.IsConnected)
            {
                int spmax = ArrayMax.Max(FInMesh.SliceCount, this.BasePinsSpreadMax);

                for (int i = 0; i < spmax; i++)
                {
                    BvhShapeDefinition chull = new BvhShapeDefinition(this.FInMesh[i]);
                    chull.Mass = this.FMass[i];
                    this.SetBaseParams(chull, i);

                    this.FShapes[i] = chull;
                }
            }
        }