Beispiel #1
0
        public override void UpdateScene(float dt)
        {
            base.UpdateScene(dt);
            // Get camera position from polar coords
            var x = _radius * MathF.Sin(_phi) * MathF.Cos(_theta);
            var z = _radius * MathF.Sin(_phi) * MathF.Sin(_theta);
            var y = _radius * MathF.Cos(_phi);

            // Build the view matrix
            var pos    = new Vector3(x, y, z);
            var target = new Vector3(0);
            var up     = new Vector3(0, 1, 0);

            _view = Matrix.LookAtLH(pos, target, up);

            _eyePosW = pos;

            // Update texture transform
            _t -= dt;
            if (_t < 0)
            {
                _texTransform = _fireAtlas.GetTexTransform(i++ % _fireAtlas.NumCells);
                _t            = 0.05f;
            }
        }