Beispiel #1
0
 public KGEditorCommandRemoveEntity(KGEditorCoreWrapper core, MainWindow wnd, SceneEntity entity)
     : base(KGEditorCommandCode.ECC_RemoveEntity, "Remove entity")
 {
     core_   = core;
     wnd_    = wnd;
     entity_ = entity;
 }
Beispiel #2
0
 public KGEditorCommandAddCamera(KGEditorCoreWrapper core, MainWindow wnd, Scene scene, string name)
     : base(KGEditorCommandCode.ECC_AddCamera, "Add camera")
 {
     core_  = core;
     wnd_   = wnd;
     scene_ = scene;
     name_  = name;
 }
Beispiel #3
0
 public KGEditorCommandAddModel(KGEditorCoreWrapper core, MainWindow wnd, Scene scene, string meshml_name)
     : base(KGEditorCommandCode.ECC_AddModel, "Add model")
 {
     core_       = core;
     wnd_        = wnd;
     scene_      = scene;
     model_name_ = meshml_name;
 }
Beispiel #4
0
 public KGEditorCommandAddLight(KGEditorCoreWrapper core, MainWindow wnd, Scene scene, KGEditorCoreWrapper.LightType type, string name)
     : base(KGEditorCommandCode.ECC_AddLight, "Add light")
 {
     core_  = core;
     wnd_   = wnd;
     scene_ = scene;
     type_  = type;
     name_  = name;
 }
Beispiel #5
0
 public KGEditorCommandSetControlMode(KGEditorCoreWrapper core, KGEditorCoreWrapper.ControlMode mode)
     : base(core, KGEditorCommandCode.ECC_SetControlMode, "Set control mode")
 {
     mode_ = mode;
 }
Beispiel #6
0
 public KGEditorCommandSetProjectiveTex(KGEditorCoreWrapper core, uint id, string name)
     : base(core, KGEditorCommandCode.ECC_SetLightOuterAngle, "Set projective texture")
 {
     id_ = id;
     name_ = name;
 }
Beispiel #7
0
        void MainWindowLoaded(object sender, RoutedEventArgs e)
        {
            IntPtr wnd = editor_wnd.Handle;
            core_ = new KGEditorCoreWrapper(wnd);

            core_.UpdatePropertyCallback(this.UpdatePropList);
            core_.UpdateSelectEntityCallback(this.UpdateSelectEntity);
            core_.UpdateAddEntityCallback(this.UpdateAddEntity);
            core_.UpdateRemoveEntityCallback(this.UpdateRemoveEntity);
            core_.AddModelCallback(this.AddModel);
            core_.AddLightCallback(this.AddLight);
            core_.AddCameraCallback(this.AddCamera);

            CompositionTarget.Rendering += this.MainWindowIdle;
        }
Beispiel #8
0
 public KGEditorCommandSetLightEnabled(KGEditorCoreWrapper core, uint id, bool enabled)
     : base(core, KGEditorCommandCode.ECC_SetLightEnabled, "Set light enabled")
 {
     id_      = id;
     enabled_ = enabled;
 }
Beispiel #9
0
 public KGEditorCommandSetCameraLookAt(KGEditorCoreWrapper core, uint id, float[] look_at)
     : base(core, KGEditorCommandCode.ECC_SetCameraLookAt, "Set camera look at")
 {
     id_      = id;
     look_at_ = look_at;
 }
Beispiel #10
0
 public KGEditorCommandSelectEntity(KGEditorCoreWrapper core, uint id)
     : base(core, KGEditorCommandCode.ECC_SelectEntity, "Select entity")
 {
     id_ = id;
 }
Beispiel #11
0
 public KGEditorCommand(KGEditorCoreWrapper core, KGEditorCommandCode code, string cmd_name)
 {
     core_     = core;
     code_     = code;
     cmd_name_ = cmd_name;
 }
Beispiel #12
0
 public KGEditorCommandSetCameraFoV(KGEditorCoreWrapper core, uint id, float fov)
     : base(core, KGEditorCommandCode.ECC_SetCameraFoV, "Set camera fov")
 {
     id_ = id;
     fov_ = fov;
 }
Beispiel #13
0
 public KGEditorCommandSetCameraLookAt(KGEditorCoreWrapper core, uint id, float[] look_at)
     : base(core, KGEditorCommandCode.ECC_SetCameraLookAt, "Set camera look at")
 {
     id_ = id;
     look_at_ = look_at;
 }
Beispiel #14
0
 public KGEditorCommandSetActiveCamera(KGEditorCoreWrapper core, uint id)
     : base(core, KGEditorCommandCode.ECC_SetActiveCamera, "Switch camera")
 {
     id_ = id;
 }
