public override void Render(Matrix4 mat, LevelFrame frame)
        {
            GetVbo();

            GL.UniformMatrix4(frame.shaderIDTable.uniformModelToWorldMatrix, false, ref mat);

            GL.Uniform1(frame.shaderIDTable.uniformColorLevelObjectNumber, 0);
            GL.Uniform4(frame.shaderIDTable.uniformColor, new Vector4(1, 0, 0, 1));
            GL.DrawArrays(PrimitiveType.Triangles, 0, 3);
            GL.DrawArrays(PrimitiveType.Triangles, 3, 3);
            GL.DrawArrays(PrimitiveType.Triangles, 6, 3);
            GL.DrawArrays(PrimitiveType.Triangles, 9, 3);

            GL.Uniform1(frame.shaderIDTable.uniformColorLevelObjectNumber, 1);
            GL.Uniform4(frame.shaderIDTable.uniformColor, new Vector4(0, 1, 0, 1));
            GL.DrawArrays(PrimitiveType.Triangles, 12, 3);
            GL.DrawArrays(PrimitiveType.Triangles, 15, 3);
            GL.DrawArrays(PrimitiveType.Triangles, 18, 3);
            GL.DrawArrays(PrimitiveType.Triangles, 21, 3);

            GL.Uniform1(frame.shaderIDTable.uniformColorLevelObjectNumber, 2);
            GL.Uniform4(frame.shaderIDTable.uniformColor, new Vector4(0, 0, 1, 1));
            GL.DrawArrays(PrimitiveType.Triangles, 24, 3);
            GL.DrawArrays(PrimitiveType.Triangles, 27, 3);
            GL.DrawArrays(PrimitiveType.Triangles, 30, 3);
            GL.DrawArrays(PrimitiveType.Triangles, 33, 3);
        }
Пример #2
0
        public LightsFrame(Window wnd, LevelFrame levelFrame, List <Light> lights, LightConfig lightConfig) : base(wnd)
        {
            this.levelFrame  = levelFrame;
            this.lights      = lights;
            this.lightConfig = lightConfig;

            lightsProperties = new List <Tuple <Light, Dictionary <string, Dictionary <string, PropertyInfo> > > >();

            RecomputeProperties();
        }
Пример #3
0
 private void GenerateLevel()
 {
     if (nowLevel <= 7)
     {
         LevelFrame.Navigate(new System.Uri("Level" + nowLevel + ".xaml", UriKind.RelativeOrAbsolute));
     }
     else
     {
         MessageBox.Show("Ты прошел последний уровень!");
     }
 }
Пример #4
0
 public void Render(Selection selection, LevelFrame frame)
 {
     if (toolbox.transformSpace == TransformSpace.Global)
     {
         Render(selection.mean, frame);
     }
     else if (toolbox.transformSpace == TransformSpace.Local)
     {
         if (selection.newestObject != null)
         {
             Render(selection.mean, selection.newestObject.rotation, frame);
         }
         else
         {
             Render(selection.mean, frame);
         }
     }
 }
        public override void Render(Matrix4 mat, LevelFrame frame)
        {
            GetVbo();

            GL.UniformMatrix4(frame.shaderIDTable.uniformModelToWorldMatrix, false, ref mat);

            GL.Uniform1(frame.shaderIDTable.uniformColorLevelObjectNumber, 0);
            GL.Uniform4(frame.shaderIDTable.uniformColor, new Vector4(1, 0, 0, 1));
            GL.DrawArrays(PrimitiveType.LineStrip, 0, 2);

            GL.Uniform1(frame.shaderIDTable.uniformColorLevelObjectNumber, 1);
            GL.Uniform4(frame.shaderIDTable.uniformColor, new Vector4(0, 1, 0, 1));
            GL.DrawArrays(PrimitiveType.LineStrip, 2, 2);

            GL.Uniform1(frame.shaderIDTable.uniformColorLevelObjectNumber, 2);
            GL.Uniform4(frame.shaderIDTable.uniformColor, new Vector4(0, 0, 1, 1));
            GL.DrawArrays(PrimitiveType.LineStrip, 4, 2);
        }
