private void Reset() { this.FatAxisMesh = new Mesh() { Effect = (BaseEffect) new DefaultEffect.VertexColored() }; this.FatAxisMesh.AddColoredBox(new Vector3(1f, 1f, 10000f) / 200f, new Vector3(-0.5f, -0.5f, 0.0f) / 200f, Color.Blue, false); this.FatAxisMesh.Rotation = new Quaternion(-0.7408407f, -0.4897192f, 0.4504161f, 0.09191696f); this.FatAxisMesh.Scale = new Vector3(3f); this.FatAxisMesh.Position = new Vector3(7.574002f, 3.049632f, 5.773395f); if (this.HelixMesh != null && this.HelixMesh.Groups.Count == 1) (this.HelixMesh.FirstGroup.Geometry as BufferedIndexedPrimitives<FezVertexPositionColor>).Dispose(); this.HelixMesh = new Mesh() { Effect = (BaseEffect) new DefaultEffect.VertexColored() }; for (int index = 0; index < 750; ++index) { float angle = (float) index / 1f; Group group = this.HelixMesh.AddColoredBox(new Vector3(0.2f, 70f, 0.2f) / 10000f, Vector3.Zero, EndCutscene32Host.PurpleBlack, true); group.Position = new Vector3(0.0f, 0.0f, (float) (((double) index - 375.0) / 3000.0)); group.Rotation = Quaternion.CreateFromAxisAngle(Vector3.UnitZ, angle); } this.HelixMesh.CollapseToBuffer<FezVertexPositionColor>(); this.HelixMesh.Rotation = this.FatAxisMesh.Rotation; this.HelixMesh.Scale = this.FatAxisMesh.Scale; this.HelixMesh.Culling = CullMode.None; Random random = RandomHelper.Random; FezVertexPositionColor[] vertices = new FezVertexPositionColor[200000]; int[] indices = new int[200000]; for (int index = 0; index < 100000; ++index) { vertices[index * 2] = new FezVertexPositionColor(new Vector3((float) random.NextDouble() - 0.5f, (float) random.NextDouble() - 0.5f, 0.0f), new Color((int) (byte) random.Next(0, 256), (int) (byte) random.Next(0, 256), (int) (byte) random.Next(0, 256), 0)); vertices[index * 2 + 1] = new FezVertexPositionColor(vertices[index * 2].Position, new Color((int) vertices[index * 2].Color.R, (int) vertices[index * 2].Color.G, (int) vertices[index * 2].Color.B, (int) byte.MaxValue)); indices[index * 2] = index * 2; indices[index * 2 + 1] = index * 2 + 1; } this.NoiseMesh = new Mesh() { Effect = (BaseEffect) (this.ShimmeringEffect = new ShimmeringPointsEffect()) }; Group group1 = this.NoiseMesh.AddGroup(); BufferedIndexedPrimitives<FezVertexPositionColor> indexedPrimitives = new BufferedIndexedPrimitives<FezVertexPositionColor>(vertices, indices, PrimitiveType.LineList); indexedPrimitives.UpdateBuffers(); indexedPrimitives.CleanUp(); group1.Geometry = (IIndexedPrimitiveCollection) indexedPrimitives; this.NoiseMesh.Effect.ForcedProjectionMatrix = new Matrix?(Matrix.CreateOrthographic(1f, 1f, 0.1f, 100f)); this.NoiseMesh.Effect.ForcedViewMatrix = new Matrix?(Matrix.CreateLookAt(-Vector3.UnitZ, Vector3.Zero, Vector3.Up)); this.PurpleGradientTexture = this.CMProvider.Global.Load<Texture2D>("Other Textures/end_cutscene/purple_gradient"); }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (this.HelixMesh != null) this.HelixMesh.Dispose(); if (this.FatAxisMesh != null) this.FatAxisMesh.Dispose(); this.HelixMesh = this.FatAxisMesh = this.NoiseMesh = (Mesh) null; this.ShimmeringEffect = (ShimmeringPointsEffect) null; }