コード例 #1
0
        private CompoundShape LoadCompoundCollisionShape(UrdfCollision[] collisions, string baseDirectory, float mass, Matrix parentTransform)
        {
            var compoundShape = new CompoundShape(true, collisions.Length);

            foreach (UrdfCollision collision in collisions)
            {
                Matrix         origin         = ParsePose(collision.Origin);
                Matrix         childTransform = origin * parentTransform;
                CollisionShape shape          = CreateShapeFromGeometry(collision.Geometry, mass, baseDirectory);
                compoundShape.AddChildShapeRef(ref childTransform, shape);
            }
            return(compoundShape);
        }