Пример #6
0
    /************************************************Unity方法与事件***********************************************/

    /************************************************自 定 义 方 法************************************************/
    //设置等级边框
    public void SetFrame(string petName)
    {
        if (!string.IsNullOrEmpty(petName))
        {
            LevelFrame levelFrame = this.petLevelFrames.Find(t => t.PetName.ToUpper() == petName.ToUpper());
            if (levelFrame != null)
            {
                this.frame.sprite = levelFrame.FrameSprite;
            }
            else
            {
                Debug.LogErrorFormat("<><LevelBar.SetFrame>Can't find the pet frame, pet name is {0}", petName);
            }
        }
        else
        {
            Debug.LogErrorFormat("<><LevelBar.SetFrame>Parameter 'petName' is null");
        }
    }
Пример #7
0
        private void RenderMenuBar()
        {
            if (ImGui.BeginMainMenuBar())
            {
                if (ImGui.BeginMenu("File"))
                {
                    if (ImGui.MenuItem("Open engine.ps3"))
                    {
                        var res = CrossFileDialog.OpenFile(filter: ".ps3");
                        if (res.Length > 0)
                        {
                            openFrames.RemoveAll(FrameIsLevel);
                            LevelFrame lf = new LevelFrame(this);
                            Level      l  = new Level(res);
                            lf.LoadLevel(l);
                            AddFrame(lf);
                        }
                    }

                    if (ImGui.MenuItem("Quit"))
                    {
                        Environment.Exit(0);
                    }
                    ImGui.EndMenu();
                }

                if (ImGui.BeginMenu("About"))
                {
                    if (ImGui.MenuItem("About Replanetizer"))
                    {
                        AddFrame(new AboutFrame(this));
                    }
                    if (ImGui.MenuItem("Open ImGui demo window"))
                    {
                        AddFrame(new DemoWindowFrame(this));
                    }
                    ImGui.EndMenu();
                }

                ImGui.EndMainMenuBar();
            }
        }
Пример #8
0
        protected override void OnLoad()
        {
            base.OnLoad();

            openGLString = "OpenGL " + GL.GetString(StringName.Version);
            Title        = String.Format("Replanetizer ({0})", openGLString);

            controller = new ImGuiController(ClientSize.X, ClientSize.Y);

            UpdateInfoFrame.CheckForNewVersion(this);

            if (args.Length > 0)
            {
                LevelFrame lf = new LevelFrame(this);
                Level      l  = new Level(args[0]);
                lf.LoadLevel(l);

                AddFrame(lf);
            }
        }
        public LevelExportFrame(Window wnd, LevelFrame levelFrame) : base(wnd, levelFrame)
        {
            settings    = new ModelWriter.WriterLevelSettings();
            enumNameMap = Enum.GetNames(typeof(ModelWriter.WriterLevelMode));

            if (level != null)
            {
                if (level.terrainChunks.Count == 0)
                {
                    settings.chunksSelected[0] = true;
                }
                else
                {
                    for (int i = 0; i < level.terrainChunks.Count; i++)
                    {
                        settings.chunksSelected[i] = true;
                    }
                }
            }
        }
Пример #10
0
        public void Render(Vector3 position, Quaternion rotation, LevelFrame frame)
        {
            var mat = GetModelMatrix(position, rotation, frame);

            Render(mat, frame);
        }
Пример #11
0
 public abstract void Render(Matrix4 mat, LevelFrame frame);
Пример #12
0
        /// <summary>
        /// Get the model matrix, scaled by camera distance
        /// </summary>
        protected static Matrix4 GetModelMatrix(Vector3 position, Quaternion rotation, LevelFrame frame)
        {
            float camDist = (frame.camera.position - position).LengthFast;

            return
                (Matrix4.CreateScale(camDist * SCREEN_SPACE_SCALE) *
                 Matrix4.CreateFromQuaternion(rotation) *
                 Matrix4.CreateTranslation(position));
        }
 public void Render(Spline spline, LevelFrame frame)
 {
     Render(spline.GetVertex(currentVertex), frame);
 }
Пример #14
0
 public LevelSubFrame(Window wnd, LevelFrame levelFrame) : base(wnd)
 {
     this.levelFrame = levelFrame;
 }