コード例 #1
0
        /// <summary>
        /// overridden function to render the shape
        /// </summary>
        /// <param name="view">destination view</param>
        /// <param name="mode">render mode</param>
        public override void RenderShape(VisionViewBase view, ShapeRenderMode mode)
        {
            base.RenderShape(view, mode);

            // First check whether we have a fully configured constraint with an invalid configuration.
            // In that case we display an error sign to inform the user about the invalid configuration
            if (EngineConstraintChainInstance != null && (!EngineConstraintChainInstance.IsConfigurationValid()))
            {
                float fSize = 10.0f * EditorManager.Settings.GlobalUnitScaling;
                view.EngineManager.RenderSprite(this.RenderPosition, @"textures\warning32.dds", VisionColors.White, fSize, fSize);
                return;
            }

            if (mode == ShapeRenderMode.Selected || (mode == ShapeRenderMode.Normal && this.ParentLayer == EditorManager.Scene.ActiveLayer))
            {
                float fSize = 3.0f * EditorManager.Settings.GlobalUnitScaling;
                view.EngineManager.RenderSprite(this.RenderPosition, @"textures\carabiner32.dds", VisionColors.White, fSize, fSize);

                if (_engineInstance == null)
                {
                    return;
                }
                if (this.IsHintSet(HintFlags_e.Virtual)) // in prefabs it is disturbing
                {
                    return;
                }
            }
        }
コード例 #2
0
        public override void OnHotSpotDragEnd(HotSpotBase hotSpot, VisionViewBase view)
        {
            base.OnHotSpotDragEnd(hotSpot, view);

            if (hotSpot == _hotSpotWindSpeed)
            {
                Vector3F vNewSpeed = _hotSpotWindSpeed.CurrentPosition;
                Vector3F vOldSpeed = _hotSpotWindSpeed.StartPosition;
                if (WindInLocalSpace)
                {
                    Matrix3F rot = Matrix3F.Transpose(RotationMatrix);
                    vNewSpeed = Matrix3F.Transform(rot, vNewSpeed);
                    vOldSpeed = Matrix3F.Transform(rot, vOldSpeed);
                }
                WindSpeed = vOldSpeed;                                                                              // set old value for the action
                EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this, "WindSpeed", vNewSpeed)); // send an action which sets the property from old value to new one
            }
            else if (hotSpot == _hotSpotLightSamplingOffset)
            {
                Vector3F vNewOffset = _hotSpotLightSamplingOffset.CurrentPosition;
                Vector3F vOldOffset = _hotSpotLightSamplingOffset.StartPosition;

                LightSamplingOffset = vOldOffset;                                                                              // set old value for the action
                EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this, "LightSamplingOffset", vNewOffset)); // send an action which sets the property from old value to new one
            }
        }
コード例 #3
0
 /// <summary>
 /// Overridden render function: Let the engine instance render itself and render a box
 /// </summary>
 /// <param name="view"></param>
 /// <param name="mode"></param>
 public override void RenderShape(VisionViewBase view, ShapeRenderMode mode)
 {
     if (HasEngineInstance())
     {
         EngineNode.RenderShape(view, mode);
     }
 }
コード例 #4
0
            public override void OnClicked(VisionViewBase view)
            {
                base.OnClicked(view);
                if (TerrainEditor.CurrentSelection == null)
                {
                    return;
                }
                ITerrainClipboardObject data = (EditorManager.ActiveComponent.Clipboard == null) ? null
          : EditorManager.ActiveComponent.Clipboard.Data as ITerrainClipboardObject;

                if (data == null)
                {
                    return;
                }

                TerrainSelectionShape selShape = (TerrainSelectionShape)this.Owner;
                float fRadX = data.OriginalExtent.GetSizeX() * 0.5f;
                float fRadY = data.OriginalExtent.GetSizeY() * 0.5f;

                GroupAction action = new GroupAction("adjust selection size");

                action.Add(SetPropertyAction.CreateSetPropertyAction(selShape, "MinX", fRadX)); // min values are also positive
                action.Add(SetPropertyAction.CreateSetPropertyAction(selShape, "MinY", fRadY));
                action.Add(SetPropertyAction.CreateSetPropertyAction(selShape, "MaxX", fRadX));
                action.Add(SetPropertyAction.CreateSetPropertyAction(selShape, "MaxY", fRadY));
                EditorManager.Actions.Add(action);
            }
