Ejemplo n.º 1
0
        public void Draw(float dt)
        {
            if (mLightCount != mPositions.Count)
            {
                Resize();
            }

      #if DEMO_SCRIPT
            // Clamp time value to 0 to 1
            mTime += 0.5f * dt;
            mTime  = (mTime >= 1.0f) ? mTime - 1.0f : mTime;

            double     angle   = (double)mTime * 2.0 * Math.PI;
            float      xOffset = (float)Math.Cos(angle) * mPathRadius;
            float      yOffset = (float)Math.Sin(angle) * mPathRadius;
            BHVector3f offset  = new BHVector3f(xOffset, yOffset, 0.0f);
      #else
            BHVector3f offset = new BHVector3f(0.0f, 0.0f, 0.0f);
      #endif

            // Draw local lights
            for (int i = 0; i < mLightCount; ++i)
            {
                BHVector3f pos = mPositions[i] + offset;
                CPlusPlusInterface.DrawLight(pos,
                                             mColors[i],
                                             10.0f);
            }

            // Draw window light
            if (!mLightOff)
            {
                CPlusPlusInterface.DrawLight(new BHVector3f(10.0f, 10.0f, 0.0f),
                                             new BHVector4f(1.0f, 1.0f, 1.0f, 1.0f),
                                             new BHVector3f(-1.0f, -1.0f, 0.0f),
                                             new BHVector3f(10.0f, 10.0f, 20.0f));
            }
        }