Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
fix tsc errors
Browse files Browse the repository at this point in the history
  • Loading branch information
HexaField committed Oct 26, 2023
1 parent 7f18c2f commit 742378b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Ethereal Engine. All Rights Reserved.
*/

import { sha3_256 } from 'js-sha3'
import { Event, LoaderUtils, MathUtils, Mesh, Object3D } from 'three'
import { LoaderUtils, MathUtils, Mesh, Object3D } from 'three'
import matches, { Validator } from 'ts-matches'

import { defineAction, dispatchAction } from '@etherealengine/hyperflux'
Expand Down Expand Up @@ -72,7 +72,7 @@ export default class BufferHandlerExtension extends ExporterExtension implements
this.comparisonCanvas = document.createElement('canvas')
}

beforeParse(input: Object3D<Event> | Object3D<Event>[]) {
beforeParse(input: Object3D | Object3D[]) {
const writer = this.writer
if (writer.options.embedImages) return
this.projectName = getProjectName(writer.options.path!)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ All portions of the code written by the Ethereal Engine team are Copyright © 20
Ethereal Engine. All Rights Reserved.
*/

import { CompressedTexture, Event, Material, Mesh, Object3D, Texture } from 'three'
import { CompressedTexture, Material, Mesh, Object3D, Texture } from 'three'

import iterateObject3D from '../../../../scene/util/iterateObject3D'
import createReadableTexture from '../../../functions/createReadableTexture'
Expand All @@ -44,7 +44,7 @@ export default class ImageProcessingExtension extends ExporterExtension implemen
this.originalImages = []
}

beforeParse(input: Object3D<Event> | Object3D<Event>[]) {
beforeParse(input: Object3D | Object3D[]) {
const writer = this.writer
const inputs = Array.isArray(input) ? input : [input]
inputs.forEach((input) =>
Expand Down Expand Up @@ -72,7 +72,7 @@ export default class ImageProcessingExtension extends ExporterExtension implemen
)
}

afterParse(input: Object3D<Event> | Object3D<Event>[]) {
afterParse(input: Object3D | Object3D[]) {
this.originalImages.forEach(({ material, field, texture }) => {
URL.revokeObjectURL(material[field].image.src)
material[field] = texture
Expand Down
2 changes: 0 additions & 2 deletions packages/engine/src/renderer/WebGLRendererSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@ export class EngineRenderer {

const renderer = this.supportWebGL2 ? new WebGLRenderer(options) : new WebGL1Renderer(options)
this.renderer = renderer
// @ts-ignore
this.renderer.useLegacyLights = false //true
this.renderer.outputColorSpace = SRGBColorSpace

// DISABLE THIS IF YOU ARE SEEING SHADER MISBEHAVING - UNCHECK THIS WHEN TESTING UPDATING THREEJS
Expand Down
9 changes: 5 additions & 4 deletions packages/engine/src/scene/components/VolumetricComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export function VolumetricReactor() {

volumetric.player.set(
new VolumetricPlayer({
renderer: EngineRenderer.instance.renderer,
renderer: EngineRenderer.instance.renderer as any,
onTrackEnd: () => {
volumetric.hasTrackStopped.set(true)
volumetric.track.set(
Expand All @@ -170,7 +170,7 @@ export function VolumetricReactor() {
playMode: PlayMode.loop
})
)
addObjectToGroup(entity, volumetric.player.value.mesh)
addObjectToGroup(entity, volumetric.player.value.mesh as any)

const handleAutoplay = () => {
if (!volumetric.player.value.paused) volumetric.player.value.play()
Expand Down Expand Up @@ -198,8 +198,9 @@ export function VolumetricReactor() {
const transform = getComponent(entity, TransformComponent)
if (!transform) return
if (volumetric.loadingEffectActive.value) {
volumetric.height.set(calculateHeight(volumetric.player.value.mesh) * transform.scale.y)
if (volumetric.loadingEffectTime.value === 0) setupLoadingEffect(entity, volumetric.player.value!.mesh)
volumetric.height.set(calculateHeight(volumetric.player.value.mesh as any) * transform.scale.y)
if (volumetric.loadingEffectTime.value === 0)
setupLoadingEffect(entity, volumetric.player.value!.mesh as any)
}
})

Expand Down
4 changes: 2 additions & 2 deletions packages/engine/src/scene/constants/Util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const loadCubeMapTexture = (
(res) => {
if (onProgress) onProgress(res)
},
(error) => {
(error: any) => {
if (onError) onError(error)
}
)
Expand All @@ -89,7 +89,7 @@ export const loadDDSTexture = (
(res) => {
if (onProgress) onProgress(res)
},
(error) => {
(error: any) => {
if (onError) onError(error)
}
)
Expand Down

0 comments on commit 742378b

Please sign in to comment.