コード例 #5
0
 /// <summary>
 /// Overridden function
 /// </summary>
 /// <param name="hotSpot"></param>
 /// <param name="view"></param>
 /// <param name="fDeltaX"></param>
 /// <param name="fDeltaY"></param>
 public override void OnHotSpotDrag(CSharpFramework.View.HotSpotBase hotSpot, VisionViewBase view, float fDeltaX, float fDeltaY)
 {
     if (hotSpot == _hotSpotGravity)
     {
         Gravity = _hotSpotGravity.CurrentDistance;
     }
 }
コード例 #6
0
 /// <summary>
 /// Called when user starts dragging a hotspot that belongs to this shape
 /// </summary>
 /// <param name="hotSpot"></param>
 /// <param name="view"></param>
 public override void OnHotSpotDragBegin(HotSpotBase hotSpot, VisionViewBase view)
 {
     if (hotSpot == _hotSpotHeight)
     {
         _hotSpotHeight.StartDistance = Height;
     }
 }
コード例 #7
0
 /// <summary>
 /// Called while the user drags a hotspot that belongs to this shape
 /// </summary>
 /// <param name="hotSpot"></param>
 /// <param name="view"></param>
 /// <param name="fDeltaX"></param>
 /// <param name="fDeltaY"></param>
 public override void OnHotSpotDrag(HotSpotBase hotSpot, VisionViewBase view, float fDeltaX, float fDeltaY)
 {
     if (hotSpot == _hotSpotHeight)
     {
         Height = _hotSpotHeight.CurrentDistance; // update for the view
     }
 }
コード例 #8
0
 /// <summary>
 /// Called when the user releases the mouse button on a hotspot
 /// </summary>
 /// <param name="hotSpot"></param>
 /// <param name="view"></param>
 public override void OnHotSpotDragEnd(HotSpotBase hotSpot, VisionViewBase view)
 {
     if (hotSpot == _hotSpotSizeX)
     {
         if (_hotSpotSizeX.HasChanged)
         {
             float fNewSize = _hotSpotSizeX.CurrentDistance;
             this.BoxSizeX = _hotSpotSizeX.StartDistance;                                                      // set old value for the action
             EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this, "BoxSizeX", fNewSize)); // send an action which sets the property from old value to new one
         }
     }
     if (hotSpot == _hotSpotSizeY)
     {
         if (_hotSpotSizeY.HasChanged)
         {
             float fNewSize = _hotSpotSizeY.CurrentDistance;
             this.BoxSizeY = _hotSpotSizeY.StartDistance;                                                      // set old value for the action
             EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this, "BoxSizeY", fNewSize)); // send an action which sets the property from old value to new one
         }
     }
     if (hotSpot == _hotSpotSizeZ)
     {
         if (_hotSpotSizeZ.HasChanged)
         {
             float fNewSize = _hotSpotSizeZ.CurrentDistance;
             this.BoxSizeZ = _hotSpotSizeZ.StartDistance;                                                      // set old value for the action
             EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this, "BoxSizeZ", fNewSize)); // send an action which sets the property from old value to new one
         }
     }
 }
コード例 #9
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;
            }
        }
コード例 #10
0
 /// <summary>
 /// Called when the user releases the mouse button on a hotspot
 /// </summary>
 /// <param name="hotSpot"></param>
 /// <param name="view"></param>
 public override void OnHotSpotDragEnd(HotSpotBase hotSpot, VisionViewBase view)
 {
     if (_typeProperties != null)
     {
         _typeProperties.OnHotSpotDragEnd(hotSpot, view);
     }
 }
コード例 #11
0
 /// <summary>
 /// Called while the user drags a hotspot that belongs to this shape
 /// </summary>
 /// <param name="hotSpot"></param>
 /// <param name="view"></param>
 /// <param name="fDeltaX"></param>
 /// <param name="fDeltaY"></param>
 public override void OnHotSpotDrag(HotSpotBase hotSpot, VisionViewBase view, float fDeltaX, float fDeltaY)
 {
     if (_typeProperties != null)
     {
         _typeProperties.OnHotSpotDrag(hotSpot, view, fDeltaX, fDeltaY);
     }
 }
