Exemplo n.º 1
0
        public override void RenderShape(VisionViewBase view, ShapeRenderMode mode)
        {
            if (TimeOfDay == null)
            {
                return;
            }
            const int iSteps     = 24;
            float     fStep      = 1.0f / (float)iSteps;
            float     fLen       = 200.0f * EditorManager.Settings.GlobalUnitScaling;
            float     fTime      = 0.0f;
            Vector3F  lastCorner = Vector3F.Zero;

            for (int i = 0; i < iSteps; i++, fTime += fStep)
            {
                if (!EditorManager.RendererNodeManager.GetTimeOfDaySnapshot(fTime, daytimeParams))
                {
                    continue;
                }
                Vector3F newCorner = Position + daytimeParams.SunDirection * fLen * 0.75f;
                if (i > 0)
                {
                    view.RenderSolidTriangle(Position, newCorner, lastCorner, VisionColors.Get(daytimeParams.AmbientColor));
                    view.RenderSolidTriangle(Position, lastCorner, newCorner, VisionColors.Get(daytimeParams.AmbientColor));
                }
                Vector3F vEnd = Position + daytimeParams.SunDirection * fLen;
                view.RenderLine(Position, vEnd, VisionColors.Get(daytimeParams.SunColor), 1.0f);
                uint iColor = (i == 12) ? VisionColors.White : VisionColors.Yellow;
                view.WriteText3D(vEnd, i.ToString() + ":00", iColor); // time

                lastCorner = newCorner;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Called every frame and per hotspot that belongs to the shape
        /// </summary>
        /// <param name="hotSpot"></param>
        /// <param name="view"></param>
        /// <param name="mode"></param>
        public override void OnHotSpotRender(HotSpotBase hotSpot, VisionViewBase view, ShapeRenderMode mode)
        {
            base.OnHotSpotRender(hotSpot, view, mode);

            Vector3F vStart = _hotSpotFadeOutDist1.Position;
            Vector3F vEnd   = _hotSpotFadeOutDist2.Position;

            view.RenderLine(vStart, vEnd, VisionColors.Yellow, 1.0f);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Overridden function
        /// </summary>
        /// <param name="hotSpot"></param>
        /// <param name="view"></param>
        /// <param name="mode"></param>
        public override void OnHotSpotRender(HotSpotBase hotSpot, VisionViewBase view, ShapeRenderMode mode)
        {
            base.OnHotSpotRender(hotSpot, view, mode);

            if (_hotSpotVolume.Visible)
            {
                Vector3F vStart = Position;
                Vector3F vEnd   = _hotSpotVolume.Position;
                view.RenderLine(vStart, vEnd, VisionColors.Cyan, 1.0f);
            }
        }
Exemplo n.º 4
0
 public void ShowTraceResult(VisionViewBase view)
 {
     if (bResultValid)
     {
         float cx = 0, cy = 0, cz = 0;
         float r = EditorManager.Settings.GlobalUnitScaling * 5.0f;
         if (view.Project2D(hitPoint, ref cx, ref cy, ref cz))
         {
             view.WriteText2D(cx, cy, hitPoint.ToString(), VisionColors.Yellow);
         }
         view.RenderCross(hitPoint, r, VisionColors.Yellow, 1.0f);
         view.RenderLine(hitPoint, hitPoint + hitNormal * r * 3.0f, VisionColors.RGB(100, 255, 100), 1.0f);
     }
 }
        public override void RenderShape(VisionViewBase view, ShapeRenderMode mode)
        {
            if (TimeOfDay == null)
            return;
              const int iSteps = 24;
              float fStep = 1.0f / (float)iSteps;
              float fLen = 200.0f * EditorManager.Settings.GlobalUnitScaling;
              float fTime = 0.0f;
              Vector3F lastCorner = Vector3F.Zero;
              for (int i=0; i<iSteps; i++,fTime += fStep)
              {
            if (!EditorManager.RendererNodeManager.GetTimeOfDaySnapshot(fTime, daytimeParams))
              continue;
            Vector3F newCorner = Position + daytimeParams.SunDirection * fLen * 0.75f;
            if (i > 0)
            {
              view.RenderSolidTriangle(Position, newCorner, lastCorner, VisionColors.Get(daytimeParams.AmbientColor));
              view.RenderSolidTriangle(Position, lastCorner, newCorner, VisionColors.Get(daytimeParams.AmbientColor));
            }
            Vector3F vEnd = Position + daytimeParams.SunDirection * fLen;
            view.RenderLine(Position, vEnd, VisionColors.Get(daytimeParams.SunColor), 1.0f);
            uint iColor = (i == 12) ? VisionColors.White : VisionColors.Yellow;
            view.WriteText3D(vEnd, i.ToString()+":00", iColor); // time

            lastCorner = newCorner;
              }
        }
Exemplo n.º 6
0
 public void ShowTraceResult(VisionViewBase view)
 {
     if (bResultValid)
       {
     float cx = 0, cy = 0, cz = 0;
     float r = EditorManager.Settings.GlobalUnitScaling * 5.0f;
     if (view.Project2D(hitPoint, ref cx, ref cy, ref cz))
       view.WriteText2D(cx, cy, hitPoint.ToString(), VisionColors.Yellow);
     view.RenderCross(hitPoint, r, VisionColors.Yellow, 1.0f);
     view.RenderLine(hitPoint, hitPoint + hitNormal * r * 3.0f, VisionColors.RGB(100, 255, 100), 1.0f);
       }
 }
Exemplo n.º 7
0
        /// <summary>
        /// Called every frame and per hotspot that belongs to the shape
        /// </summary>
        /// <param name="hotSpot"></param>
        /// <param name="view"></param>
        /// <param name="mode"></param>
        public override void OnHotSpotRender(HotSpotBase hotSpot, VisionViewBase view, ShapeRenderMode mode)
        {
            base.OnHotSpotRender (hotSpot, view, mode);

              Vector3F vStart = _hotSpotFadeOutDist1.Position;
              Vector3F vEnd = _hotSpotFadeOutDist2.Position;

              view.RenderLine(vStart, vEnd, VisionColors.Yellow, 1.0f);
        }
 public override void OnHotSpotRender(HotSpotBase hotSpot, VisionViewBase view, ShapeRenderMode mode)
 {
     base.OnHotSpotRender(hotSpot, view, mode);
     view.RenderLine(_hotSpotStartPoint.CurrentPosition + Position, _hotSpotEndPoint.CurrentPosition + Position, VisionColors.Grey, 2.0f);
 }
Exemplo n.º 9
0
 /// <summary>
 /// Overridden function
 /// </summary>
 /// <param name="hotSpot"></param>
 /// <param name="view"></param>
 /// <param name="mode"></param>
 public override void OnHotSpotRender(HotSpotBase hotSpot, VisionViewBase view, ShapeRenderMode mode)
 {
     base.OnHotSpotRender (hotSpot, view, mode);
       if (hotSpot==_hotSpotTangentIn)
       {
     view.RenderLine(Position,Position+_hotSpotTangentIn.CurrentPosition, VisionColors.Grey, 2.0f);
     return;
       }
       if (hotSpot==_hotSpotTangentOut)
       {
     view.RenderLine(Position,Position+_hotSpotTangentOut.CurrentPosition, VisionColors.Grey, 2.0f);
     return;
       }
 }
Exemplo n.º 10
0
        /// <summary>
        /// Overridden function
        /// </summary>
        /// <param name="hotSpot"></param>
        /// <param name="view"></param>
        /// <param name="mode"></param>
        public override void OnHotSpotRender(HotSpotBase hotSpot, VisionViewBase view, ShapeRenderMode mode)
        {
            base.OnHotSpotRender(hotSpot, view, mode);

              if (_hotSpotVolume.Visible)
              {
            Vector3F vStart = Position;
            Vector3F vEnd = _hotSpotVolume.Position;
            view.RenderLine(vStart, vEnd, VisionColors.Cyan, 1.0f);
              }
        }
Exemplo n.º 11
0
        /// <summary>
        /// Called every frame and per hotspot that belongs to the shape
        /// </summary>
        /// <param name="hotSpot"></param>
        /// <param name="view"></param>
        /// <param name="mode"></param>
        public override void OnHotSpotRender(HotSpotBase hotSpot, VisionViewBase view, ShapeRenderMode mode)
        {
            base.OnHotSpotRender (hotSpot, view, mode);

              if (_hotSpotIntensity.Visible)
              {
            Vector3F vStart = Position;
            Vector3F vEnd = _hotSpotIntensity.Position;
            Vector3F vAng = _hotSpotAngle.Position;

            view.RenderLine(vStart, vEnd, VisionColors.Yellow, 1.0f);
              }
        }
Exemplo n.º 12
0
        /// <summary>
        /// Called every frame and per hotspot that belongs to the shape
        /// </summary>
        /// <param name="hotSpot"></param>
        /// <param name="view"></param>
        /// <param name="mode"></param>
        public override void OnHotSpotRender(HotSpotBase hotSpot, VisionViewBase view, ShapeRenderMode mode)
        {
            base.OnHotSpotRender (hotSpot, view, mode);

              Vector3F vStart = Position;
              Vector3F vFanInt = this._hotSpotFanIntensity.Position;
              Vector3F vFanAng = this._hotSpotFanAngle.Position;
              Vector3F vCycLen = this._hotSpotLength.Position;
              Vector3F vRad = this._hotSpotRadius.Position;

              if (ConstraintType == EngineInstanceConstraint.ConstraintType_e.Cyclone)
            view.RenderLine(vStart, vCycLen, VisionColors.Yellow, 1.0f);

              if ((ConstraintType == EngineInstanceConstraint.ConstraintType_e.Cyclone)
            ||(ConstraintType == EngineInstanceConstraint.ConstraintType_e.Point)
            ||(ConstraintType == EngineInstanceConstraint.ConstraintType_e.Sphere)
            ||(ConstraintType == EngineInstanceConstraint.ConstraintType_e.XAxis)
            ||(ConstraintType == EngineInstanceConstraint.ConstraintType_e.YAxis)
            ||(ConstraintType == EngineInstanceConstraint.ConstraintType_e.ZAxis))
            view.RenderLine(vStart, vRad, VisionColors.Yellow, 1.0f);
        }
 public override void OnHotSpotRender(HotSpotBase hotSpot, VisionViewBase view, ShapeRenderMode mode)
 {
     base.OnHotSpotRender(hotSpot, view, mode);
     view.RenderLine(_hotSpotStartPoint.CurrentPosition + Position, _hotSpotEndPoint.CurrentPosition + Position, VisionColors.Grey, 2.0f);
 }