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

feat: upgrade three to v0.165 #58

Merged
merged 1 commit into from
Jun 25, 2024
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
859 changes: 395 additions & 464 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"normalize.css": "^8.0.1",
"rxjs": "~7.8.1",
"simplex-noise": "^4.0.1",
"three": "~0.164.1",
"three": "~0.165.0",
"tslib": "^2.6.2",
"zone.js": "~0.14.5"
},
Expand All @@ -50,7 +50,7 @@
"@angular/compiler-cli": "^17.3.7",
"@types/jasmine": "^4.3.5",
"@types/node": "^20.5.3",
"@types/three": "^0.164.0",
"@types/three": "^0.165.0",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"acorn": ">=8",
Expand All @@ -73,4 +73,4 @@
"typescript": "^5.4.5",
"utility-types": "^3.10.0"
}
}
}
2 changes: 1 addition & 1 deletion projects/ngx-three/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"peerDependencies": {
"@angular/common": "^17.3.7",
"@angular/core": "^17.3.7",
"three": "~0.164.1"
"three": "~0.165.0"
},
"dependencies": {
"tslib": "^2.6.2"
Expand Down
41 changes: 3 additions & 38 deletions projects/ngx-three/src/lib/generated/ThBufferGeometry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
Box3,
BufferAttribute,
BufferGeometry,
GeometryGroup,
InterleavedBufferAttribute,
NormalBufferAttributes,
NormalOrGLBufferAttributes,
Expand Down Expand Up @@ -124,49 +125,13 @@ export class ThBufferGeometry<
return this._objRef?.morphTargetsRelative;
}
@Input()
public set groups(
value: Array<{
/**
* Specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index.
* @remarks Expects a `Integer`
*/
start: number;
/**
* Specifies how many vertices (or indices) are included.
* @remarks Expects a `Integer`
*/
count: number;
/**
* Specifies the material array index to use.
* @remarks Expects a `Integer`
*/
materialIndex?: number | undefined;
}>,
) {
public set groups(value: GeometryGroup[]) {
if (this._objRef) {
this._objRef.groups = value;
}
}

public get groups():
| Array<{
/**
* Specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index.
* @remarks Expects a `Integer`
*/
start: number;
/**
* Specifies how many vertices (or indices) are included.
* @remarks Expects a `Integer`
*/
count: number;
/**
* Specifies the material array index to use.
* @remarks Expects a `Integer`
*/
materialIndex?: number | undefined;
}>
| undefined {
public get groups(): GeometryGroup[] | undefined {
return this._objRef?.groups;
}
@Input()
Expand Down
10 changes: 10 additions & 0 deletions projects/ngx-three/src/lib/generated/ThCompressedArrayTexture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,14 @@ export class ThCompressedArrayTexture<
public get wrapR(): Wrapping | undefined {
return this._objRef?.wrapR;
}
@Input()
public set layerUpdates(value: Set<number>) {
if (this._objRef) {
this._objRef.layerUpdates = value;
}
}

public get layerUpdates(): Set<number> | undefined {
return this._objRef?.layerUpdates;
}
}
47 changes: 21 additions & 26 deletions projects/ngx-three/src/lib/generated/ThDataArrayTexture.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
/* eslint-disable @typescript-eslint/naming-convention */
/* eslint-disable no-underscore-dangle */
/* eslint-disable @angular-eslint/component-selector, @angular-eslint/component-class-suffix */
import {
ChangeDetectionStrategy,
Component,
Input,
Type,
forwardRef,
} from '@angular/core';
import {
DataArrayTexture,
MagnificationTextureFilter,
MinificationTextureFilter,
} from 'three';
import { ChangeDetectionStrategy, Component, Input, Type, forwardRef } from '@angular/core';
import { DataArrayTexture, MagnificationTextureFilter, MinificationTextureFilter } from 'three';
import { ThTextureBase } from '../ThTextureBase';
import { ThTexture } from './ThTexture';

Expand All @@ -29,12 +19,7 @@ import { ThTexture } from './ThTexture';
})
export class ThDataArrayTexture<
T extends DataArrayTexture = DataArrayTexture,
TARGS = [
data?: BufferSource | null,
width?: number,
height?: number,
depth?: number,
],
TARGS = [data?: BufferSource | null, width?: number, height?: number, depth?: number],
> extends ThTexture<T, TARGS> {
public getType(): Type<DataArrayTexture> {
return DataArrayTexture;
Expand Down Expand Up @@ -74,24 +59,24 @@ export class ThDataArrayTexture<
return this._objRef?.wrapR;
}
@Input()
public set flipY(value: boolean) {
public set generateMipmaps(value: boolean) {
if (this._objRef) {
this._objRef.flipY = value;
this._objRef.generateMipmaps = value;
}
}

public get flipY(): boolean | undefined {
return this._objRef?.flipY;
public get generateMipmaps(): boolean | undefined {
return this._objRef?.generateMipmaps;
}
@Input()
public set generateMipmaps(value: boolean) {
public set flipY(value: boolean) {
if (this._objRef) {
this._objRef.generateMipmaps = value;
this._objRef.flipY = value;
}
}

public get generateMipmaps(): boolean | undefined {
return this._objRef?.generateMipmaps;
public get flipY(): boolean | undefined {
return this._objRef?.flipY;
}
@Input()
public set unpackAlignment(value: number) {
Expand All @@ -103,4 +88,14 @@ export class ThDataArrayTexture<
public get unpackAlignment(): number | undefined {
return this._objRef?.unpackAlignment;
}
@Input()
public set layerUpdates(value: Set<number>) {
if (this._objRef) {
this._objRef.layerUpdates = value;
}
}

public get layerUpdates(): Set<number> | undefined {
return this._objRef?.layerUpdates;
}
}
56 changes: 8 additions & 48 deletions projects/ngx-three/src/lib/generated/ThMeshPhysicalMaterial.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
/* eslint-disable @typescript-eslint/naming-convention */
/* eslint-disable no-underscore-dangle */
/* eslint-disable @angular-eslint/component-selector, @angular-eslint/component-class-suffix */
import {
ChangeDetectionStrategy,
Component,
Input,
Type,
forwardRef,
} from '@angular/core';
import { ChangeDetectionStrategy, Component, Input, Type, forwardRef } from '@angular/core';
import {
Color,
ColorRepresentation,
Expand Down Expand Up @@ -115,10 +109,7 @@ export class ThMeshPhysicalMaterial<
@Input()
public set clearcoatNormalScale(value: Vector2 | [x: number, y: number]) {
if (this._objRef) {
this._objRef.clearcoatNormalScale = applyValue<Vector2>(
this._objRef.clearcoatNormalScale,
value,
);
this._objRef.clearcoatNormalScale = applyValue<Vector2>(this._objRef.clearcoatNormalScale, value);
}
}
public get clearcoatNormalScale(): Vector2 | undefined {
Expand Down Expand Up @@ -185,20 +176,9 @@ export class ThMeshPhysicalMaterial<
return this._objRef?.iridescenceThicknessMap;
}
@Input()
public set sheenColor(
value:
| Color
| [
...args:
| [color: ColorRepresentation]
| [r: number, g: number, b: number],
],
) {
public set sheenColor(value: Color | [...args: [color: ColorRepresentation] | [r: number, g: number, b: number]]) {
if (this._objRef) {
this._objRef.sheenColor = applyValue<Color>(
this._objRef.sheenColor,
value,
);
this._objRef.sheenColor = applyValue<Color>(this._objRef.sheenColor, value);
}
}
public get sheenColor(): Color | undefined {
Expand Down Expand Up @@ -286,19 +266,10 @@ export class ThMeshPhysicalMaterial<
}
@Input()
public set attenuationColor(
value:
| Color
| [
...args:
| [color: ColorRepresentation]
| [r: number, g: number, b: number],
],
value: Color | [...args: [color: ColorRepresentation] | [r: number, g: number, b: number]],
) {
if (this._objRef) {
this._objRef.attenuationColor = applyValue<Color>(
this._objRef.attenuationColor,
value,
);
this._objRef.attenuationColor = applyValue<Color>(this._objRef.attenuationColor, value);
}
}
public get attenuationColor(): Color | undefined {
Expand All @@ -325,20 +296,9 @@ export class ThMeshPhysicalMaterial<
return this._objRef?.specularIntensityMap;
}
@Input()
public set specularColor(
value:
| Color
| [
...args:
| [color: ColorRepresentation]
| [r: number, g: number, b: number],
],
) {
public set specularColor(value: Color | [...args: [color: ColorRepresentation] | [r: number, g: number, b: number]]) {
if (this._objRef) {
this._objRef.specularColor = applyValue<Color>(
this._objRef.specularColor,
value,
);
this._objRef.specularColor = applyValue<Color>(this._objRef.specularColor, value);
}
}
public get specularColor(): Color | undefined {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ import {
forwardRef,
} from '@angular/core';
import { Camera, MOUSE, Object3D } from 'three';
import { TransformControls } from 'three/examples/jsm/controls/TransformControls.js';
import {
TransformControls,
TransformControlsMode,
} from 'three/examples/jsm/controls/TransformControls.js';
import { ThControlBase } from '../ThControlBase';

@Component({
Expand Down Expand Up @@ -86,13 +89,13 @@ export class ThTransformControlsGen<
return this._objRef?.axis;
}
@Input()
public set mode(value: 'translate' | 'rotate' | 'scale') {
public set mode(value: TransformControlsMode) {
if (this._objRef) {
this._objRef.mode = value;
}
}

public get mode(): ('translate' | 'rotate' | 'scale') | undefined {
public get mode(): TransformControlsMode | undefined {
return this._objRef?.mode;
}
@Input()
Expand Down