Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved /shape folder to /core/shape #4704

Merged
merged 1 commit into from
Oct 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/shape/bounding-box.js → src/core/shape/bounding-box.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Debug } from '../core/debug.js';
import { Vec3 } from '../core/math/vec3.js';
import { Debug } from '../debug.js';
import { Vec3 } from '../math/vec3.js';

/** @typedef {import('../core/math/mat4.js').Mat4} Mat4 */
/** @typedef {import('../math/mat4.js').Mat4} Mat4 */
/** @typedef {import('./bounding-sphere.js').BoundingSphere} BoundingSphere */
/** @typedef {import('./ray.js').Ray} Ray */

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Debug } from '../core/debug.js';
import { Vec3 } from '../core/math/vec3.js';
import { Debug } from '../debug.js';
import { Vec3 } from '../math/vec3.js';

/** @typedef {import('./ray.js').Ray} Ray */

Expand Down
6 changes: 3 additions & 3 deletions src/shape/frustum.js → src/core/shape/frustum.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Vec3 } from '../core/math/vec3.js';
import { PROJECTION_PERSPECTIVE } from '../scene/constants.js';
import { Vec3 } from '../math/vec3.js';
import { PROJECTION_PERSPECTIVE } from '../../scene/constants.js';

/** @typedef {import('../core/math/mat4.js').Mat4} Mat4 */
/** @typedef {import('../math/mat4.js').Mat4} Mat4 */
/** @typedef {import('./bounding-sphere.js').BoundingSphere} BoundingSphere */

const _frustumPoints = [new Vec3(), new Vec3(), new Vec3(), new Vec3(), new Vec3(), new Vec3(), new Vec3(), new Vec3()];
Expand Down
6 changes: 3 additions & 3 deletions src/shape/oriented-box.js → src/core/shape/oriented-box.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Debug } from '../core/debug.js';
import { Mat4 } from '../core/math/mat4.js';
import { Vec3 } from '../core/math/vec3.js';
import { Debug } from '../debug.js';
import { Mat4 } from '../math/mat4.js';
import { Vec3 } from '../math/vec3.js';

import { BoundingBox } from './bounding-box.js';
import { BoundingSphere } from './bounding-sphere.js';
Expand Down
2 changes: 1 addition & 1 deletion src/shape/plane.js → src/core/shape/plane.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Vec3 } from '../core/math/vec3.js';
import { Vec3 } from '../math/vec3.js';

/** @typedef {import('./ray.js').Ray} Ray */

Expand Down
4 changes: 2 additions & 2 deletions src/shape/ray.js → src/core/shape/ray.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Debug } from '../core/debug.js';
import { Vec3 } from '../core/math/vec3.js';
import { Debug } from '../debug.js';
import { Vec3 } from '../math/vec3.js';

/**
* An infinite ray.
Expand Down
8 changes: 4 additions & 4 deletions src/deprecated/deprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import { Vec2 } from '../core/math/vec2.js';
import { Vec3 } from '../core/math/vec3.js';
import { Vec4 } from '../core/math/vec4.js';

import { BoundingBox } from '../shape/bounding-box.js';
import { BoundingSphere } from '../shape/bounding-sphere.js';
import { Frustum } from '../shape/frustum.js';
import { Plane } from '../shape/plane.js';
import { BoundingBox } from '../core/shape/bounding-box.js';
import { BoundingSphere } from '../core/shape/bounding-sphere.js';
import { Frustum } from '../core/shape/frustum.js';
import { Plane } from '../core/shape/plane.js';

import {
ADDRESS_CLAMP_TO_EDGE, ADDRESS_MIRRORED_REPEAT, ADDRESS_REPEAT,
Expand Down
2 changes: 1 addition & 1 deletion src/framework/components/camera/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { Debug } from '../../../core/debug.js';
/** @typedef {import('../../../core/math/vec3.js').Vec3} Vec3 */
/** @typedef {import('../../../core/math/vec4.js').Vec4} Vec4 */
/** @typedef {import('../../../scene/layer.js').Layer} Layer */
/** @typedef {import('../../../shape/frustum.js').Frustum} Frustum */
/** @typedef {import('../../../core/shape/frustum.js').Frustum} Frustum */
/** @typedef {import('../../../xr/xr-manager.js').XrErrorCallback} XrErrorCallback */
/** @typedef {import('../../entity.js').Entity} Entity */
/** @typedef {import('./system.js').CameraComponentSystem} CameraComponentSystem */
Expand Down
4 changes: 2 additions & 2 deletions src/framework/components/element/element-drag-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { Vec2 } from '../../../core/math/vec2.js';
import { Vec3 } from '../../../core/math/vec3.js';

