Beispiel #1
0
        /// <summary>
        /// drops weapon at specified position.
        /// </summary>
        /// <param name="position">new drop position</param>
        /// <param name="parent">new scene node</param>
        /// <param name="layer">new collision layer</param>
        public void Drop(Vector3 position, NodeBase parent, CollisionLayer layer)
        {
            //  Detached scene node from owner
            AttachOwner(parent);

            //  Add a collision
            if( layer != null)
                layer.AddCollide(this.Collide);

            DroppedModel.SetRootAxis(
                Matrix.CreateRotationX(MathHelper.ToRadians(-90.0f)));

            this.Position = position;
            this.isDropped = true;
            this.Enabled = true;
            this.Visible = true;
        }