Skip to content

Commit

Permalink
Revert "Moved PROJECTION_*** constants from /scene to /core/shape (#4735
Browse files Browse the repository at this point in the history
)"

This reverts commit 8b93e82.
  • Loading branch information
Martin Valigursky committed Oct 12, 2022
1 parent 94a28c5 commit ae70f43
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 29 deletions.
13 changes: 0 additions & 13 deletions src/core/shape/constants.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/core/shape/frustum.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Vec3 } from '../math/vec3.js';
import { PROJECTION_PERSPECTIVE } from './constants.js';
import { PROJECTION_PERSPECTIVE } from '../../scene/constants.js';

/** @typedef {import('../math/mat4.js').Mat4} Mat4 */
/** @typedef {import('./bounding-sphere.js').BoundingSphere} BoundingSphere */
Expand Down
3 changes: 1 addition & 2 deletions src/deprecated/deprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { Vec2 } from '../core/math/vec2.js';
import { Vec3 } from '../core/math/vec3.js';
import { Vec4 } from '../core/math/vec4.js';

import { PROJECTION_ORTHOGRAPHIC, PROJECTION_PERSPECTIVE } from '../core/shape/constants.js';
import { BoundingBox } from '../core/shape/bounding-box.js';
import { BoundingSphere } from '../core/shape/bounding-sphere.js';
import { Frustum } from '../core/shape/frustum.js';
Expand Down Expand Up @@ -53,7 +52,7 @@ import { VertexBuffer } from '../platform/graphics/vertex-buffer.js';
import { VertexFormat } from '../platform/graphics/vertex-format.js';
import { VertexIterator } from '../platform/graphics/vertex-iterator.js';

import { LAYERID_IMMEDIATE, LINEBATCH_OVERLAY, LAYERID_WORLD } from '../scene/constants.js';
import { PROJECTION_ORTHOGRAPHIC, PROJECTION_PERSPECTIVE, LAYERID_IMMEDIATE, LINEBATCH_OVERLAY, LAYERID_WORLD } from '../scene/constants.js';
import { calculateTangents, createBox, createCapsule, createCone, createCylinder, createMesh, createPlane, createSphere, createTorus } from '../scene/procedural.js';
import { partitionSkin } from '../scene/skin-partition.js';
import { BasicMaterial } from '../scene/materials/basic-material.js';
Expand Down
4 changes: 1 addition & 3 deletions src/framework/lightmapper/lightmapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ import { Color } from '../../core/math/color.js';
import { Vec3 } from '../../core/math/vec3.js';

import { BoundingBox } from '../../core/shape/bounding-box.js';
import {
PROJECTION_ORTHOGRAPHIC, PROJECTION_PERSPECTIVE
} from '../../core/shape/constants.js';

