Skip to content

Commit

Permalink
three@0.150.0
Browse files Browse the repository at this point in the history
  • Loading branch information
yandeu committed Oct 10, 2023
1 parent 5564997 commit 66b348d
Show file tree
Hide file tree
Showing 11 changed files with 108 additions and 101 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ Enable3d now depends on the dependencies below.
```json
{
"@types/matter-js": "0.17.6",
"@types/three": "0.149.0",
"@types/three": "0.150.0",
"matter-js": "0.17.1",
"phaser": "^3.55.2",
"poly-decomp": "^0.3.0",
"three": "0.149.0",
"three": "0.150.0",
"three-csg-ts": "^3.1.10"
}
```
Expand Down
128 changes: 64 additions & 64 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@
"homepage": "https://github.com/enable3d/enable3d#readme",
"dependencies": {
"@types/matter-js": "0.17.6",
"@types/three": "0.149.0",
"@types/three": "0.150.0",
"matter-js": "0.17.1",
"phaser": "^3.55.2",
"poly-decomp": "^0.3.0",
"three": "0.149.0",
"three": "0.150.0",
"three-csg-ts": "^3.1.10"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/ammoOnNodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"fflate": "^0.6.3"
},
"peerDependencies": {
"@types/three": "0.149.0",
"three": "0.149.0"
"@types/three": "0.150.0",
"three": "0.150.0"
},
"funding": {
"url": "https://github.com/sponsors/yandeu"
Expand Down
4 changes: 2 additions & 2 deletions packages/ammoPhysics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"@yandeu/events": "0.0.5"
},
"peerDependencies": {
"@types/three": "0.149.0",
"three": "0.149.0"
"@types/three": "0.150.0",
"three": "0.150.0"
},
"funding": {
"url": "https://github.com/sponsors/yandeu"
Expand Down
4 changes: 2 additions & 2 deletions packages/phaserExtension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
"@yandeu/events": "0.0.5"
},
"peerDependencies": {
"@types/three": "0.149.0",
"@types/three": "0.150.0",
"phaser": "^3.55.2",
"three": "0.149.0"
"three": "0.150.0"
},
"funding": {
"url": "https://github.com/sponsors/yandeu"
Expand Down
4 changes: 2 additions & 2 deletions packages/threeGraphics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
},
"peerDependencies": {
"@types/matter-js": "0.17.6",
"@types/three": "0.149.0",
"@types/three": "0.150.0",
"matter-js": "0.17.1",
"poly-decomp": "^0.3.0",
"three": "0.149.0"
"three": "0.150.0"
},
"funding": {
"url": "https://github.com/sponsors/yandeu"
Expand Down
30 changes: 12 additions & 18 deletions packages/threeGraphics/src/plugins/lights.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|LGPL-3.0}
*/

import { Color, Mesh, MeshBasicMaterial, Object3D, Scene, SphereGeometry } from 'three'
import { Color, ColorRepresentation, Mesh, MeshBasicMaterial, Object3D, Scene, SphereGeometry } from 'three'
import { AmbientLight, DirectionalLight, HemisphereLight, PointLight, RectAreaLight, SpotLight } from 'three'
import { DirectionalLightHelper, SpotLightHelper } from 'three'

Expand All @@ -17,7 +17,7 @@ class PointLightHelper extends Object3D {
private scene: Scene,
public light: PointLight,
public size?: number | undefined,
public color?: string | number | Color | undefined
public color?: ColorRepresentation
) {
super()
this.geo = new SphereGeometry(size || 0.2, 16, 8)
Expand All @@ -43,28 +43,22 @@ export default class Lights {

public get helper() {
return {
directionalLightHelper: (
light: DirectionalLight,
size?: number | undefined,
color?: string | number | Color | undefined
) => {
directionalLightHelper: (light: DirectionalLight, size?: number | undefined, color?: ColorRepresentation) => {
const helper = new DirectionalLightHelper(light, size, color)
this.scene.add(helper)
return helper
},
spotLightHelper: (light: SpotLight, color?: string | number | Color | undefined) => {
spotLightHelper: (light: SpotLight, color?: ColorRepresentation) => {
const helper = new SpotLightHelper(light, color)
this.scene.add(helper)
return helper
},
pointLightHelper: (light: PointLight, size?: number | undefined, color?: string | number | Color | undefined) =>
pointLightHelper: (light: PointLight, size?: number | undefined, color?: ColorRepresentation) =>
new PointLightHelper(this.scene, light, size, color)
}
}

public directionalLight(
options: { color?: string | number | Color | undefined; intensity?: number | undefined } = {}
) {
public directionalLight(options: { color?: ColorRepresentation; intensity?: number | undefined } = {}) {
const { color = 0xffffff, intensity = 1 } = options
const light = new DirectionalLight(color, intensity)
light.castShadow = true
Expand All @@ -74,8 +68,8 @@ export default class Lights {

public hemisphereLight(
options: {
skyColor?: string | number | Color | undefined
groundColor?: string | number | Color | undefined
skyColor?: ColorRepresentation
groundColor?: ColorRepresentation
intensity?: number | undefined
} = {}
) {
Expand All @@ -85,7 +79,7 @@ export default class Lights {
return light
}

public ambientLight(options: { color?: string | number | Color | undefined; intensity?: number | undefined } = {}) {
public ambientLight(options: { color?: ColorRepresentation; intensity?: number | undefined } = {}) {
const { color = 0xffffff, intensity = 1 } = options
const light = new AmbientLight(color, intensity)
this.scene.add(light)
Expand All @@ -94,7 +88,7 @@ export default class Lights {

public pointLight(
options: {
color?: string | number | Color | undefined
color?: ColorRepresentation
intensity?: number | undefined
distance?: number | undefined
decay?: number | undefined
Expand All @@ -109,7 +103,7 @@ export default class Lights {

public spotLight(
options: {
color?: string | number | Color | undefined
color?: ColorRepresentation
intensity?: number | undefined
distance?: number | undefined
angle?: number | undefined
Expand All @@ -126,7 +120,7 @@ export default class Lights {

public rectAreaLight(
options: {
color?: string | number | Color | undefined
color?: ColorRepresentation
intensity?: number | undefined
width?: number | undefined
height?: number | undefined
Expand Down

0 comments on commit 66b348d

Please sign in to comment.