Exemplo n.º 1
0
        protected void _updateInterfernenceVertices(float laserLength, float interferenceWidth)
        {
            var beam = _laser.beam(_beamId);

            if (beam == null)
            {
                return;
            }

            float vScale = (interferenceWidth != 0f) ? (laserLength / interferenceWidth) : 0f;

            _interferenceVertices [0].TexCoord.X             = _interferenceVertices [1].TexCoord.X
                                                             = beam.interferenceOffset * vScale;
            _interferenceVertices [2].TexCoord.X             = _interferenceVertices [3].TexCoord.X
                                                             = (beam.interferenceOffset + 1f) * vScale;
            _interferenceMesh.updateVertices(_interferenceVertices);
        }
Exemplo n.º 2
0
        protected void _updateMiddleMesh(float laserLength, float meshWidth)
        {
            //meshWidth = 1f;

            float halfWidth  = meshWidth / 2f;
            float halfLength = laserLength / 2f;

            for (int i = 0; i < 8; i += 2)
            {
                _middleVertices [i].Position.Y     = +halfWidth;
                _middleVertices [i + 1].Position.Y = -halfWidth;
            }

            _middleVertices [0].Position.X = _middleVertices[1].Position.X = -halfLength - halfWidth;
            _middleVertices [2].Position.X = _middleVertices[3].Position.X = -halfLength + halfWidth;
            _middleVertices [4].Position.X = _middleVertices[5].Position.X = +halfLength - halfWidth;
            _middleVertices [6].Position.X = _middleVertices[7].Position.X = +halfLength + halfWidth;

            _middleMesh.updateVertices(_middleVertices);
        }