Skip to content

Commit c1b1123

Browse files
authored
Merge pull request #64 from demike/feat/three-upgrade2
feat/three upgrade2
2 parents d95ce98 + 7a6f3cb commit c1b1123

File tree

163 files changed

+1034
-1161
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+1034
-1161
lines changed

package-lock.json

Lines changed: 43 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ngx-three",
3-
"version": "0.35.0",
3+
"version": "0.36.0",
44
"scripts": {
55
"ng": "ng",
66
"start": "ng serve",
@@ -35,7 +35,7 @@
3535
"normalize.css": "^8.0.1",
3636
"rxjs": "~7.8.1",
3737
"simplex-noise": "^4.0.1",
38-
"three": "~0.165.0",
38+
"three": "~0.171.0",
3939
"tslib": "^2.6.2",
4040
"zone.js": "~0.14.10"
4141
},
@@ -50,7 +50,7 @@
5050
"@angular/compiler-cli": "^18.2.11",
5151
"@types/jasmine": "^4.3.5",
5252
"@types/node": "^20.5.3",
53-
"@types/three": "^0.165.0",
53+
"@types/three": "^0.171.0",
5454
"@typescript-eslint/eslint-plugin": "^7.2.0",
5555
"@typescript-eslint/parser": "^7.2.0",
5656
"acorn": ">=8",
@@ -73,4 +73,4 @@
7373
"typescript": "^5.4.5",
7474
"utility-types": "^3.10.0"
7575
}
76-
}
76+
}

projects/ngx-three-demo/src/app/animation-example/robot.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { ASSET_PATH } from '../assets';
77
@Component({
88
selector: 'app-robot',
99
templateUrl: './robot.component.html',
10-
changeDetection: ChangeDetectionStrategy.OnPush
10+
changeDetection: ChangeDetectionStrategy.OnPush,
1111
})
1212
export class RobotComponent {
1313
public readonly assetPath = ASSET_PATH + 'RobotExpressive.glb';

projects/ngx-three/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"peerDependencies": {
2121
"@angular/common": "^18.2.11",
2222
"@angular/core": "^18.2.11",
23-
"three": "~0.165.0"
23+
"three": "~0.171.0"
2424
},
2525
"dependencies": {
2626
"tslib": "^2.6.2"

projects/ngx-three/src/lib/ThControlBase.ts

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { ChangeDetectionStrategy, Component, inject, OnDestroy } from '@angular/core';
1+
import { ChangeDetectionStrategy, Component, inject, Input, OnDestroy } from '@angular/core';
22
import { Subscription } from 'rxjs';
3-
import { EventDispatcher } from 'three';
3+
import { Controls, EventDispatcher, Object3D } from 'three';
44
import { ThObject3D } from './generated/ThObject3D';
55
import { ThAnimationLoopService } from './renderer/th-animation-loop.service';
66
import { ThCanvas } from './ThCanvas';
@@ -11,11 +11,50 @@ import { ThWrapperBase } from './ThWrapperBase';
1111
changeDetection: ChangeDetectionStrategy.OnPush,
1212
})
1313
// eslint-disable-next-line @angular-eslint/component-class-suffix
14-
export class ThControlBase<T, ARGS> extends ThWrapperBase<T, ARGS> implements OnDestroy {
14+
export class ThControlBase<
15+
TEventMap extends object = object,
16+
T extends Controls<TEventMap> = Controls<TEventMap>,
17+
TARGS = [],
18+
>
19+
extends ThWrapperBase<T, TARGS>
20+
implements OnDestroy
21+
{
1522
protected origDispatchEventMethod?: EventDispatcher['dispatchEvent'];
1623
protected beforeRenderSubscription?: Subscription;
1724
protected renderLoop = inject(ThAnimationLoopService);
1825

26+
@Input()
27+
public set domElement(value: HTMLElement) {
28+
if (this._objRef) {
29+
this._objRef.domElement = value;
30+
}
31+
}
32+
33+
public get domElement(): HTMLElement | null | undefined {
34+
return this._objRef?.domElement;
35+
}
36+
37+
@Input()
38+
public set object(value: Object3D) {
39+
if (this._objRef) {
40+
this._objRef.object = value;
41+
}
42+
}
43+
44+
public get object(): Object3D | undefined {
45+
return this._objRef?.object;
46+
}
47+
@Input()
48+
public set enabled(value: boolean) {
49+
if (this._objRef) {
50+
this._objRef.enabled = value;
51+
}
52+
}
53+
54+
public get enabled(): boolean | undefined {
55+
return this._objRef?.enabled;
56+
}
57+
1958
constructor(
2059
protected _camera: ThObject3D<any>,
2160
protected canvas?: ThCanvas,

projects/ngx-three/src/lib/generated/ThAfterimagePass.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* eslint-disable @typescript-eslint/ban-types */
2+
/* eslint-disable @typescript-eslint/ban-types */
23
/* eslint-disable @typescript-eslint/naming-convention */
34
/* eslint-disable no-underscore-dangle */
45
/* eslint-disable @angular-eslint/component-selector, @angular-eslint/component-class-suffix */

projects/ngx-three/src/lib/generated/ThAmbientLight.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/ban-types */
12
/* eslint-disable @typescript-eslint/naming-convention */
23
/* eslint-disable no-underscore-dangle */
34
/* eslint-disable @angular-eslint/component-selector, @angular-eslint/component-class-suffix */
@@ -7,7 +8,8 @@ import {
78
Type,
89
forwardRef,
910
} from '@angular/core';
10-
import { AmbientLight, ColorRepresentation } from 'three';
11+
import { AmbientLight } from 'three';
12+
import { ColorRepresentation } from 'three/src/math/Color.js';
1113
import { ThLight } from './ThLight';
1214
import { ThObject3D } from './ThObject3D';
1315

projects/ngx-three/src/lib/generated/ThAmbientLightProbe.ts

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)