import { ElementComponent } from './component.js';
import { Ray } from '../../../shape/ray.js';
import { Plane } from '../../../shape/plane.js';
import { Ray } from '../../../core/shape/ray.js';
import { Plane } from '../../../core/shape/plane.js';

/** @typedef {import('../../../input/element-input').ElementTouchEvent} ElementTouchEvent */

Expand Down
2 changes: 1 addition & 1 deletion src/framework/components/element/text-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { math } from '../../../core/math/math.js';
import { Color } from '../../../core/math/color.js';
import { Vec2 } from '../../../core/math/vec2.js';

import { BoundingBox } from '../../../shape/bounding-box.js';
import { BoundingBox } from '../../../core/shape/bounding-box.js';

import { SEMANTIC_POSITION, SEMANTIC_TEXCOORD0, SEMANTIC_COLOR, SEMANTIC_ATTR8, SEMANTIC_ATTR9, TYPE_FLOAT32 } from '../../../graphics/constants.js';
import { VertexIterator } from '../../../graphics/vertex-iterator.js';
Expand Down
2 changes: 1 addition & 1 deletion src/framework/components/model/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { Component } from '../component.js';

/** @typedef {import('../../../scene/composition/layer-composition.js').LayerComposition} LayerComposition */
/** @typedef {import('../../../scene/materials/material.js').Material} Material */
/** @typedef {import('../../../shape/bounding-box.js').BoundingBox} BoundingBox */
/** @typedef {import('../../../core/shape/bounding-box.js').BoundingBox} BoundingBox */
/** @typedef {import('../../entity.js').Entity} Entity */
/** @typedef {import('./system.js').ModelComponentSystem} ModelComponentSystem */

Expand Down
2 changes: 1 addition & 1 deletion src/framework/components/model/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { extend } from '../../../core/core.js';

import { Vec3 } from '../../../core/math/vec3.js';

import { BoundingBox } from '../../../shape/bounding-box.js';
import { BoundingBox } from '../../../core/shape/bounding-box.js';

import { getDefaultMaterial } from '../../../scene/materials/default-material.js';

Expand Down
2 changes: 1 addition & 1 deletion src/framework/components/render/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { Component } from '../component.js';
import { EntityReference } from '../../utils/entity-reference.js';

/** @typedef {import('../../../scene/materials/material.js').Material} Material */
/** @typedef {import('../../../shape/bounding-box.js').BoundingBox} BoundingBox */
/** @typedef {import('../../../core/shape/bounding-box.js').BoundingBox} BoundingBox */
/** @typedef {import('../../entity.js').Entity} Entity */
/** @typedef {import('./system.js').RenderComponentSystem} RenderComponentSystem */

Expand Down
2 changes: 1 addition & 1 deletion src/framework/components/render/system.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Vec3 } from '../../../core/math/vec3.js';

import { BoundingBox } from '../../../shape/bounding-box.js';
import { BoundingBox } from '../../../core/shape/bounding-box.js';

import { getDefaultMaterial } from '../../../scene/materials/default-material.js';

Expand Down
12 changes: 6 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ export { Vec3 } from './core/math/vec3.js';
export { Vec4 } from './core/math/vec4.js';

// SHAPE
export { BoundingBox } from './shape/bounding-box.js';
export { BoundingSphere } from './shape/bounding-sphere.js';
export { Frustum } from './shape/frustum.js';
export { OrientedBox } from './shape/oriented-box.js';
export { Plane } from './shape/plane.js';
export { Ray } from './shape/ray.js';
export { BoundingBox } from './core/shape/bounding-box.js';
export { BoundingSphere } from './core/shape/bounding-sphere.js';
export { Frustum } from './core/shape/frustum.js';
export { OrientedBox } from './core/shape/oriented-box.js';
export { Plane } from './core/shape/plane.js';
export { Ray } from './core/shape/ray.js';

// GRAPHICS
export * from './graphics/constants.js';
Expand Down
2 changes: 1 addition & 1 deletion src/input/element-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { platform } from '../core/platform.js';
import { Vec3 } from '../core/math/vec3.js';
import { Vec4 } from '../core/math/vec4.js';

import { Ray } from '../shape/ray.js';
import { Ray } from '../core/shape/ray.js';

import { getApplication } from '../framework/globals.js';

Expand Down
2 changes: 1 addition & 1 deletion src/resources/parser/glb-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Vec2 } from '../../core/math/vec2.js';
import { Vec3 } from '../../core/math/vec3.js';
import { Color } from '../../core/math/color.js';

import { BoundingBox } from '../../shape/bounding-box.js';
import { BoundingBox } from '../../core/shape/bounding-box.js';

import {
typedArrayTypes, typedArrayTypesByteSize,
Expand Down
2 changes: 1 addition & 1 deletion src/resources/parser/json-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Debug } from '../../core/debug.js';
import { Mat4 } from '../../core/math/mat4.js';
import { Vec3 } from '../../core/math/vec3.js';

