Beispiel #1
0
        //MultiSphere
        public MultiSphereShape AddMultiSphereShape(float3[] positions, float[] radi)
        {
            IMultiSphereShapeImp iMultiSphereShapeImp = _dwi.AddMultiSphereShape(positions, radi);
            var retval = new MultiSphereShape();

            retval._multiSphereShapeImp     = iMultiSphereShapeImp;
            iMultiSphereShapeImp.UserObject = retval;
            return(retval);
        }
        /// <summary>
        /// Adds the child shape.
        /// </summary>
        /// <param name="localTransform">The local transform.</param>
        /// <param name="shape">The shape.</param>
        public void AddChildShape(float4x4 localTransform, IMultiSphereShapeImp shape)
        {
            var btPositions = new Vector3[shape.SphereCount];
            var btRadi      = new float[shape.SphereCount];

            for (int i = 0; i < shape.SphereCount; i++)
            {
                var pos = Translator.Float3ToBtVector3(shape.GetSpherePosition(i));
                btPositions[i] = pos;
                btRadi[i]      = shape.GetSphereRadius(i);
            }
            var btChildShape     = new MultiSphereShape(btPositions, btRadi);
            var btLocalTransform = Translator.Float4X4ToBtMatrix(localTransform);

            BtCompoundShape.AddChildShape(btLocalTransform, btChildShape);
        }
 public void AddChildShape(float4x4 localTransform, IMultiSphereShapeImp shape)
 {
     var btPositions = new Vector3[shape.SphereCount];
     var btRadi = new float[shape.SphereCount];
     for (int i = 0; i < shape.SphereCount; i++)
     {
         var pos = Translater.Float3ToBtVector3(shape.GetSpherePosition(i));
         btPositions[i] = pos;
         btRadi[i] = shape.GetSphereRadius(i);
     }
     var btChildShape = new MultiSphereShape(btPositions, btRadi);
     var btLocalTransform = Translater.Float4X4ToBtMatrix(localTransform);
     BtCompoundShape.AddChildShape(btLocalTransform, btChildShape);
 }