Esempio n. 1
0
        public LongVisualNote([NotNull] VisualBeatmap beatmap, [NotNull] LongNote baseNote, [NotNull] StageMetrics metrics)
            : base(beatmap, baseNote)
        {
            _baseNote      = baseNote;
            _metrics       = metrics;
            _noteRectangle = new TexturedRectangle(beatmap.GraphicsDevice);

            PreviewStartY = beatmap.CalculateY(baseNote.StartTick, metrics, metrics.FinishLineY);
            PreviewEndY   = beatmap.CalculateY(baseNote.EndTick, metrics, metrics.FinishLineY);
        }
Esempio n. 2
0
        public FloorVisualNote([NotNull] VisualBeatmap beatmap, [NotNull] FloorNote baseNote, [NotNull] StageMetrics metrics)
            : base(beatmap, baseNote)
        {
            _baseNote       = baseNote;
            _metrics        = metrics;
            _noteRectangle  = new TexturedRectangle(beatmap.GraphicsDevice);
            _linkHexahedron = new ColoredHexahedron(beatmap.GraphicsDevice);

            PreviewY = beatmap.CalculateY(baseNote.Tick, metrics, metrics.FinishLineY);
        }
        public SkyVisualNote([NotNull] VisualBeatmap beatmap, [NotNull] SkyNote baseNote, [NotNull] ArcVisualNote parent, [NotNull] StageMetrics metrics)
            : base(beatmap, baseNote)
        {
            _metrics = metrics;

            Parent = parent;

            PreviewY = beatmap.CalculateY(baseNote.Tick, metrics, metrics.FinishLineY);

            var graphicsDevice = beatmap.GraphicsDevice;

            _graphicsDevice = graphicsDevice;

            _vertexBuffer1 = new VertexBuffer(graphicsDevice, VertexPositionColorTexture.VertexDeclaration, 16, BufferUsage.WriteOnly);
            _indexBuffer1  = new IndexBuffer(graphicsDevice, IndexElementSize.SixteenBits, 24, BufferUsage.WriteOnly);

            _vertexBuffer2 = new VertexBuffer(graphicsDevice, VertexPositionColorTexture.VertexDeclaration, 8, BufferUsage.WriteOnly);
            _indexBuffer2  = new IndexBuffer(graphicsDevice, IndexElementSize.SixteenBits, 12, BufferUsage.WriteOnly);

            var indices1 = new ushort[] {
                // bottom, top
                0, 1, 2,
                2, 1, 3,
                4, 5, 6,
                6, 5, 7,

                // front, back
                8, 9, 10,
                10, 9, 11,
                12, 13, 14,
                14, 13, 15
            };

            _indexBuffer1.SetData(indices1);

            var indices2 = new ushort[] {
                0, 1, 2,
                2, 1, 3,
                4, 5, 6,
                6, 5, 7,
            };

            _indexBuffer2.SetData(indices2);

            _shadowRectangle = new ColoredRectangle(graphicsDevice);
        }
        public ArcVisualNote([NotNull] VisualBeatmap beatmap, [NotNull] ArcNote baseNote, [NotNull] StageMetrics metrics)
            : base(beatmap, baseNote)
        {
            _baseNote = baseNote;
            _metrics  = metrics;

            PreviewStartY = beatmap.CalculateY(baseNote.StartTick, metrics, metrics.FinishLineY);
            PreviewEndY   = beatmap.CalculateY(baseNote.EndTick, metrics, metrics.FinishLineY);

            _arcMesh = new BottomlessColoredTriangularPrism(beatmap.GraphicsDevice);
            _shadow  = new ColoredParallelogram(beatmap.GraphicsDevice);
            _support = new TexturedRectangle(beatmap.GraphicsDevice);
            _header  = new BottomlessColoredTetrahedron(beatmap.GraphicsDevice);

            if (baseNote.SkyNotes != null && baseNote.SkyNotes.Length > 0)
            {
                SkyVisualNotes = baseNote.SkyNotes.Select(n => new SkyVisualNote(beatmap, n, this, metrics)).ToArray();
            }
        }
Esempio n. 5
0
 protected VisualNoteBase([NotNull] VisualBeatmap beatmap, [NotNull] NoteBase baseNote)
 {
     Beatmap  = beatmap;
     BaseNote = baseNote;
     Type     = baseNote.Type;
 }