//---------------------------------------------------------------------------------------------------------------------------------------------------
//
// 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;
using DarkWynter.Engine.Globals;
using DarkWynter.Engine.Physics;
using DarkWynter.Engine.ObjectLib;
using DarkWynter.Engine.GameObjects;
using DarkWynter.Engine.Init;
using DarkWynter.Stream;
using DarkWynter.Engine.EventControl;
using System.Diagnostics;
#endregion
public class CubeOfCubes : GameObject
{
public CubeOfCubes(Load gameObjectLoader)
: base(gameObjectLoader)
{
// Clean and Debug :
// Player / AI / Thought
//Event Viz
// Add Draw object, or Billboard, to parent Event class
// Create new list and draw loop in ObjectLibrary.
// UserControl adds/removes and calls ToXml() on list to save.
}
public override bool Load(ObjectLibrary objectLibrary)
{
// Call before user code is executed
if (!base.Load(objectLibrary))
{
return false;
}
//draw.textureList[0] = Statics_Engine.SystemSettings.content.Load("Content/_textures/arrow");
// Get terrain height at position
//float yPosition = objectLibrary.terrain.GetTerrainHeight(load.startPosition.X / Statics_Engine.TerrainSettings.terrainScaleFactor,
// load.startPosition.Z / Statics_Engine.TerrainSettings.terrainScaleFactor);
float yPosition = float.Parse(load.node.Attributes["y"].Value) * Statics_Engine.TerrainSettings.terrainScaleFactor;
// Set position and reference
Vector3 locpos = new Vector3(load.startPosition.X, yPosition, load.startPosition.Z);
Vector3 refpos = new Vector3(load.startPosition.X, yPosition, load.startPosition.Z - 1);
mass.SetPosition(locpos, refpos);
draw.drawMethod = Enums_Stream.DrawMethod.BasicGameObject_Draw;
draw.technique = "BasicLightingShaderMain";
mass.scale = new Vector3(mass.scale.X, 20, mass.scale.Z);
mass.boundingVolume = new BoundingVolume(new BoundingSphere(mass.currentPosition, 180.0f));
return true;
}
public override void Update(ref ObjectLibrary objectLibrary)
{
base.Update(ref objectLibrary);
}
public override Draw Draw()
{
return base.Draw();
}
}
}