Skip to content

Commit

Permalink
Fix #903 cubemap broken
Browse files Browse the repository at this point in the history
  • Loading branch information
mistic100 committed Mar 21, 2023
1 parent 1e54cf1 commit 74070cd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/cubemap-adapter/src/CubemapAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
import { cleanCubemap, cleanCubemapArray, isCubemap } from './utils';

type CubemapMesh = Mesh<BoxGeometry, ShaderMaterial[]>;
type CubemapTexture = TextureData<Texture[], CubemapSeparate | CubemapStripe | CubemapNet>;
type CubemapTexture = TextureData<Texture[], CubemapPanorama>;

const getConfig = utils.getConfigParser<CubemapAdapterConfig>({
flipTopBottom: false,
Expand Down Expand Up @@ -85,7 +85,7 @@ export class CubemapAdapter extends AbstractAdapter<CubemapPanorama, Texture[]>
throw new PSVError('Invalid cubemap panorama, are you using the right adapter?');
}

return { panorama: cleanPanorama, texture };
return { panorama, texture };
}

private loadTexturesSeparate(paths: string[]): Promise<Texture[]> {
Expand Down Expand Up @@ -254,7 +254,7 @@ void main() {

setTexture(mesh: CubemapMesh, textureData: CubemapTexture) {
const { texture, panorama } = textureData;
const isNet = panorama.type === 'net';
const isNet = (panorama as CubemapNet).type === 'net';
const flipTopBottom = isNet ? !this.config.flipTopBottom : this.config.flipTopBottom;

for (let i = 0; i < 6; i++) {
Expand Down

0 comments on commit 74070cd

Please sign in to comment.