コード例 #12
0
 public override void OnDragEnd(VisionViewBase view)
 {
     if (this.IsMouseOver(view.CurrentContext.MouseX, view.CurrentContext.MouseY))
     {
         base.OnDragEnd(view); // forward this only in this case, so we can handle the OnDragEnd as a button released event
     }
 }
コード例 #13
0
        public override void RenderShape(VisionViewBase view, ShapeRenderMode mode)
        {
            base.RenderShape(view, mode);

            // Don't draw carvers if "playing the game" or 'Visible' property is false
            if (EditorManager.InPlayingMode || FinalVisibleState == false)
            {
                return;
            }

            Vector3F    size = new Vector3F(_vBoxSize.X * ScaleX, _vBoxSize.Y * ScaleY, _vBoxSize.Z * ScaleZ);
            BoundingBox bbox = new BoundingBox(-size * 0.5f, size * 0.5f);

            if (_bInverted)
            {
                bbox.Translate(Position);
                uint color = (mode == ShapeRenderMode.Selected) ? (uint)0x6000ff80 : (uint)0x3000ff80;
                view.RenderSolidBox(bbox, color);
            }
            else
            {
                uint color = (mode == ShapeRenderMode.Selected) ? (uint)0x600080ff : (uint)0x300080ff;
                view.RenderOrientedSolidBox(bbox, Position, RotationMatrix, color);
            }
        }
コード例 #14
0
ファイル: UIShapeDialog.cs プロジェクト: pilnine/GUIEditor
        public override void RenderShape(VisionViewBase view, ShapeRenderMode mode)
        {
            base.RenderShape(view, mode);

            //UIDialogInstance.RenderShape(view, mode);
            //EngineNode.RenderShape(c);
            //base.RenderShape(view, mode);
        }
コード例 #15
0
ファイル: HotSpot2D.cs プロジェクト: swordlegend/2d
        public override void OnDrag(VisionViewBase view, float fDeltaX, float fDeltaY)
        {
            CurrentPosition = CurrentPosition + (new Vector2F(fDeltaX, fDeltaY));

            base.OnDrag(view, fDeltaX, fDeltaY);

            Sprite.SetCenterPosition(CurrentPosition.X, CurrentPosition.Y);
        }
コード例 #16
0
 public override void OnHotSpotRender(HotSpotBase hotSpot, VisionViewBase view, ShapeRenderMode mode)
 {
     base.OnHotSpotRender(hotSpot, view, mode);
     if (hotSpot == _hotSpotWindSpeed)
     {
         view.RenderArrow(this.RenderPosition, _hotSpotWindSpeed.CurrentPosition + RenderPosition, VisionColors.White, 1.0f, 4.0f);
     }
 }
コード例 #17
0
 /// <summary>
 /// Overridden function
 /// </summary>
 public override void RenderShape(VisionViewBase view, ShapeRenderMode mode)
 {
     base.RenderShape(view, mode);
     if (Selected) // the ShapeRenderMode does not help here since this shape does not have an engine instance
     {
         view.RenderLineFrustum(this.Position, this.RotationMatrix, 45.0f, 45.0f, 60.0f * EditorManager.Settings.GlobalUnitScaling, VisionColors.Blue, 1.0f);
     }
 }
コード例 #18
0
 /// <summary>
 /// Renders the shape in the view
 /// </summary>
 /// <param name="view"></param>
 /// <param name="mode"></param>
 public override void RenderShape(VisionViewBase view, ShapeRenderMode mode)
 {
     base.RenderShape(view, mode);
     if (_engineInstance != null)
     {
         EngineMirror.RenderShape(view, mode);
     }
 }
コード例 #19
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);
        }
コード例 #20
0
        public override void RenderShape(VisionViewBase view, ShapeRenderMode mode)
        {
            if (HasEngineInstance() && FinalVisibleState == true)
            {
                EngineNavMesh.DebugRender(m_debugRenderOffset);
            }

            base.RenderShape(view, mode);
        }
コード例 #21
0
        public override void RenderShape(VisionViewBase view, ShapeRenderMode mode)
        {
            base.RenderShape(view, mode);

            if (IsRendering && !CustomStaticMesh && EngineInstance != null)
            {
                EngineInstance.RenderShape(view, mode);
            }
        }
