Ejemplo n.º 1
0
 public List<DummyObject> GetObjectsInSelection(DummyWorld dummyWorld)
 {
     return dummyWorld.GetDummyObjectFromID(
         GraphicsManager.GetPickingScreenObjects(SelectionRectangle).ToArray());
 }
Ejemplo n.º 2
0
        public Tuple<RayHit, DummyObject> GetPickingLocation(DummyWorld dummyWorld, Form gameForm)
        {
            Ray ray = Utils.CreateWorldRayFromScreenPoint(
                new Vector2(mControls.MouseState.X, mControls.MouseState.Y),
                mGraphicsDevice.Viewport,
                mCamera.Position,
                mCamera.View,
                mCamera.Projection);

            Tuple<RayHit, DummyObject> castResult;
            if (dummyWorld.RayCast(ray, 2000.0f, out castResult))
            {
                return castResult;
            }
            return null;
        }
Ejemplo n.º 3
0
        public MapEditor(GraphicsDevice graphicsDevice, FPSCamera camera, ContentManager content, GameDeviceControl gameControl, EditorForm editorForm)
        {
            this.EditorForm = editorForm;
            this.HeightMapBrushPropertiesPane = editorForm.HeightMapBrushPropertiesForm;
            this.ObjectParameterPane = editorForm.ObjectParametersForm;
            this.ObjectPlacementPane = editorForm.ObjectPlacementPanel;
            this.TextureBrushPropertiesPane = editorForm.TextureBrushPropertiesForm;
            this.TextureLayerPane = editorForm.TextureLayerForm;
            this.TextureSelectionPane = editorForm.TextureSelectionForm;
            this.GizmoForm = editorForm.GizmoForm;
            mGraphics = graphicsDevice;
            mGameControl = gameControl;
            mCamera = camera;
            mDummyWorld = new DummyWorld(mControls);
            mEntity = new Entity(graphicsDevice, mControls, mCamera);
            mGizmo = new ObjectModificationGizmo(mControls, mCamera);
            InitializePanes();

            mTextureTransformShader = content.Load<Effect>("shaders/TextureTransform");

            NewHandler(this, EventArgs.Empty);
        }