コード例 #1
0
        /// <summary>
        /// Adds a child shape.
        /// </summary>
        /// <param name="shape">The shape.</param>
        public void AddChildShape(ColliderShape shape)
        {
            colliderShapes.Add(shape);

            InternalCompoundShape.AddChildShape(shape.PositiveCenterMatrix, shape.InternalShape);

            shape.Parent = this;
        }
コード例 #2
0
        /// <summary>
        /// Adds a child shape.
        /// </summary>
        /// <param name="shape">The shape.</param>
        public void AddChildShape(ColliderShape shape)
        {
            colliderShapes.Add(shape);

            var compoundMatrix = Matrix.RotationQuaternion(shape.LocalRotation) * Matrix.Translation(shape.LocalOffset);

            InternalCompoundShape.AddChildShape(compoundMatrix, shape.InternalShape);

            shape.Parent = this;
        }
コード例 #3
0
        public CompoundShape(CollisionShape[] shapes, OpenTK.Matrix4[] transforms)
        {
            this.shapes.AddRange(shapes);
            this.transforms.AddRange(transforms);

            com = new BulletSharp.CompoundShape();

            for (var i = 0; i < shapes.Length; i++)
            {
                com.AddChildShape(transforms[i], shapes[i].BulletShape);
            }
            BulletShape            = com;
            BulletShape.UserObject = this;
        }
コード例 #4
0
 public void AddShape(CollisionShape shape, OpenTK.Matrix4 transform)
 {
     com.AddChildShape(transform, shape.BulletShape);
     transforms.Add(transform);
     shapes.Add(shape);
 }