コード例 #22
0
        public override void RenderShape(VisionViewBase view, ShapeRenderMode mode)
        {
            base.RenderShape(view, mode);

            if (EngineInstance != null && Parent != null && ((CustomVolumeShape)Parent).IsRendering && !((CustomVolumeShape)Parent).CustomStaticMesh)
            {
                EngineInstance.RenderShape(view, mode);
            }
        }
コード例 #23
0
        /// <summary>
        /// overridden function to render the shape
        /// </summary>
        /// <param name="view">destination view</param>
        /// <param name="mode">render mode</param>
        public override void RenderShape(VisionViewBase view, ShapeRenderMode mode)
        {
            base.RenderShape(view, mode);

            if (_engineInstance != null && mode == ShapeRenderMode.Selected)
            {
                EngineBox.RenderShape(view, mode, AbsoluteBoundingBox);
            }
        }
コード例 #24
0
        public override void RenderShape(VisionViewBase view, ShapeRenderMode mode)
        {
            if (FinalVisibleState == true && EditorManager.Scene.AllShapesOfType(typeof(HavokAiEditorPlugin.Shapes.HavokNavMeshShape)).Count != 0)
            {
                HavokAiManaged.ManagedModule.ComputeAndDrawPath(view, _vStartPoint, _vEndPoint, _fCharacterRadius, _fCharacterHeight, _fpathDisplayOffset * _fCharacterHeight, VisionColors.Get(_pathColor));
            }

            base.RenderShape(view, mode);
        }
コード例 #25
0
        /// <summary>
        /// overridden function to render the shape
        /// </summary>
        /// <param name="view">destination view</param>
        /// <param name="mode">render mode</param>
        public override void RenderShape(VisionViewBase view, ShapeRenderMode mode)
        {
            base.RenderShape(view, mode); // render the bounding box

            // render direction vector
            if (_engineInstance != null)
            {
                EnginePGroup.RenderShape(view, mode);
            }
        }
コード例 #26
0
            public override void OnClicked(VisionViewBase view)
            {
                base.OnClicked(view);
                ITerrainClipboardObject clip = ((TerrainSelectionShape)Owner).OwnerTerrain.CopySelection(null);

                if (clip != null)
                {
                    EditorManager.Clipboard.Data = clip;
                }
            }
コード例 #27
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);

            // render gravity as arrow
            if (hotSpot == _hotSpotGravity)
            {
                view.RenderArrow(Position, _hotSpotGravity.Position, VisionColors.Yellow, 4.0f, 2.0f * EditorManager.Settings.GlobalUnitScaling);
            }
        }
コード例 #28
0
        public override void OnHotSpotDrag(HotSpotBase hotSpot, VisionViewBase view, float fDeltaX, float fDeltaY)
        {
            base.OnHotSpotDrag(hotSpot, view, fDeltaX, fDeltaY);

            _fMinX = _hotspotMinX.CurrentDistance;
            _fMinY = _hotspotMinY.CurrentDistance;
            _fMaxX = _hotspotMaxX.CurrentDistance;
            _fMaxY = _hotspotMaxY.CurrentDistance;

            UpdateSelectionRect();
        }
コード例 #29
0
ファイル: GUIContextShape.cs プロジェクト: pilnine/GUIEditor
        public override void RenderShape(VisionViewBase view, ShapeRenderMode mode)
        {
            base.RenderShape(view, mode);

            if (this.Visible == true)
            {
                uint iColor = VisionColors.RGBA(0, 255, 255, 255);

                view.RenderRectangle2D(0, 0, ResolutionX * _editScale, ResolutionY * _editScale, iColor, 1.0f);
            }
        }
コード例 #30
0
 /// <summary>
 /// Overridden function
 /// </summary>
 /// <param name="hotSpot"></param>
 /// <param name="view"></param>
 /// <param name="fDeltaX"></param>
 /// <param name="fDeltaY"></param>
 public override void OnHotSpotDrag(CSharpFramework.View.HotSpotBase hotSpot, VisionViewBase view, float fDeltaX, float fDeltaY)
 {
     if (hotSpot == _hotSpotSizeX)
     {
         SizeX = _hotSpotSizeX.CurrentDistance;
     }
     if (hotSpot == _hotSpotSizeY)
     {
         SizeY = _hotSpotSizeY.CurrentDistance;
     }
 }