import { BoundingBox } from '../../shape/bounding-box.js';
import { BoundingBox } from '../../core/shape/bounding-box.js';

import {
INDEXFORMAT_UINT16, INDEXFORMAT_UINT32,
Expand Down
2 changes: 1 addition & 1 deletion src/resources/parser/material/json-standard-material.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Vec3 } from '../../../core/math/vec3.js';

import { Texture } from '../../../graphics/texture.js';

import { BoundingBox } from '../../../shape/bounding-box.js';
import { BoundingBox } from '../../../core/shape/bounding-box.js';

import { SPECULAR_BLINN, SPECULAR_PHONG } from '../../../scene/constants.js';

Expand Down
2 changes: 1 addition & 1 deletion src/scene/batching/batch-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Debug } from '../../core/debug.js';
import { Vec3 } from '../../core/math/vec3.js';
import { Mat3 } from '../../core/math/mat3.js';

import { BoundingBox } from '../../shape/bounding-box.js';
import { BoundingBox } from '../../core/shape/bounding-box.js';

import {
PRIMITIVE_TRIANGLES, PRIMITIVE_TRIFAN,
Expand Down
2 changes: 1 addition & 1 deletion src/scene/batching/batch.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BoundingBox } from '../../shape/bounding-box.js';
import { BoundingBox } from '../../core/shape/bounding-box.js';

/** @typedef {import('../mesh-instance.js').MeshInstance} MeshInstance */

Expand Down
2 changes: 1 addition & 1 deletion src/scene/camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Vec3 } from '../core/math/vec3.js';
import { Vec4 } from '../core/math/vec4.js';
import { math } from '../core/math/math.js';

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

import {
ASPECT_AUTO, PROJECTION_PERSPECTIVE,
Expand Down
2 changes: 1 addition & 1 deletion src/scene/lighting/world-clusters.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Vec3 } from '../../core/math/vec3.js';
import { math } from '../../core/math/math.js';
import { BoundingBox } from '../../shape/bounding-box.js';
import { BoundingBox } from '../../core/shape/bounding-box.js';
import { PIXELFORMAT_R8_G8_B8_A8 } from '../../graphics/constants.js';
import { LIGHTTYPE_DIRECTIONAL, MASK_AFFECT_DYNAMIC, MASK_AFFECT_LIGHTMAPPED } from '../constants.js';
import { LightsBuffer } from './lights-buffer.js';
Expand Down
4 changes: 2 additions & 2 deletions src/scene/lightmapper/bake-light.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { BoundingBox } from '../../shape/bounding-box.js';
import { BoundingSphere } from '../../shape/bounding-sphere.js';
import { BoundingBox } from '../../core/shape/bounding-box.js';
import { BoundingSphere } from '../../core/shape/bounding-sphere.js';
import { LIGHTTYPE_DIRECTIONAL } from '../constants.js';

const tempSphere = new BoundingSphere();
Expand Down
2 changes: 1 addition & 1 deletion src/scene/lightmapper/lightmapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { math } from '../../core/math/math.js';
import { Color } from '../../core/math/color.js';
import { Vec3 } from '../../core/math/vec3.js';

import { BoundingBox } from '../../shape/bounding-box.js';
import { BoundingBox } from '../../core/shape/bounding-box.js';

import {
ADDRESS_CLAMP_TO_EDGE,
Expand Down
2 changes: 1 addition & 1 deletion src/scene/materials/standard-material.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { getProgramLibrary } from '../../graphics/get-program-library.js';
import { standardMaterialCubemapParameters, standardMaterialTextureParameters } from './standard-material-parameters.js';

/** @typedef {import('../../graphics/texture.js').Texture} Texture */
/** @typedef {import('../../shape/bounding-box.js').BoundingBox} BoundingBox */
/** @typedef {import('../../core/shape/bounding-box.js').BoundingBox} BoundingBox */

// properties that get created on a standard material
const _props = {};
Expand Down
4 changes: 2 additions & 2 deletions src/scene/mesh-instance.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Debug } from '../core/debug.js';

import { BoundingBox } from '../shape/bounding-box.js';
import { BoundingSphere } from '../shape/bounding-sphere.js';
import { BoundingBox } from '../core/shape/bounding-box.js';
import { BoundingSphere } from '../core/shape/bounding-sphere.js';

import { BindGroup } from '../graphics/bind-group.js';
import { UniformBuffer } from '../graphics/uniform-buffer.js';
Expand Down
2 changes: 1 addition & 1 deletion src/scene/mesh.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Debug } from '../core/debug.js';
import { RefCountedObject } from '../core/ref-counted-object.js';
import { Vec3 } from '../core/math/vec3.js';

