From e24d3006de40c3a817f38ddc773e0a19eb835234 Mon Sep 17 00:00:00 2001 From: "Mark Bulatenko (@bulatenkom)" Date: Fri, 19 Apr 2019 01:17:46 +0700 Subject: [PATCH] Fix README.md (some erratas in code sample) --- README.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 3902db4..c43ec0f 100644 --- a/README.md +++ b/README.md @@ -66,8 +66,8 @@ package tests import ( "github.com/g3n/engine/graphic" "github.com/g3n/engine/math32" + "github.com/g3n/g3nd/app" "github.com/g3n/g3nd/demos" - "github.com/g3n/g3nd/g3nd" ) // Sets the category and name of your test in the demos.Map @@ -85,33 +85,33 @@ type testsModel struct { } // This method will be called once when the test is selected from the G3ND list. -// app is a pointer to the G3ND application. -// It allows access to several methods such as app.Scene(), which returns the current scene, -// app.GuiPanel(), app.Camera(), app.Window() among others. -// You can build your scene adding your objects to the app.Scene() -func (t *testsModel) Initialize(app *g3nd.App) { +// 'a' is a pointer to the G3ND application. +// It allows access to several methods such as a.Scene(), which returns the current scene, +// a.GuiPanel(), a.Camera(), a.Window() among others. +// You can build your scene adding your objects to the a.Scene() +func (t *testsModel) Initialize(a *app.App) { // Show axis helper ah := graphic.NewAxisHelper(1.0) - app.Scene().Add(ah) + a.Scene().Add(ah) // Creates a grid helper and saves its pointer in the test state t.grid = graphic.NewGridHelper(50, 1, &math32.Color{0.4, 0.4, 0.4}) - app.Scene().Add(t.grid) + a.Scene().Add(t.grid) // Changes the camera position - app.Camera().GetCamera().SetPosition(0, 4, 10) + a.Camera().GetCamera().SetPosition(0, 4, 10) + a.Camera().GetCamera().LookAt(&math32.Vector3{0,0,0}) } // This method will be called at every frame // You can animate your objects here. -func (t *testsModel) Render(app *g3nd.App) { +func (t *testsModel) Render(a *app.App) { // Rotate the grid, just for show. - rps := app.FrameDeltaSeconds() * 2 * math32.Pi - t.grid.AddRotationY(rps * 0.05) + rps := a.FrameDeltaSeconds() * 2 * math32.Pi + t.grid.RotateY(rps * 0.05) } - ``` # Contributing