コード例 #31
0
ファイル: HotSpot2D.cs プロジェクト: haoransun93/2d
        public override void RenderHotSpot(VisionViewBase view, ShapeRenderMode mode)
        {
            base.RenderHotSpot(view, mode);
            if (!OnScreen)
                return;

            Vector2F center2d = Sprite.CenterPosition;
            view.RenderRectangle2D(
                center2d.X - 5, center2d.Y - 5,
                center2d.X + 5, center2d.Y + 5,
                VisionColors.RGBA(0, 255, 0, 255), 1.0f );
        }
コード例 #32
0
        public override void RenderShape(VisionViewBase view, ShapeRenderMode mode)
        {
            base.RenderShape(view, mode);

            // Don't draw seed points if "playing the game" or 'Visible' property is false
            if (EditorManager.InPlayingMode || FinalVisibleState == false)
                return;

            if (mode == ShapeRenderMode.Selected || (mode == ShapeRenderMode.Normal && this.ParentLayer == EditorManager.Scene.ActiveLayer))
            {
                float fSize = 10.0f * EditorManager.Settings.GlobalUnitScaling;
                view.EngineManager.RenderSprite(this.RenderPosition, @"textures\pin_green32.dds", VisionColors.White, fSize, fSize);
            }
        }
コード例 #33
0
 /// <summary>
 /// Called while the user drags a hotspot that belongs to this shape
 /// </summary>
 /// <param name="hotSpot"></param>
 /// <param name="view"></param>
 /// <param name="fDeltaX"></param>
 /// <param name="fDeltaY"></param>
 public override void OnHotSpotDrag(HotSpotBase hotSpot, VisionViewBase view, float fDeltaX, float fDeltaY)
 {
     if (hotSpot==_hotSpotSizeX)
     this.BoxSizeX = _hotSpotSizeX.CurrentDistance;
       if (hotSpot==_hotSpotSizeY)
     this.BoxSizeY = _hotSpotSizeY.CurrentDistance;
       if (hotSpot==_hotSpotSizeZ)
     this.BoxSizeZ = _hotSpotSizeZ.CurrentDistance;
 }
コード例 #34
0
ファイル: MirrorShape.cs プロジェクト: elemen/projectanarchy
 /// <summary>
 /// Renders the shape in the view
 /// </summary>
 /// <param name="view"></param>
 /// <param name="mode"></param>
 public override void RenderShape(VisionViewBase view, ShapeRenderMode mode)
 {
     base.RenderShape (view, mode);
       if (_engineInstance!=null)
     EngineMirror.RenderShape(view,mode);
 }
コード例 #35
0
        public override void OnDragEnd(VisionViewBase view)
        {
            base.OnDragEnd(view);
              float fNewSX = _inst.ScaleX;
              float fNewSY = _inst.ScaleY;
              float fDist = System.Math.Max(CurrentDistance,0.01f);

              if (_bHoriz)
            fNewSX = fDist;
              else
            fNewSY = fDist;
              EditorManager.Actions.Add(new ScaleBillboardAction(Billboard, _inst, _inst.ScaleX, _inst.ScaleY, fNewSX, fNewSY));
        }
コード例 #36
0
ファイル: MirrorShape.cs プロジェクト: elemen/projectanarchy
 /// <summary>
 /// Overridden function
 /// </summary>
 /// <param name="hotSpot"></param>
 /// <param name="view"></param>
 public override void OnHotSpotDragBegin(CSharpFramework.View.HotSpotBase hotSpot, VisionViewBase view)
 {
     if (hotSpot==_hotSpotSizeX)
     _hotSpotSizeX.StartDistance = this.SizeX;
       if (hotSpot==_hotSpotSizeY)
     _hotSpotSizeY.StartDistance = this.SizeY;
 }
コード例 #37
0
ファイル: MirrorShape.cs プロジェクト: elemen/projectanarchy
 /// <summary>
 /// Overridden function
 /// </summary>
 /// <param name="hotSpot"></param>
 /// <param name="view"></param>
 public override void OnHotSpotDragEnd(CSharpFramework.View.HotSpotBase hotSpot, VisionViewBase view)
 {
     if (hotSpot==_hotSpotSizeX)
       {
     if (_hotSpotSizeX.HasChanged)
     {
       float fNewVal = _hotSpotSizeX.CurrentDistance;
       SizeX = _hotSpotSizeX.StartDistance; // set old value for the action
       EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this,"SizeX",fNewVal));
     }
       }
       if (hotSpot==_hotSpotSizeY)
       {
     if (_hotSpotSizeY.HasChanged)
     {
       float fNewVal = _hotSpotSizeY.CurrentDistance;
       SizeY = _hotSpotSizeY.StartDistance; // set old value for the action
       EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this,"SizeY",fNewVal));
     }
       }
 }