Beispiel #15
0
 public KGEditorCommandSetCameraAspect(KGEditorCoreWrapper core, uint id, float aspect)
     : base(core, KGEditorCommandCode.ECC_SetCameraAspect, "Set camera aspect")
 {
     id_ = id;
     aspect_ = aspect;
 }
Beispiel #16
0
 public KGEditorCommandSelectEntity(KGEditorCoreWrapper core, uint id)
     : base(core, KGEditorCommandCode.ECC_SelectEntity, "Select entity")
 {
     id_ = id;
 }
Beispiel #17
0
 public KGEditorCommandRemoveEntity(KGEditorCoreWrapper core, uint entity_id)
     : base(core, KGEditorCommandCode.ECC_RemoveEntity, "Remove entity")
 {
     entity_id_ = entity_id;
 }
Beispiel #18
0
 public KGEditorCommandHideEntity(KGEditorCoreWrapper core, uint id, bool hide)
     : base(core, KGEditorCommandCode.ECC_HideEntity, "Hide entity")
 {
     id_ = id;
     hide_ = hide;
 }
Beispiel #19
0
 public KGEditorCommandAddLight(KGEditorCoreWrapper core, KGEditorCoreWrapper.LightType type, string name)
     : base(core, KGEditorCommandCode.ECC_AddLight, "Add light")
 {
     type_ = type;
     name_ = name;
 }
Beispiel #20
0
 public KGEditorCommand(KGEditorCoreWrapper core, KGEditorCommandCode code, string cmd_name)
 {
     core_ = core;
     code_ = code;
     cmd_name_ = cmd_name;
 }
Beispiel #21
0
 public KGEditorCommandRemoveEntity(KGEditorCoreWrapper core, uint entity_id)
     : base(core, KGEditorCommandCode.ECC_RemoveEntity, "Remove entity")
 {
     entity_id_ = entity_id;
 }
Beispiel #22
0
 public KGEditorCommandSetCameraNearPlane(KGEditorCoreWrapper core, uint id, float near_plane)
     : base(core, KGEditorCommandCode.ECC_SetCameraNearPlane, "Set camera near plane")
 {
     id_ = id;
     near_plane_ = near_plane;
 }
Beispiel #23
0
 public KGEditorCommandHideEntity(KGEditorCoreWrapper core, uint id, bool hide)
     : base(core, KGEditorCommandCode.ECC_HideEntity, "Hide entity")
 {
     id_   = id;
     hide_ = hide;
 }
Beispiel #24
0
 public KGEditorCommandSetCameraUpVec(KGEditorCoreWrapper core, uint id, float[] up_vec)
     : base(core, KGEditorCommandCode.ECC_SetCameraUpVec, "Set camera up vec")
 {
     id_ = id;
     up_vec_ = up_vec;
 }
Beispiel #25
0
 public KGEditorCommandSetEntityTranslation(KGEditorCoreWrapper core, uint id, float[] trans)
     : base(core, KGEditorCommandCode.ECC_SetEntityTranslation, "Set entity translation")
 {
     id_    = id;
     trans_ = trans;
 }
Beispiel #26
0
 public KGEditorCommandSetControlMode(KGEditorCoreWrapper core, KGEditorCoreWrapper.ControlMode mode)
     : base(core, KGEditorCommandCode.ECC_SetControlMode, "Set control mode")
 {
     mode_ = mode;
 }
Beispiel #27
0
 public KGEditorCommandClearEntities(KGEditorCoreWrapper core, KGEditorCoreWrapper.EntityType type)
     : base(core, KGEditorCommandCode.ECC_ClearEntities, "Clear entities")
 {
     type_ = type;
 }
Beispiel #28
0
 public KGEditorCommandSetEntityName(KGEditorCoreWrapper core, uint id, string name)
     : base(core, KGEditorCommandCode.ECC_SetEntityName, "Set entity name")
 {
     id_ = id;
     name_ = name;
 }
Beispiel #29
0
 public KGEditorCommandAddLight(KGEditorCoreWrapper core, KGEditorCoreWrapper.LightType type, string name)
     : base(core, KGEditorCommandCode.ECC_AddLight, "Add light")
 {
     type_ = type;
     name_ = name;
 }
Beispiel #30
0
 public KGEditorCommandSetEntityRotation(KGEditorCoreWrapper core, uint id, float[] rot_quat)
     : base(core, KGEditorCommandCode.ECC_SetEntityRotation, "Set entity rotation")
 {
     id_ = id;
     rot_ = rot_quat;
 }
