示例#1
0
 public KGEditorCommandRemoveEntity(KGEditorCoreWrapper core, MainWindow wnd, SceneEntity entity)
     : base(KGEditorCommandCode.ECC_RemoveEntity, "Remove entity")
 {
     core_   = core;
     wnd_    = wnd;
     entity_ = entity;
 }
示例#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;
 }
示例#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;
 }
示例#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;
 }
示例#5
0
 public KGEditorCommandSetControlMode(KGEditorCoreWrapper core, KGEditorCoreWrapper.ControlMode mode)
     : base(core, KGEditorCommandCode.ECC_SetControlMode, "Set control mode")
 {
     mode_ = mode;
 }
示例#6
0
 public KGEditorCommandSetProjectiveTex(KGEditorCoreWrapper core, uint id, string name)
     : base(core, KGEditorCommandCode.ECC_SetLightOuterAngle, "Set projective texture")
 {
     id_ = id;
     name_ = name;
 }
示例#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;
        }
示例#8
0
 public KGEditorCommandSetLightEnabled(KGEditorCoreWrapper core, uint id, bool enabled)
     : base(core, KGEditorCommandCode.ECC_SetLightEnabled, "Set light enabled")
 {
     id_      = id;
     enabled_ = enabled;
 }
示例#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;
 }
示例#10
0
 public KGEditorCommandSelectEntity(KGEditorCoreWrapper core, uint id)
     : base(core, KGEditorCommandCode.ECC_SelectEntity, "Select entity")
 {
     id_ = id;
 }
示例#11
0
 public KGEditorCommand(KGEditorCoreWrapper core, KGEditorCommandCode code, string cmd_name)
 {
     core_     = core;
     code_     = code;
     cmd_name_ = cmd_name;
 }
示例#12
0
 public KGEditorCommandSetCameraFoV(KGEditorCoreWrapper core, uint id, float fov)
     : base(core, KGEditorCommandCode.ECC_SetCameraFoV, "Set camera fov")
 {
     id_ = id;
     fov_ = fov;
 }
示例#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;
 }
示例#14
0
 public KGEditorCommandSetActiveCamera(KGEditorCoreWrapper core, uint id)
     : base(core, KGEditorCommandCode.ECC_SetActiveCamera, "Switch camera")
 {
     id_ = id;
 }
示例#15
0
 public KGEditorCommandSetCameraAspect(KGEditorCoreWrapper core, uint id, float aspect)
     : base(core, KGEditorCommandCode.ECC_SetCameraAspect, "Set camera aspect")
 {
     id_ = id;
     aspect_ = aspect;
 }
示例#16
0
 public KGEditorCommandSelectEntity(KGEditorCoreWrapper core, uint id)
     : base(core, KGEditorCommandCode.ECC_SelectEntity, "Select entity")
 {
     id_ = id;
 }
示例#17
0
 public KGEditorCommandRemoveEntity(KGEditorCoreWrapper core, uint entity_id)
     : base(core, KGEditorCommandCode.ECC_RemoveEntity, "Remove entity")
 {
     entity_id_ = entity_id;
 }
示例#18
0
 public KGEditorCommandHideEntity(KGEditorCoreWrapper core, uint id, bool hide)
     : base(core, KGEditorCommandCode.ECC_HideEntity, "Hide entity")
 {
     id_ = id;
     hide_ = hide;
 }
示例#19
0
 public KGEditorCommandAddLight(KGEditorCoreWrapper core, KGEditorCoreWrapper.LightType type, string name)
     : base(core, KGEditorCommandCode.ECC_AddLight, "Add light")
 {
     type_ = type;
     name_ = name;
 }
示例#20
0
 public KGEditorCommand(KGEditorCoreWrapper core, KGEditorCommandCode code, string cmd_name)
 {
     core_ = core;
     code_ = code;
     cmd_name_ = cmd_name;
 }
示例#21
0
 public KGEditorCommandRemoveEntity(KGEditorCoreWrapper core, uint entity_id)
     : base(core, KGEditorCommandCode.ECC_RemoveEntity, "Remove entity")
 {
     entity_id_ = entity_id;
 }
示例#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;
 }
示例#23
0
 public KGEditorCommandHideEntity(KGEditorCoreWrapper core, uint id, bool hide)
     : base(core, KGEditorCommandCode.ECC_HideEntity, "Hide entity")
 {
     id_   = id;
     hide_ = hide;
 }
示例#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;
 }