コード例 #38
0
        /// <summary>
        /// overridden function to render the shape
        /// </summary>
        /// <param name="view">destination view</param>
        /// <param name="mode">render mode</param>
        public override void RenderShape(VisionViewBase view, ShapeRenderMode mode)
        {
            base.RenderShape(view, mode);

              if (_engineInstance!=null)
              {
            if (mode == ShapeRenderMode.Selected || (ParentLayer == ParentLayer.ParentScene.ActiveLayer && _bPreview3D))
            {
              EngineBox.RenderShape(view, mode, VisionColors.Get(_previewColor));
            }
              }
        }
コード例 #39
0
 /// <summary>
 /// Overridden function
 /// </summary>
 /// <param name="hotSpot"></param>
 /// <param name="view"></param>
 /// <param name="fDeltaX"></param>
 /// <param name="fDeltaY"></param>
 public override void OnHotSpotDrag(CSharpFramework.View.HotSpotBase hotSpot, VisionViewBase view, float fDeltaX, float fDeltaY)
 {
     if (hotSpot==_hotSpotGravity)
     Gravity = _hotSpotGravity.CurrentDistance;
 }
コード例 #40
0
 public override void OnDrag(VisionViewBase view, float fDeltaX, float fDeltaY)
 {
     base.OnDrag(view, fDeltaX, fDeltaY);
 }
コード例 #41
0
 public override void OnDragBegin(VisionViewBase view)
 {
     base.OnDragBegin(view);
 }
コード例 #42
0
        /// <summary>
        /// overridden function to render the shape
        /// </summary>
        /// <param name="view">destination view</param>
        /// <param name="mode">render mode</param>
        public override void RenderShape(VisionViewBase view, ShapeRenderMode mode)
        {
            base.RenderShape(view, mode);

              if (EngineHeightfieldGenerator == null)
            return;

              EngineHeightfieldGenerator.RenderShape(view,mode);
        }
コード例 #43
0
 /// <summary>
 /// Overridden render function: Let the engine instance render itself
 /// </summary>
 /// <param name="view"></param>
 /// <param name="mode"></param>
 public override void RenderShape(VisionViewBase view, ShapeRenderMode mode)
 {
     base.RenderShape(view, mode);
 }
コード例 #44
0
        public override void OnHotSpotDragEnd(HotSpotBase hotSpot, VisionViewBase view)
        {
            base.OnHotSpotDragEnd(hotSpot, view);

              if (hotSpot == _hotSpotWindSpeed)
              {
            Vector3F vNewSpeed = _hotSpotWindSpeed.CurrentPosition;
            Vector3F vOldSpeed = _hotSpotWindSpeed.StartPosition;
            if (WindInLocalSpace)
            {
              Matrix3F rot = Matrix3F.Transpose(RotationMatrix);
              vNewSpeed = Matrix3F.Transform(rot, vNewSpeed);
              vOldSpeed = Matrix3F.Transform(rot, vOldSpeed);
            }
            WindSpeed = vOldSpeed; // set old value for the action
            EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this, "WindSpeed", vNewSpeed)); // send an action which sets the property from old value to new one
              }
              else if (hotSpot == _hotSpotLightSamplingOffset)
              {
            Vector3F vNewOffset = _hotSpotLightSamplingOffset.CurrentPosition;
            Vector3F vOldOffset = _hotSpotLightSamplingOffset.StartPosition;

            LightSamplingOffset = vOldOffset; // set old value for the action
            EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this, "LightSamplingOffset", vNewOffset)); // send an action which sets the property from old value to new one
              }
        }
コード例 #45
0
        /// <summary>
        /// overridden function to render the shape
        /// </summary>
        /// <param name="view">destination view</param>
        /// <param name="mode">render mode</param>
        public override void RenderShape(VisionViewBase view, ShapeRenderMode mode)
        {
            base.RenderShape(view,mode); // render the bounding box

              // render direction vector
              if (_engineInstance!=null)
            EnginePGroup.RenderShape(view,mode);
        }
