Пример #1
0
        private void SolveCollisionVertices(Collision collision)
        {
            // Solve collision contact points
            SolveContacts(collision, out int npoints);

            // Fetch every query point on the surface of the collider
            var querypoints = GetQueryPointsArray(contactPoints, npoints);

            // Retrive the indeces of the vertices for each triangle
            // that has contact to the impact surface
            var collisionResult = modalMesh.GetCollisionVertices(querypoints);

            // Set the gains corresponding to the positions on the object we hit
            // Gains are set by attempting to call into the native audio plugin
            int[]   points  = collisionResult.Item1;
            float[] weights = collisionResult.Item2;
            sonicObject.SetGains(npoints, points, weights);
        }