示例#25
0
 public KGEditorCommandSetEntityTranslation(KGEditorCoreWrapper core, uint id, float[] trans)
     : base(core, KGEditorCommandCode.ECC_SetEntityTranslation, "Set entity translation")
 {
     id_    = id;
     trans_ = trans;
 }
示例#26
0
 public KGEditorCommandSetControlMode(KGEditorCoreWrapper core, KGEditorCoreWrapper.ControlMode mode)
     : base(core, KGEditorCommandCode.ECC_SetControlMode, "Set control mode")
 {
     mode_ = mode;
 }
示例#27
0
 public KGEditorCommandClearEntities(KGEditorCoreWrapper core, KGEditorCoreWrapper.EntityType type)
     : base(core, KGEditorCommandCode.ECC_ClearEntities, "Clear entities")
 {
     type_ = type;
 }
示例#28
0
 public KGEditorCommandSetEntityName(KGEditorCoreWrapper core, uint id, string name)
     : base(core, KGEditorCommandCode.ECC_SetEntityName, "Set entity name")
 {
     id_ = id;
     name_ = name;
 }
示例#29
0
 public KGEditorCommandAddLight(KGEditorCoreWrapper core, KGEditorCoreWrapper.LightType type, string name)
     : base(core, KGEditorCommandCode.ECC_AddLight, "Add light")
 {
     type_ = type;
     name_ = name;
 }
示例#30
0
 public KGEditorCommandSetEntityRotation(KGEditorCoreWrapper core, uint id, float[] rot_quat)
     : base(core, KGEditorCommandCode.ECC_SetEntityRotation, "Set entity rotation")
 {
     id_ = id;
     rot_ = rot_quat;
 }
示例#31
0
 private void ControlMode(KGEditorCoreWrapper.ControlMode mode)
 {
     control_mode_ = mode;
     this.ExecuteCommand(new KGEditorCommandSetControlMode(core_, mode));
 }
示例#32
0
 public KGEditorCommandSetEntityScaling(KGEditorCoreWrapper core, uint id, float[] scaling)
     : base(core, KGEditorCommandCode.ECC_SetEntityScaling, "Set entity scaling")
 {
     id_ = id;
     scaling_ = scaling;
 }
示例#33
0
 void MainWindowUnloaded(object sender, RoutedEventArgs e)
 {
     CompositionTarget.Rendering -= this.MainWindowIdle;
     core_.Dispose();
     core_ = null;
 }
示例#34
0
 public KGEditorCommandSetEntityTranslation(KGEditorCoreWrapper core, uint id, float[] trans)
     : base(core, KGEditorCommandCode.ECC_SetEntityTranslation, "Set entity translation")
 {
     id_ = id;
     trans_ = trans;
 }
示例#35
0
 public KGEditorCommandAddModel(KGEditorCoreWrapper core, string meshml_name)
     : base(core, KGEditorCommandCode.ECC_AddModel, "Add model")
 {
     name_ = meshml_name;
 }
示例#36
0
 public KGEditorCommandSetLightAttrib(KGEditorCoreWrapper core, uint id, int attrib)
     : base(core, KGEditorCommandCode.ECC_SetLightAttrib, "Set light attribute")
 {
     id_ = id;
     attrib_ = attrib;
 }
示例#37
0
 public KGEditorCommandAddCamera(KGEditorCoreWrapper core, string name)
     : base(core, KGEditorCommandCode.ECC_AddCamera, "Add camera")
 {
     name_ = name;
 }
示例#38
0
 public KGEditorCommandSetLightColor(KGEditorCoreWrapper core, uint id, float[] color)
     : base(core, KGEditorCommandCode.ECC_SetLightColor, "Set light color")
 {
     id_ = id;
     color_ = color;
 }
示例#39
0
 public KGEditorCommandClearEntities(KGEditorCoreWrapper core, KGEditorCoreWrapper.EntityType type)
     : base(core, KGEditorCommandCode.ECC_ClearEntities, "Clear entities")
 {
     type_ = type;
 }
示例#40
0
 public KGEditorCommandSetLightEnabled(KGEditorCoreWrapper core, uint id, bool enabled)
     : base(core, KGEditorCommandCode.ECC_SetLightEnabled, "Set light enabled")
 {
     id_ = id;
     enabled_ = enabled;
 }
示例#41
0
 public KGEditorCommandSetEntityName(KGEditorCoreWrapper core, uint id, string name)
     : base(core, KGEditorCommandCode.ECC_SetEntityName, "Set entity name")
 {
     id_   = id;
     name_ = name;
 }
