Exemplo n.º 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;
        }
Exemplo n.º 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;
        }
Exemplo n.º 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;
        }
Exemplo n.º 4
0
 public void AddShape(CollisionShape shape, OpenTK.Matrix4 transform)
 {
     com.AddChildShape(transform, shape.BulletShape);
     transforms.Add(transform);
     shapes.Add(shape);
 }