import {
ADDRESS_CLAMP_TO_EDGE,
Expand Down Expand Up @@ -41,6 +38,7 @@ import {
BAKE_COLORDIR,
FOG_NONE,
LIGHTTYPE_DIRECTIONAL, LIGHTTYPE_OMNI, LIGHTTYPE_SPOT,
PROJECTION_ORTHOGRAPHIC, PROJECTION_PERSPECTIVE,
SHADER_FORWARDHDR,
SHADERDEF_DIRLM, SHADERDEF_LM, SHADERDEF_LMAMBIENT,
MASK_BAKE, MASK_AFFECT_LIGHTMAPPED,
Expand Down
4 changes: 1 addition & 3 deletions src/framework/parsers/glb-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ import { Vec3 } from '../../core/math/vec3.js';
import { Color } from '../../core/math/color.js';

import { BoundingBox } from '../../core/shape/bounding-box.js';
import {
PROJECTION_ORTHOGRAPHIC, PROJECTION_PERSPECTIVE
} from '../../core/shape/constants.js';

import {
typedArrayTypes, typedArrayTypesByteSize,
Expand All @@ -33,6 +30,7 @@ import { VertexFormat } from '../../platform/graphics/vertex-format.js';

import {
BLEND_NONE, BLEND_NORMAL, LIGHTFALLOFF_INVERSESQUARED,
PROJECTION_ORTHOGRAPHIC, PROJECTION_PERSPECTIVE,
ASPECT_MANUAL, ASPECT_AUTO, SPECOCC_AO
} from '../../scene/constants.js';

Expand Down
1 change: 0 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export { Vec3 } from './core/math/vec3.js';
export { Vec4 } from './core/math/vec4.js';

// CORE / SHAPE
export * from './core/shape/constants.js';
export { BoundingBox } from './core/shape/bounding-box.js';
export { BoundingSphere } from './core/shape/bounding-sphere.js';
export { Frustum } from './core/shape/frustum.js';
Expand Down
3 changes: 1 addition & 2 deletions src/scene/camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ import { Vec4 } from '../core/math/vec4.js';
import { math } from '../core/math/math.js';

import { Frustum } from '../core/shape/frustum.js';
import { PROJECTION_PERSPECTIVE } from '../core/shape/constants.js';

import {
ASPECT_AUTO,
ASPECT_AUTO, PROJECTION_PERSPECTIVE,
LAYERID_WORLD, LAYERID_DEPTH, LAYERID_SKYBOX, LAYERID_UI, LAYERID_IMMEDIATE
} from './constants.js';

Expand Down
14 changes: 14 additions & 0 deletions src/scene/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,20 @@ export const PARTICLEORIENTATION_WORLD = 1;
*/
export const PARTICLEORIENTATION_EMITTER = 2;

/**
* A perspective camera projection where the frustum shape is essentially pyramidal.
*
* @type {number}
*/
export const PROJECTION_PERSPECTIVE = 0;

/**
* An orthographic camera projection where the frustum shape is essentially a cuboid.
*
* @type {number}
*/
export const PROJECTION_ORTHOGRAPHIC = 1;

/**
* Render mesh instance as solid geometry.
*
Expand Down
3 changes: 1 addition & 2 deletions src/scene/renderer/forward-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { Vec3 } from '../../core/math/vec3.js';
import { Color } from '../../core/math/color.js';

import { BoundingSphere } from '../../core/shape/bounding-sphere.js';
import { PROJECTION_ORTHOGRAPHIC } from '../../core/shape/constants.js';

import {
CLEARFLAG_COLOR, CLEARFLAG_DEPTH, CLEARFLAG_STENCIL,
Expand Down Expand Up @@ -35,7 +34,7 @@ import {
MASK_AFFECT_LIGHTMAPPED, MASK_AFFECT_DYNAMIC, MASK_BAKE,
SHADOWUPDATE_NONE,
SORTKEY_DEPTH, SORTKEY_FORWARD,
VIEW_CENTER, SHADOWUPDATE_THISFRAME, LAYERID_DEPTH
VIEW_CENTER, SHADOWUPDATE_THISFRAME, LAYERID_DEPTH, PROJECTION_ORTHOGRAPHIC
} from '../constants.js';
import { Material } from '../materials/material.js';
import { LightTextureAtlas } from '../lighting/light-texture-atlas.js';
Expand Down
3 changes: 1 addition & 2 deletions src/scene/renderer/light-camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import { Quat } from '../../core/math/quat.js';
import { Vec3 } from '../../core/math/vec3.js';
import { Mat4 } from '../../core/math/mat4.js';

import { PROJECTION_ORTHOGRAPHIC, PROJECTION_PERSPECTIVE } from '../../core/shape/constants.js';
import { ASPECT_MANUAL, LIGHTTYPE_DIRECTIONAL, LIGHTTYPE_OMNI, LIGHTTYPE_SPOT } from '../constants.js';
import { ASPECT_MANUAL, LIGHTTYPE_DIRECTIONAL, LIGHTTYPE_OMNI, LIGHTTYPE_SPOT, PROJECTION_ORTHOGRAPHIC, PROJECTION_PERSPECTIVE } from '../constants.js';
import { Camera } from '../camera.js';
import { GraphNode } from '../graph-node.js';

Expand Down

0 comments on commit ae70f43

Please sign in to comment.