//--------------------------------------------------------------------------------------------------------------------------------------------------- // // Copyright (C)2007 DarkWynter Studios. All rights reserved. // //--------------------------------------------------------------------------------------------------------------------------------------------------- // {Contact : darkwynter.com for licensing information //--------------------------------------------------------------------------------------------------------------------------------------------------- namespace DarkWynter.Game.GameObjects { #region Using Statements using System; using System.Collections.Generic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Storage; using System.Xml; #endregion using DarkWynter.Engine.GameObjects; using DarkWynter.Engine.Globals; using DarkWynter.Engine.ObjectLib; using DarkWynter.Engine.Physics; using DarkWynter.Engine.Init; using DarkWynter.Stream; /// /// Creates a single generic prop object. /// Props require no additional code, and are loaded using the Prop tag in XML. /// Simply fill out the required fields and create a Location Map, and voila. /// public class Prop : GameObject, IProp { /// /// Prop constructor. /// public Prop(Load gameObjectLoader): base(gameObjectLoader) { mass.COR = 0.99999f; mass.objectType = Enums_Engine.ObjectType.PROP; } /// /// Generic loading for props. /// /// Xml node describing this type of prop. /// ObjectLibrary that this prop belong to. /// True if load was successful public override bool Load(ObjectLibrary objectLibrary) { if (!base.Load(objectLibrary)) { return false; } mass.boundingVolume = new BoundingVolume(new BoundingSphere(mass.currentPosition + new Vector3(0.0f, mass.scale.Y / 2.0f, 0.0f), mass.scale.Y)); mass.dynamicFrictionCoefficient = 0.0f; mass.isMoving = true; mass.objectType = Enums_Engine.ObjectType.PROP; mass.objectHeight = 5; return true; } } }