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 THREE.Geometry out of core. #21031

Merged
merged 21 commits into from
Jan 13, 2021
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
File renamed without changes.
426 changes: 411 additions & 15 deletions src/core/Geometry.js → examples/jsm/deprecated/Geometry.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion examples/jsm/modifiers/SimplifyModifier.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
BufferGeometry,
Float32BufferAttribute,
Geometry,
Vector3
} from '../../../build/three.module.js';
import { BufferGeometryUtils } from '../utils/BufferGeometryUtils.js';
Expand Down
1 change: 0 additions & 1 deletion examples/jsm/modifiers/TessellateModifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
BufferGeometry,
Color,
Float32BufferAttribute,
Geometry,
Vector2,
Vector3
} from '../../../build/three.module.js';
Expand Down
1 change: 0 additions & 1 deletion examples/jsm/renderers/Projector.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
DoubleSide,
FrontSide,
Frustum,
Geometry,
Light,
Line,
LineSegments,
Expand Down
37 changes: 1 addition & 36 deletions src/Three.Legacy.d.ts
Original file line number Diff line number Diff line change
@@ -1,36 +1 @@
import { Geometry } from './core/Geometry';
import { Material } from './materials/Material';
import { Object3D } from './core/Object3D';
import { Scene } from './scenes/Scene';

export namespace SceneUtils {
export function createMultiMaterialObject(
geometry: Geometry,
materials: Material[]
): Object3D;
export function detach( child: Object3D, parent: Object3D, scene: Scene ): void;
export function attach( child: Object3D, scene: Scene, parent: Object3D ): void;
}

/**
* @deprecated Use an Array instead.
*/
export class MultiMaterial extends Material {

constructor( materials?: Material[] );

readonly isMultiMaterial: true;

materials: Material[];

toJSON( meta: any ): any;

}

/**
* @deprecated Material.vertexColors is now a boolean.
*/
export enum Colors {}
export const NoColors: Colors;
export const FaceColors: Colors;
export const VertexColors: Colors;
export {};
41 changes: 0 additions & 41 deletions src/Three.Legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import { BufferGeometry } from './core/BufferGeometry.js';
import { InstancedBufferGeometry } from './core/InstancedBufferGeometry.js';
import { InterleavedBuffer } from './core/InterleavedBuffer.js';
import { Face3 } from './core/Face3.js';
import { Geometry } from './core/Geometry.js';
import { Object3D } from './core/Object3D.js';
import { Uniform } from './core/Uniform.js';
import { Raycaster } from './core/Raycaster.js';
Expand Down Expand Up @@ -283,23 +282,6 @@ Object.assign( CurvePath.prototype, {
const pts = this.getSpacedPoints( divisions );
return this.createGeometry( pts );

},

createGeometry: function ( points ) {

console.warn( 'THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.' );

const geometry = new Geometry();

for ( let i = 0, l = points.length; i < l; i ++ ) {

const point = points[ i ];
geometry.vertices.push( new Vector3( point.x, point.y, point.z || 0 ) );

}

return geometry;

}

} );
Expand Down Expand Up @@ -947,29 +929,6 @@ Object.assign( Vector4.prototype, {

//

Object.assign( Geometry.prototype, {

computeTangents: function () {

console.error( 'THREE.Geometry: .computeTangents() has been removed.' );

},
computeLineDistances: function () {

console.error( 'THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.' );

},
applyMatrix: function ( matrix ) {

console.warn( 'THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4().' );
return this.applyMatrix4( matrix );

}

} );

//

Object.assign( Object3D.prototype, {

getChildByName: function ( name ) {
Expand Down
2 changes: 0 additions & 2 deletions src/Three.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ export * from './animation/AnimationAction';
export * from './core/Uniform';
export * from './core/InstancedBufferGeometry';
export * from './core/BufferGeometry';
export * from './core/Geometry';
export * from './core/InterleavedBufferAttribute';
export * from './core/InstancedInterleavedBuffer';
export * from './core/InterleavedBuffer';
Expand All @@ -104,7 +103,6 @@ export * from './core/Object3D';
export * from './core/Raycaster';
export * from './core/Layers';
export * from './core/EventDispatcher';
export * from './core/DirectGeometry';
export * from './core/Clock';
export * from './math/interpolants/QuaternionLinearInterpolant';
export * from './math/interpolants/LinearInterpolant';
Expand Down
1 change: 0 additions & 1 deletion src/Three.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ export { AnimationClip } from './animation/AnimationClip.js';
export { Uniform } from './core/Uniform.js';
export { InstancedBufferGeometry } from './core/InstancedBufferGeometry.js';
export { BufferGeometry } from './core/BufferGeometry.js';
export { Geometry } from './core/Geometry.js';
export { InterleavedBufferAttribute } from './core/InterleavedBufferAttribute.js';
export { InstancedInterleavedBuffer } from './core/InstancedInterleavedBuffer.js';
export { InterleavedBuffer } from './core/InterleavedBuffer.js';
Expand Down
7 changes: 6 additions & 1 deletion src/animation/AnimationClip.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import { KeyframeTrack } from './KeyframeTrack';
import { Vector3 } from './../math/Vector3';
import { Bone } from './../objects/Bone';
import { MorphTarget } from '../core/Geometry';
import { AnimationBlendMode } from '../constants';

interface MorphTarget {
name: string;
vertices: Vector3[];
}

export class AnimationClip {

constructor( name?: string, duration?: number, tracks?: KeyframeTrack[], blendMode?: AnimationBlendMode );
Expand Down
9 changes: 0 additions & 9 deletions src/core/BufferGeometry.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ import { Sphere } from './../math/Sphere';
import { Matrix4 } from './../math/Matrix4';
import { Vector2 } from './../math/Vector2';
import { Vector3 } from './../math/Vector3';
import { Object3D } from './Object3D';
import { Geometry } from './Geometry';
import { DirectGeometry } from './DirectGeometry';
import { EventDispatcher } from './EventDispatcher';
import { InterleavedBufferAttribute } from './InterleavedBufferAttribute';

Expand Down Expand Up @@ -119,13 +116,7 @@ export class BufferGeometry extends EventDispatcher {

center(): BufferGeometry;

setFromObject( object: Object3D ): BufferGeometry;
setFromPoints( points: Vector3[] | Vector2[] ): BufferGeometry;
updateFromObject( object: Object3D ): void;

fromGeometry( geometry: Geometry, settings?: any ): BufferGeometry;

fromDirectGeometry( geometry: DirectGeometry ): BufferGeometry;

/**
* Computes bounding box of the geometry, updating Geometry.boundingBox attribute.
Expand Down
Loading