コード例 #46
0
 /// <summary>
 /// Overridden function
 /// </summary>
 /// <param name="hotSpot"></param>
 /// <param name="view"></param>
 public override void OnHotSpotDragEnd(CSharpFramework.View.HotSpotBase hotSpot, VisionViewBase view)
 {
     if (hotSpot==_hotSpotGravity)
       {
     if (_hotSpotGravity.HasChanged)
     {
       float fNewVal = _hotSpotGravity.CurrentDistance;
       Gravity = _hotSpotGravity.StartDistance; // set old value for the action
       EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this,"Gravity",fNewVal));
     }
       }
       if (hotSpot==_hotSpotLightGridOfs)
       {
     Vector3F vNewPos = _hotSpotLightGridOfs.CurrentPosition;
     LightGridSampleOfs = _hotSpotLightGridOfs.StartPosition; // set old value for the action
     EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this,"LightGridSampleOfs",vNewPos)); // send an action which sets the property from old value to new one
       }
 }
コード例 #47
0
 /// <summary>
 /// Called when user starts dragging a hotspot that belongs to this shape
 /// </summary>
 /// <param name="hotSpot"></param>
 /// <param name="view"></param>
 public override void OnHotSpotDragBegin(HotSpotBase hotSpot, VisionViewBase view)
 {
     if (hotSpot==_hotSpotSizeX)
     _hotSpotSizeX.StartDistance = this.BoxSizeX;
       if (hotSpot==_hotSpotSizeY)
     _hotSpotSizeY.StartDistance = this.BoxSizeY;
       if (hotSpot==_hotSpotSizeZ)
     _hotSpotSizeZ.StartDistance = this.BoxSizeZ;
 }
コード例 #48
0
 public override void OnDragEnd(VisionViewBase view)
 {
     if (this.IsMouseOver(view.CurrentContext.MouseX, view.CurrentContext.MouseY))
     base.OnDragEnd(view); // forward this only in this case, so we can handle the OnDragEnd as a button released event
 }
コード例 #49
0
 /// <summary>
 /// Called when the user releases the mouse button on a hotspot
 /// </summary>
 /// <param name="hotSpot"></param>
 /// <param name="view"></param>
 public override void OnHotSpotDragEnd(HotSpotBase hotSpot, VisionViewBase view)
 {
     if (hotSpot==_hotSpotSizeX)
       {
     if (_hotSpotSizeX.HasChanged)
     {
       float fNewSize = _hotSpotSizeX.CurrentDistance;
       this.BoxSizeX = _hotSpotSizeX.StartDistance; // set old value for the action
       EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this,"BoxSizeX",fNewSize)); // send an action which sets the property from old value to new one
     }
       }
       if (hotSpot==_hotSpotSizeY)
       {
     if (_hotSpotSizeY.HasChanged)
     {
       float fNewSize = _hotSpotSizeY.CurrentDistance;
       this.BoxSizeY = _hotSpotSizeY.StartDistance; // set old value for the action
       EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this,"BoxSizeY",fNewSize)); // send an action which sets the property from old value to new one
     }
       }
       if (hotSpot==_hotSpotSizeZ)
       {
     if (_hotSpotSizeZ.HasChanged)
     {
       float fNewSize = _hotSpotSizeZ.CurrentDistance;
       this.BoxSizeZ = _hotSpotSizeZ.StartDistance; // set old value for the action
       EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this,"BoxSizeZ",fNewSize)); // send an action which sets the property from old value to new one
     }
       }
 }
コード例 #50
0
ファイル: MirrorShape.cs プロジェクト: elemen/projectanarchy
 /// <summary>
 /// Overridden function
 /// </summary>
 /// <param name="hotSpot"></param>
 /// <param name="view"></param>
 /// <param name="fDeltaX"></param>
 /// <param name="fDeltaY"></param>
 public override void OnHotSpotDrag(CSharpFramework.View.HotSpotBase hotSpot, VisionViewBase view, float fDeltaX, float fDeltaY)
 {
     if (hotSpot==_hotSpotSizeX)
     SizeX = _hotSpotSizeX.CurrentDistance;
       if (hotSpot==_hotSpotSizeY)
     SizeY = _hotSpotSizeY.CurrentDistance;
 }
