Jitter.Dynamics.SoftBody.DoSelfCollision C# (CSharp) Method

DoSelfCollision() public method

public DoSelfCollision ( CollisionDetectedHandler collision ) : void
collision CollisionDetectedHandler
return void
        public void DoSelfCollision(CollisionDetectedHandler collision)
        {
            if (!selfCollision) return;

            JVector point, normal;
            float penetration;

            for (int i = 0; i < points.Count; i++)
            {
                queryList.Clear();
                this.dynamicTree.Query(queryList, ref points[i].boundingBox);

                for (int e = 0; e < queryList.Count; e++)
                {
                    Triangle t = this.dynamicTree.GetUserData(queryList[e]);

                    if (!(t.VertexBody1 == points[i] || t.VertexBody2 == points[i] || t.VertexBody3 == points[i]))
                    {
                        if (XenoCollide.Detect(points[i].Shape, t, ref points[i].orientation,
                            ref JMatrix.InternalIdentity, ref points[i].position, ref JVector.InternalZero,
                            out point, out normal, out penetration))
                        {
                            int nearest = CollisionSystem.FindNearestTrianglePoint(this, queryList[e], ref point);

                            collision(points[i], points[nearest], point, point, normal, penetration);
                     
                        }
                    }
                }
            }
        }