Skip to content

Commit

Permalink
Renamed infinite grid to grid
Browse files Browse the repository at this point in the history
  • Loading branch information
kpal81xd committed Oct 31, 2024
1 parent 57f655b commit 3493c6a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions examples/src/examples/gizmos/transform-rotate.example.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as pc from 'playcanvas';
import { data } from 'examples/observer';
import { deviceType, fileImport, rootPath } from 'examples/utils';

const { InfiniteGrid } = await fileImport(rootPath + '/static/scripts/infinite-grid.js');
const { Grid } = await fileImport(rootPath + '/static/scripts/grid.js');

const canvas = /** @type {HTMLCanvasElement} */ (document.getElementById('application-canvas'));
window.focus();
Expand Down Expand Up @@ -86,7 +86,7 @@ data.set('camera', {

// attach grid
app.root.addComponent('script');
const grid = app.root.script.create(InfiniteGrid);
const grid = app.root.script.create(Grid);
grid.halfExtents = new pc.Vec2(2, 2);
grid.attach(camera.camera);

Expand Down
4 changes: 2 additions & 2 deletions examples/src/examples/gizmos/transform-scale.example.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as pc from 'playcanvas';
import { data } from 'examples/observer';
import { deviceType, fileImport, rootPath } from 'examples/utils';

const { InfiniteGrid } = await fileImport(rootPath + '/static/scripts/infinite-grid.js');
const { Grid } = await fileImport(rootPath + '/static/scripts/grid.js');

const canvas = /** @type {HTMLCanvasElement} */ (document.getElementById('application-canvas'));
window.focus();
Expand Down Expand Up @@ -86,7 +86,7 @@ data.set('camera', {

// attach grid
app.root.addComponent('script');
const grid = app.root.script.create(InfiniteGrid);
const grid = app.root.script.create(Grid);
grid.halfExtents = new pc.Vec2(2, 2);
grid.attach(camera.camera);

Expand Down
4 changes: 2 additions & 2 deletions examples/src/examples/gizmos/transform-translate.example.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as pc from 'playcanvas';
import { data } from 'examples/observer';
import { deviceType, rootPath, fileImport } from 'examples/utils';

const { InfiniteGrid } = await fileImport(rootPath + '/static/scripts/infinite-grid.js');
const { Grid } = await fileImport(rootPath + '/static/scripts/grid.js');

const canvas = /** @type {HTMLCanvasElement} */ (document.getElementById('application-canvas'));
window.focus();
Expand Down Expand Up @@ -86,7 +86,7 @@ data.set('camera', {

// attach grid
app.root.addComponent('script');
const grid = app.root.script.create(InfiniteGrid);
const grid = app.root.script.create(Grid);
grid.halfExtents = new pc.Vec2(2, 2);
grid.attach(camera.camera);

Expand Down
4 changes: 2 additions & 2 deletions examples/src/examples/misc/editor.example.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as pc from 'playcanvas';
import { data } from 'examples/observer';
import { deviceType, rootPath, localImport, fileImport } from 'examples/utils';

const { InfiniteGrid } = await fileImport(rootPath + '/static/scripts/infinite-grid.js');
const { Grid } = await fileImport(rootPath + '/static/scripts/grid.js');

const canvas = /** @type {HTMLCanvasElement} */ (document.getElementById('application-canvas'));
window.focus();
Expand Down Expand Up @@ -130,7 +130,7 @@ orbitCamera.distance = 5 * camera.camera?.aspectRatio;

// attach grid
app.root.addComponent('script');
const grid = app.root.script.create(InfiniteGrid);
const grid = app.root.script.create(Grid);
grid.halfExtents = new pc.Vec2(4, 4);
grid.attach(camera.camera);

Expand Down
6 changes: 3 additions & 3 deletions scripts/infinite-grid.js → scripts/grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ const fragmentShader = /* glsl*/ `
}
`;

class InfiniteGrid extends Script {
class Grid extends Script {
/**
* @type {GraphicsDevice}
*/
Expand Down Expand Up @@ -248,7 +248,7 @@ class InfiniteGrid extends Script {
this._device = this.app.graphicsDevice;

// create shader
const shader = createShaderFromCode(this._device, vertexShader, fragmentShader, 'infinite-grid', {
const shader = createShaderFromCode(this._device, vertexShader, fragmentShader, 'grid', {
vertex_position: SEMANTIC_POSITION
});
this._quadRender = new QuadRender(shader);
Expand Down Expand Up @@ -383,4 +383,4 @@ class InfiniteGrid extends Script {
}
}

export { InfiniteGrid };
export { Grid };

0 comments on commit 3493c6a

Please sign in to comment.