Beispiel #1
0
 public void UpdateModels()
 {
     foreach (Renderable renderable in _renderInstances)
     {
         if (renderable is RenderInstance)
         {
             RenderInstance renderInstance = (RenderInstance)renderable;
             renderInstance.UpdateModel();
         }
     }
 }
Beispiel #2
0
		public SceneCDC(SRFile srFile, bool includeObjects)
			: base(includeObjects)
		{
			Name = srFile.Name;

			for (int m = 0; m < srFile.ModelCount; m++)
			{
				RenderInstance instance = new RenderInstance(srFile.Name, m, new SlimDX.Vector3(), new SlimDX.Vector3());
				instance.Name = srFile.Models[m].Name + "-" + m.ToString();
				_renderInstances.Add(instance);
			}

			if (includeObjects && srFile.Asset == CDC.Asset.Unit && srFile.IntroCount > 0)
			{
				foreach (CDC.Intro intro in srFile.Intros)
				{
					SlimDX.Vector3 position = new SlimDX.Vector3(
						0.01f * intro.position.x,
						0.01f * intro.position.z,
						0.01f * intro.position.y
					);

					// May be different for games besides SR1. Need to check.
					SlimDX.Vector3 rotation = new SlimDX.Vector3(
						-intro.rotation.z, // Yaw - Easy to spot from direction of raziel, enemies, flagall.
						-intro.rotation.y, // Pitch - Can be seen from the angle of hndtrch in huba6.
						-intro.rotation.x // Roll - Can be seen from the angle of stdorac in oracle3.
					);

					RenderInstance instance = new RenderInstance(intro.fileName, intro.modelIndex, position, rotation);
					instance.Name = intro.name;

					_renderInstances.Add(instance);
				}
			}
		}