예제 #1
0
        private bool DragCallback(bool accept, Vector3 loc)
        {
            placing = false;

            dragObject.Dispose();

            if (accept)
            {
                location = loc;
                Vector3 scaleVec = new Vector3(scale, scale, scale);
                Vector3 rotVec   = new Vector3(0, rotation, 0);
                staticObject = new StaticObject(name, parent, app, meshName, location, scaleVec, rotVec);
                parent.Add(staticObject);
                for (int i = app.SelectedObject.Count - 1; i >= 0; i--)
                {
                    app.SelectedObject[i].Node.UnSelect();
                }
                if (staticObject.Node != null)
                {
                    staticObject.Node.Select();
                }
            }
            else
            {
                cancelled = true;
            }

            return(true);
        }
예제 #2
0
 private void RemovePointLightMarker()
 {
     if (displayObject != null)
     {
         displayObject.Dispose();
         displayObject = null;
     }
 }
예제 #3
0
        public void RemoveFromScene()
        {
            if (inScene)
            {
                inScene = false;
                foreach (IWorldObject child in children)
                {
                    child.RemoveFromScene();
                }

                displayObject.Dispose();
                displayObject = null;
            }
        }
        private bool DragCallback(bool accept, Vector3 loc)
        {
            placing = false;

            dragObject.Dispose();

            if (accept)
            {
                location = loc;
                Vector3 scaleVec = new Vector3(scale, scale, scale);
                Vector3 rotVec   = new Vector3(0, rotation, 0);
                pointLight = new PointLight(app, parent, scene, name, specular, diffuse, new Vector3(location.x, location.y, location.z));
                parent.Add(pointLight);
                for (int i = app.SelectedObject.Count - 1; i >= 0; i--)
                {
                    app.SelectedObject[i].Node.UnSelect();
                }
                if (pointLight.Node != null)
                {
                    pointLight.Node.Select();
                }
            }
            else
            {
                cancelled = true;
            }

            return(true);
        }
 public void RemoveFromScene()
 {
     if (inScene)
     {
         inScene = false;
         disp.Dispose();
         disp = null;
     }
     foreach (IWorldObject child in children)
     {
         if (child is ParticleEffect && app.DisplayParticleEffects && updating && (parent as WorldObjectCollection).InScene)
         {
             continue;
         }
         child.RemoveFromScene();
     }
 }
        public void RemoveFromScene()
        {
            app.GlobalDirectionalLight = null;
            if (displayObject != null)
            {
                displayObject.Dispose();
            }
            displayObject = null;

            inScene = false;
        }
 public void RemoveFromScene()
 {
     if (inScene || displayObject != null)
     {
         if (displayObject != null)
         {
             displayObject.Dispose();
             displayObject = null;
         }
     }
     inScene = false;
 }
예제 #8
0
        protected void StopDrag(bool accept)
        {
            bool valid = dragCallback(accept, location);

            // if the callback accepts the placement, then stop the drag and clean up
            if (valid)
            {
                app.ReleaseMouse();
                if (disposeDragObject)
                {
                    dragObject.Dispose();
                }

                dragging = false;
            }
        }
 protected void PointPlacementComplete(List <Vector3> points)
 {
     dragMarker.Dispose();
 }
예제 #10
0
 protected void PointPlacementComplete(List <Vector3> list)
 {
     dragObject.Dispose();
 }
예제 #11
0
        private void UpdateShowCircles()
        {
            if (app.DisplayPointLightCircles)
            {
                if (HalfAttenuationRadius < AttenuationRange)
                {
                    if (halfCircleObject == null)
                    {
                        halfCircleObject = new DisplayObject(String.Format("{0}-halfAttenuationCircle", this.Name), app, "PointLightCircle", scene, app.Assets.assetFromName(app.Config.PointLightCircleMeshName).AssetName, this.Position, Vector3.UnitScale, Vector3.Zero, null);
                        halfCircleObject.MaterialName = "world_editor_light_ring.lightRing.green";
                    }
                }
                else
                {
                    if (halfCircleObject != null)
                    {
                        halfCircleObject.Dispose();
                        halfCircleObject = null;
                    }
                }
                if (QuarterAttenuationRadius < AttenuationRange)
                {
                    if (quarterCircleObject == null)
                    {
                        quarterCircleObject = new DisplayObject(String.Format("{0}-quarterAttenutationCircle", this.Name), app, "PointLightCircle", scene, app.Assets.assetFromName(app.Config.PointLightCircleMeshName).AssetName, this.Position, Vector3.UnitScale, Vector3.Zero, null);
                        quarterCircleObject.MaterialName = "world_editor_light_ring.lightRing.yellow";
                    }
                }
                else
                {
                    if (quarterCircleObject != null)
                    {
                        quarterCircleObject.Dispose();
                        quarterCircleObject = null;
                    }
                }

                if (maxCircleObject == null)
                {
                    maxCircleObject = new DisplayObject(String.Format("{0}-maxAttenuationCircle", this.Name), app, "PointLightCircle", scene, app.Assets.assetFromName(app.Config.PointLightCircleMeshName).AssetName, this.Position, Vector3.UnitScale, Vector3.Zero, null);
                    maxCircleObject.MaterialName = "world_editor_light_ring.lightRing.red";
                }
                if (halfCircleObject != null)
                {
                    halfCircleObject.Scale = new Vector3(HalfAttenuationRadius, HalfAttenuationRadius, HalfAttenuationRadius);
                }
                if (quarterCircleObject != null)
                {
                    quarterCircleObject.Scale = new Vector3(QuarterAttenuationRadius, QuarterAttenuationRadius, QuarterAttenuationRadius);
                }
                maxCircleObject.Scale = new Vector3(attenuationRange, attenuationRange, attenuationRange);
            }
            else
            {
                showCircles = false;
                if (halfCircleObject != null)
                {
                    halfCircleObject.Dispose();
                    halfCircleObject = null;
                }
                if (quarterCircleObject != null)
                {
                    quarterCircleObject.Dispose();
                    quarterCircleObject = null;
                }
                if (maxCircleObject != null)
                {
                    maxCircleObject.Dispose();
                    maxCircleObject = null;
                }
            }
        }