private void Render(GameTime gameTime, IAether particle) { Matrix worldTransform; LeptonsManager.GetWorldTransform(particle, out worldTransform); IPhoton photon = particle as IPhoton; IMaterial material = (photon != null) ? photon.Material : null; if (photon != null && material != null) { ((IShaderMatrices)material).World = worldTransform; ((IShaderMatrices)material).View = this.View; ((IShaderMatrices)material).Projection = this.Projection; material.Apply(); material.ApplyTextures(photon.Textures); photon.Accept(material); return; } return; }
private void CreateManagers() { LeptonsMgr = new LeptonsManager(); ChrononsMgr = new ChrononsManager(); CamerasMgr = new CamerasManager(); MaterialsMgr = new MaterialsManager(); PhotonsMgr = new PhotonsManager(); Managers.Add(LeptonsMgr); Managers.Add(ChrononsMgr); Managers.Add(PhotonsMgr); Managers.Add(CamerasMgr); Managers.Add(MaterialsMgr); foreach (IAetherManager particleManager in Managers) { if (particleManager is IInitializable) { ((IInitializable)particleManager).Initialize(this); } } return; }