コード例 #51
0
 /// <summary>
 /// Overridden hot spot handle function
 /// </summary>
 /// <param name="hotSpot"></param>
 /// <param name="view"></param>
 /// <param name="fDeltaX"></param>
 /// <param name="fDeltaY"></param>
 public override void OnHotSpotDrag(HotSpotBase hotSpot, VisionViewBase view, float fDeltaX, float fDeltaY)
 {
     base.OnHotSpotDrag (hotSpot, view, fDeltaX, fDeltaY);
 }
コード例 #52
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;
              }
        }
コード例 #53
0
 /// <summary>
 /// Overridden function
 /// </summary>
 /// <param name="hotSpot"></param>
 /// <param name="view"></param>
 public override void OnHotSpotDragBegin(CSharpFramework.View.HotSpotBase hotSpot, VisionViewBase view)
 {
     if (hotSpot==_hotSpotGravity)
     _hotSpotGravity.StartDistance = this.Gravity;
 }
コード例 #54
0
 /// <summary>
 /// Overridden hot spot handle function
 /// </summary>
 /// <param name="hotSpot"></param>
 /// <param name="view"></param>
 public override void OnHotSpotDragBegin(HotSpotBase hotSpot, VisionViewBase view)
 {
     base.OnHotSpotDragBegin (hotSpot, view);
 }
コード例 #55
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);

              // render gravity as arrow
              if (hotSpot==_hotSpotGravity)
              {
            view.RenderArrow(Position, _hotSpotGravity.Position, VisionColors.Yellow, 4.0f, 2.0f * EditorManager.Settings.GlobalUnitScaling);
              }
        }
コード例 #56
0
 /// <summary>
 /// Overridden hot spot handle function
 /// </summary>
 /// <param name="hotSpot"></param>
 /// <param name="view"></param>
 public override void OnHotSpotDragEnd(HotSpotBase hotSpot, VisionViewBase view)
 {
     base.OnHotSpotDragEnd (hotSpot, view);
       if (hotSpot==_hotSpotLightGridOfs)
       {
     Vector3F vNewPos = _hotSpotLightGridOfs.CurrentPosition;
     LightGridSampleOfs = _hotSpotLightGridOfs.StartPosition; // set old value for the action
     EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this,"LightGridSampleOfs",vNewPos)); // send an action which sets the property from old value to new one
       }
 }
コード例 #57
0
        public override void OnHotSpotDrag(HotSpotBase hotSpot, VisionViewBase view, float fDeltaX, float fDeltaY)
        {
            base.OnHotSpotDrag(hotSpot, view, fDeltaX, fDeltaY);

              // set on engine instance while dragging to see the effect
              if (hotSpot == _hotSpotWindSpeed)
              {
            if (HasEngineInstance())
              EnginePGroup.SetWindSpeed(_hotSpotWindSpeed.CurrentPosition, _bLocalSpaceWind);
              }
              else if (hotSpot == _hotSpotLightSamplingOffset)
              {
            if (HasEngineInstance())
              EnginePGroup.SetLightSamplingOffset(_hotSpotLightSamplingOffset.CurrentPosition);
              }
        }
コード例 #58
0
 public override void RenderShape(VisionViewBase view, ShapeRenderMode mode)
 {
     base.RenderShape(view, mode);
       if (HasEngineInstance())
     EngineBone.RenderShape(view, mode);
 }
コード例 #59
0
 public override void OnHotSpotRender(HotSpotBase hotSpot, VisionViewBase view, ShapeRenderMode mode)
 {
     base.OnHotSpotRender(hotSpot, view, mode);
       if (hotSpot == _hotSpotWindSpeed)
       {
     view.RenderArrow(this.RenderPosition, _hotSpotWindSpeed.CurrentPosition + RenderPosition, VisionColors.White, 1.0f, 4.0f);
       }
 }
コード例 #60
0
 /// <summary>
 /// Overridden function
 /// </summary>
 public override void RenderShape(VisionViewBase view, ShapeRenderMode mode)
 {
     base.RenderShape (view, mode);
       if (Selected) // the ShapeRenderMode does not help here since this shape does not have an engine instance
       {
     view.RenderLineFrustum(this.Position, this.RotationMatrix, 45.0f, 45.0f, 60.0f * EditorManager.Settings.GlobalUnitScaling, VisionColors.Blue, 1.0f);
       }
 }