private void Create()
		{
			Name = selectedLevelObject;
			var plane = new PlaneQuad(Size.One, ContentLoader.Load<Material>(selectedLevelObject));
			levelObject = new Model(new ModelData(plane), new Vector3D(position.X, position.Y, 0.0f));
			levelObject.Orientation = Quaternion.FromAxisAngle(Vector3D.UnitX, -90.0f);
		}
		public void SetBackgroundModel(string selectedModel)
		{
			if (backgroundModel != null)
				backgroundModel.Dispose();
			if (selectedModel == "" || selectedModel == "None")
				return;
			var modelData = ContentLoader.Load<ModelData>(selectedModel);
			backgroundModel = new Model(modelData, Vector3D.Zero);
		}
Exemple #3
0
		private void DrawModel(Model model)
		{
			if (model == null)
				return;
			var modelTransform = Matrix.CreateScale(model.Scale);
			modelTransform *= Matrix.FromQuaternion(model.Orientation);
			modelTransform.Translation = model.Position;
			var data = model.Get<ModelData>();
			foreach (var mesh in data.Meshes)
				drawing.AddGeometry(mesh.Geometry, mesh.Material, mesh.LocalTransform * modelTransform);
		}
Exemple #4
0
		//ncrunch: no coverage start
		public virtual void RenderLevel()
		{
			if (Camera == null)
				return;
			scene = new Scene();
			scene.SetQuadraticBackground("LevelBackgroundSpace");
			levelModel = new Model(ModelName, Vector3D.Zero);
		}
Exemple #5
0
		public override void RenderModel()
		{
			Model = new Model(Name, Position)
			{
				Scale = Scale,
				Orientation = Quaternion.FromAxisAngle(Vector3D.UnitZ, RotationZ)
			};
			InitializeModel();
		}
		private void Create()
		{
			Name = SelectedLevelObject;
			var modelData = ContentLoader.Load<ModelData>(SelectedLevelObject);
			levelObject = new Model(modelData, new Vector3D(Position.X, Position.Y, 0));
		}