Beispiel #31
0
 private void ControlMode(KGEditorCoreWrapper.ControlMode mode)
 {
     control_mode_ = mode;
     this.ExecuteCommand(new KGEditorCommandSetControlMode(core_, mode));
 }
Beispiel #32
0
 public KGEditorCommandSetEntityScaling(KGEditorCoreWrapper core, uint id, float[] scaling)
     : base(core, KGEditorCommandCode.ECC_SetEntityScaling, "Set entity scaling")
 {
     id_ = id;
     scaling_ = scaling;
 }
Beispiel #33
0
 void MainWindowUnloaded(object sender, RoutedEventArgs e)
 {
     CompositionTarget.Rendering -= this.MainWindowIdle;
     core_.Dispose();
     core_ = null;
 }
Beispiel #34
0
 public KGEditorCommandSetEntityTranslation(KGEditorCoreWrapper core, uint id, float[] trans)
     : base(core, KGEditorCommandCode.ECC_SetEntityTranslation, "Set entity translation")
 {
     id_ = id;
     trans_ = trans;
 }
Beispiel #35
0
 public KGEditorCommandAddModel(KGEditorCoreWrapper core, string meshml_name)
     : base(core, KGEditorCommandCode.ECC_AddModel, "Add model")
 {
     name_ = meshml_name;
 }
Beispiel #36
0
 public KGEditorCommandSetLightAttrib(KGEditorCoreWrapper core, uint id, int attrib)
     : base(core, KGEditorCommandCode.ECC_SetLightAttrib, "Set light attribute")
 {
     id_ = id;
     attrib_ = attrib;
 }
Beispiel #37
0
 public KGEditorCommandAddCamera(KGEditorCoreWrapper core, string name)
     : base(core, KGEditorCommandCode.ECC_AddCamera, "Add camera")
 {
     name_ = name;
 }
Beispiel #38
0
 public KGEditorCommandSetLightColor(KGEditorCoreWrapper core, uint id, float[] color)
     : base(core, KGEditorCommandCode.ECC_SetLightColor, "Set light color")
 {
     id_ = id;
     color_ = color;
 }
Beispiel #39
0
 public KGEditorCommandClearEntities(KGEditorCoreWrapper core, KGEditorCoreWrapper.EntityType type)
     : base(core, KGEditorCommandCode.ECC_ClearEntities, "Clear entities")
 {
     type_ = type;
 }
Beispiel #40
0
 public KGEditorCommandSetLightEnabled(KGEditorCoreWrapper core, uint id, bool enabled)
     : base(core, KGEditorCommandCode.ECC_SetLightEnabled, "Set light enabled")
 {
     id_ = id;
     enabled_ = enabled;
 }
Beispiel #41
0
 public KGEditorCommandSetEntityName(KGEditorCoreWrapper core, uint id, string name)
     : base(core, KGEditorCommandCode.ECC_SetEntityName, "Set entity name")
 {
     id_   = id;
     name_ = name;
 }
Beispiel #42
0
 public KGEditorCommandAddCamera(KGEditorCoreWrapper core, string name)
     : base(core, KGEditorCommandCode.ECC_AddCamera, "Add camera")
 {
     name_ = name;
 }
Beispiel #43
0
 public KGEditorCommandSetEntityScaling(KGEditorCoreWrapper core, uint id, float[] scaling)
     : base(core, KGEditorCommandCode.ECC_SetEntityScaling, "Set entity scaling")
 {
     id_      = id;
     scaling_ = scaling;
 }
Beispiel #44
0
 public KGEditorCommandSetLightFalloff(KGEditorCoreWrapper core, uint id, float[] falloff)
     : base(core, KGEditorCommandCode.ECC_SetLightFalloff, "Set light falloff")
 {
     id_ = id;
     falloff_ = falloff;
 }
Beispiel #45
0
 public KGEditorCommandSetEntityRotation(KGEditorCoreWrapper core, uint id, float[] rot_quat)
     : base(core, KGEditorCommandCode.ECC_SetEntityRotation, "Set entity rotation")
 {
     id_  = id;
     rot_ = rot_quat;
 }
Beispiel #46
0
 public KGEditorCommandSetLightColor(KGEditorCoreWrapper core, uint id, float[] color)
     : base(core, KGEditorCommandCode.ECC_SetLightColor, "Set light color")
 {
     id_    = id;
     color_ = color;
 }
Beispiel #47
0
 public KGEditorCommandSetActiveCamera(KGEditorCoreWrapper core, uint id)
     : base(core, KGEditorCommandCode.ECC_SetActiveCamera, "Switch camera")
 {
     id_ = id;
 }