示例#42
0
 public KGEditorCommandAddCamera(KGEditorCoreWrapper core, string name)
     : base(core, KGEditorCommandCode.ECC_AddCamera, "Add camera")
 {
     name_ = name;
 }
示例#43
0
 public KGEditorCommandSetEntityScaling(KGEditorCoreWrapper core, uint id, float[] scaling)
     : base(core, KGEditorCommandCode.ECC_SetEntityScaling, "Set entity scaling")
 {
     id_      = id;
     scaling_ = scaling;
 }
示例#44
0
 public KGEditorCommandSetLightFalloff(KGEditorCoreWrapper core, uint id, float[] falloff)
     : base(core, KGEditorCommandCode.ECC_SetLightFalloff, "Set light falloff")
 {
     id_ = id;
     falloff_ = falloff;
 }
示例#45
0
 public KGEditorCommandSetEntityRotation(KGEditorCoreWrapper core, uint id, float[] rot_quat)
     : base(core, KGEditorCommandCode.ECC_SetEntityRotation, "Set entity rotation")
 {
     id_  = id;
     rot_ = rot_quat;
 }
示例#46
0
 public KGEditorCommandSetLightColor(KGEditorCoreWrapper core, uint id, float[] color)
     : base(core, KGEditorCommandCode.ECC_SetLightColor, "Set light color")
 {
     id_    = id;
     color_ = color;
 }
示例#47
0
 public KGEditorCommandSetActiveCamera(KGEditorCoreWrapper core, uint id)
     : base(core, KGEditorCommandCode.ECC_SetActiveCamera, "Switch camera")
 {
     id_ = id;
 }
示例#48
0
 public KGEditorCommandSetLightOuterAngle(KGEditorCoreWrapper core, uint id, float angle)
     : base(core, KGEditorCommandCode.ECC_SetLightOuterAngle, "Set light outer angle")
 {
     id_    = id;
     angle_ = angle;
 }
示例#49
0
 public KGEditorCommandSetLightAttrib(KGEditorCoreWrapper core, uint id, int attrib)
     : base(core, KGEditorCommandCode.ECC_SetLightAttrib, "Set light attribute")
 {
     id_     = id;
     attrib_ = attrib;
 }
示例#50
0
 public KGEditorCommandAddModel(KGEditorCoreWrapper core, string meshml_name)
     : base(core, KGEditorCommandCode.ECC_AddModel, "Add model")
 {
     name_ = meshml_name;
 }
示例#51
0
 public KGEditorCommandSetLightFalloff(KGEditorCoreWrapper core, uint id, float[] falloff)
     : base(core, KGEditorCommandCode.ECC_SetLightFalloff, "Set light falloff")
 {
     id_      = id;
     falloff_ = falloff;
 }
示例#52
0
 public KGEditorCommandSetCameraFoV(KGEditorCoreWrapper core, uint id, float fov)
     : base(core, KGEditorCommandCode.ECC_SetCameraFoV, "Set camera fov")
 {
     id_  = id;
     fov_ = fov;
 }
示例#53
0
 public KGEditorCommandSetProjectiveTex(KGEditorCoreWrapper core, uint id, string name)
     : base(core, KGEditorCommandCode.ECC_SetLightOuterAngle, "Set projective texture")
 {
     id_   = id;
     name_ = name;
 }
示例#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;
 }
示例#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;
 }
示例#56
0
 public KGEditorCommandSetSkyboxName(KGEditorCoreWrapper core, string name)
     : base(core, KGEditorCommandCode.ECC_SetSkyboxName, "Set skybox name")
 {
     name_ = name;
 }
示例#57
0
 public KGEditorCommandSetCameraAspect(KGEditorCoreWrapper core, uint id, float aspect)
     : base(core, KGEditorCommandCode.ECC_SetCameraAspect, "Set camera aspect")
 {
     id_     = id;
     aspect_ = aspect;
 }
示例#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));
        }
示例#59
0
 public KGEditorCommandSetSkyboxName(KGEditorCoreWrapper core, string name)
     : base(core, KGEditorCommandCode.ECC_SetSkyboxName, "Set skybox name")
 {
     name_ = name;
 }
示例#60
0
 public KGEditorCommandSetLightOuterAngle(KGEditorCoreWrapper core, uint id, float angle)
     : base(core, KGEditorCommandCode.ECC_SetLightOuterAngle, "Set light outer angle")
 {
     id_ = id;
     angle_ = angle;
 }