import { BoundingBox } from '../shape/bounding-box.js';
import { BoundingBox } from '../core/shape/bounding-box.js';

import {
BUFFER_DYNAMIC, BUFFER_STATIC,
Expand Down
2 changes: 1 addition & 1 deletion src/scene/morph-target.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Debug } from '../core/debug.js';
import { BoundingBox } from '../shape/bounding-box.js';
import { BoundingBox } from '../core/shape/bounding-box.js';

import { BUFFER_STATIC, SEMANTIC_ATTR0, TYPE_FLOAT32 } from '../graphics/constants.js';
import { VertexBuffer } from '../graphics/vertex-buffer.js';
Expand Down
2 changes: 1 addition & 1 deletion src/scene/morph.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Debug } from '../core/debug.js';
import { RefCountedObject } from '../core/ref-counted-object.js';
import { Vec3 } from '../core/math/vec3.js';
import { FloatPacking } from '../core/math/float-packing.js';
import { BoundingBox } from '../shape/bounding-box.js';
import { BoundingBox } from '../core/shape/bounding-box.js';
import { Texture } from '../graphics/texture.js';
import { VertexBuffer } from '../graphics/vertex-buffer.js';
import { VertexFormat } from '../graphics/vertex-format.js';
Expand Down
2 changes: 1 addition & 1 deletion src/scene/particle-system/particle-emitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Mat4 } from '../../core/math/mat4.js';
import { Quat } from '../../core/math/quat.js';
import { Vec3 } from '../../core/math/vec3.js';

import { BoundingBox } from '../../shape/bounding-box.js';
import { BoundingBox } from '../../core/shape/bounding-box.js';

import { Curve } from '../../core/math/curve.js';
import { CurveSet } from '../../core/math/curve-set.js';
Expand Down
2 changes: 1 addition & 1 deletion src/scene/renderer/forward-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Mat4 } from '../../core/math/mat4.js';
import { Vec3 } from '../../core/math/vec3.js';
import { Color } from '../../core/math/color.js';

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

import {
CLEARFLAG_COLOR, CLEARFLAG_DEPTH, CLEARFLAG_STENCIL,
Expand Down
4 changes: 2 additions & 2 deletions src/scene/renderer/shadow-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Vec4 } from '../../core/math/vec4.js';
import { Mat4 } from '../../core/math/mat4.js';
import { Color } from '../../core/math/color.js';

import { BoundingBox } from '../../shape/bounding-box.js';
import { BoundingBox } from '../../core/shape/bounding-box.js';

import {
BLUR_GAUSSIAN,
Expand All @@ -25,7 +25,7 @@ import { createShaderFromCode } from '../../graphics/program-lib/utils.js';
import { DebugGraphics } from '../../graphics/debug-graphics.js';
import { ShadowMap } from './shadow-map.js';
import { ShadowMapCache } from './shadow-map-cache.js';
import { Frustum } from '../../shape/frustum.js';
import { Frustum } from '../../core/shape/frustum.js';
import { ShaderPass } from '../shader-pass.js';

/** @typedef {import('../mesh-instance.js').MeshInstance} MeshInstance */
Expand Down
4 changes: 2 additions & 2 deletions src/scene/renderer/static-meshes.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { now } from '../../core/time.js';
import { Vec3 } from '../../core/math/vec3.js';
import { Mat4 } from '../../core/math/mat4.js';

import { BoundingBox } from '../../shape/bounding-box.js';
import { BoundingSphere } from '../../shape/bounding-sphere.js';
import { BoundingBox } from '../../core/shape/bounding-box.js';
import { BoundingSphere } from '../../core/shape/bounding-sphere.js';

import { PRIMITIVE_TRIANGLES, SEMANTIC_POSITION } from '../../graphics/constants.js';
import { IndexBuffer } from '../../graphics/index-buffer.js';
Expand Down
2 changes: 1 addition & 1 deletion src/xr/xr-hit-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { XRSPACE_VIEWER, XRTYPE_AR } from './constants.js';
import { XrHitTestSource } from './xr-hit-test-source.js';

/** @typedef {import('./xr-manager.js').XrManager} XrManager */
/** @typedef {import('../shape/ray.js').Ray} Ray */
/** @typedef {import('../core/shape/ray.js').Ray} Ray */

/**
* Callback used by {@link XrHitTest#start} and {@link XrHitTest#startForInputSource}.
Expand Down
2 changes: 1 addition & 1 deletion src/xr/xr-input-source.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Mat4 } from '../core/math/mat4.js';
import { Quat } from '../core/math/quat.js';
import { Vec3 } from '../core/math/vec3.js';

import { Ray } from '../shape/ray.js';
import { Ray } from '../core/shape/ray.js';

import { XrHand } from './xr-hand.js';

Expand Down