Beispiel #48
0
 public KGEditorCommandSetLightOuterAngle(KGEditorCoreWrapper core, uint id, float angle)
     : base(core, KGEditorCommandCode.ECC_SetLightOuterAngle, "Set light outer angle")
 {
     id_    = id;
     angle_ = angle;
 }
Beispiel #49
0
 public KGEditorCommandSetLightAttrib(KGEditorCoreWrapper core, uint id, int attrib)
     : base(core, KGEditorCommandCode.ECC_SetLightAttrib, "Set light attribute")
 {
     id_     = id;
     attrib_ = attrib;
 }
Beispiel #50
0
 public KGEditorCommandAddModel(KGEditorCoreWrapper core, string meshml_name)
     : base(core, KGEditorCommandCode.ECC_AddModel, "Add model")
 {
     name_ = meshml_name;
 }
Beispiel #51
0
 public KGEditorCommandSetLightFalloff(KGEditorCoreWrapper core, uint id, float[] falloff)
     : base(core, KGEditorCommandCode.ECC_SetLightFalloff, "Set light falloff")
 {
     id_      = id;
     falloff_ = falloff;
 }
Beispiel #52
0
 public KGEditorCommandSetCameraFoV(KGEditorCoreWrapper core, uint id, float fov)
     : base(core, KGEditorCommandCode.ECC_SetCameraFoV, "Set camera fov")
 {
     id_  = id;
     fov_ = fov;
 }
Beispiel #53
0
 public KGEditorCommandSetProjectiveTex(KGEditorCoreWrapper core, uint id, string name)
     : base(core, KGEditorCommandCode.ECC_SetLightOuterAngle, "Set projective texture")
 {
     id_   = id;
     name_ = name;
 }
Beispiel #54
0
 public KGEditorCommandSetCameraFarPlane(KGEditorCoreWrapper core, uint id, float far_plane)
     : base(core, KGEditorCommandCode.ECC_SetCameraFarPlane, "Set camera far plane")
 {
     id_        = id;
     far_plane_ = far_plane;
 }
Beispiel #55
0
 public KGEditorCommandSetCameraUpVec(KGEditorCoreWrapper core, uint id, float[] up_vec)
     : base(core, KGEditorCommandCode.ECC_SetCameraUpVec, "Set camera up vec")
 {
     id_     = id;
     up_vec_ = up_vec;
 }
Beispiel #56
0
 public KGEditorCommandSetSkyboxName(KGEditorCoreWrapper core, string name)
     : base(core, KGEditorCommandCode.ECC_SetSkyboxName, "Set skybox name")
 {
     name_ = name;
 }
Beispiel #57
0
 public KGEditorCommandSetCameraAspect(KGEditorCoreWrapper core, uint id, float aspect)
     : base(core, KGEditorCommandCode.ECC_SetCameraAspect, "Set camera aspect")
 {
     id_     = id;
     aspect_ = aspect;
 }
Beispiel #58
0
        private void AddLight(KGEditorCoreWrapper.LightType type)
        {
            string type_str;
            switch (type)
            {
                case KGEditorCoreWrapper.LightType.LT_Ambient:
                    type_str = "Ambient";
                    break;

                case KGEditorCoreWrapper.LightType.LT_Directional:
                    type_str = "Directional";
                    break;

                case KGEditorCoreWrapper.LightType.LT_Point:
                    type_str = "Point";
                    break;

                case KGEditorCoreWrapper.LightType.LT_Spot:
                default:
                    type_str = "Spot";
                    break;
            }

            string light_name;
            int index = 0;
            for (;;)
            {
                light_name = type_str + index.ToString();
                bool found = false;
                foreach (var light in scene_entity_category_[1].Children)
                {
                    if (core_.EntityName(light.Entity.ID) == light_name)
                    {
                        found = true;
                        break;
                    }
                }

                if (!found)
                {
                    break;
                }

                ++ index;
            }

            this.ExecuteCommand(new KGEditorCommandAddLight(core_, type, light_name));
        }
Beispiel #59
0
 public KGEditorCommandSetSkyboxName(KGEditorCoreWrapper core, string name)
     : base(core, KGEditorCommandCode.ECC_SetSkyboxName, "Set skybox name")
 {
     name_ = name;
 }
Beispiel #60
0
 public KGEditorCommandSetLightOuterAngle(KGEditorCoreWrapper core, uint id, float angle)
     : base(core, KGEditorCommandCode.ECC_SetLightOuterAngle, "Set light outer angle")
 {
     id_ = id;
     angle_ = angle;
 }