Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
KasperQd committed Jan 6, 2025
1 parent e6f60ed commit 5f64fb1
Showing 1 changed file with 19 additions and 21 deletions.
40 changes: 19 additions & 21 deletions src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,12 @@ class VR extends Plugin {
this.options_.sphereDetail
);

let uvAttribute = geometry.getAttribute("uv");
let uvAttribute = geometry.getAttribute('uv');

if (uvAttribute) {
for (let i = 0; i < uvAttribute.count; i++) {
let u = uvAttribute.getX(i);
let v = uvAttribute.getY(i);
const u = uvAttribute.getX(i);
const v = uvAttribute.getY(i);

if (projection === '360_LR') {
uvAttribute.setX(i, u * 0.5);
Expand All @@ -161,7 +162,7 @@ class VR extends Plugin {
uvAttribute.needsUpdate = true;
}

this.movieGeometry = geometry
this.movieGeometry = geometry;
this.movieMaterial = new THREE.MeshBasicMaterial({ map: this.videoTexture, overdraw: true, side: THREE.BackSide });

this.movieScreen = new THREE.Mesh(this.movieGeometry, this.movieMaterial);
Expand All @@ -178,11 +179,11 @@ class VR extends Plugin {
this.options_.sphereDetail
);

uvAttribute = geometry.getAttribute("uv");
uvAttribute = geometry.getAttribute('uv');
if (uvAttribute) {
for (let i = 0; i < uvAttribute.count; i++) {
let u = uvAttribute.getX(i);
let v = uvAttribute.getY(i);
const u = uvAttribute.getX(i);
const v = uvAttribute.getY(i);

if (projection === '360_LR') {
uvAttribute.setX(i, u * 0.5);
Expand All @@ -194,7 +195,7 @@ class VR extends Plugin {
uvAttribute.needsUpdate = true;
}

this.movieGeometry = geometry
this.movieGeometry = geometry;
this.movieMaterial = new THREE.MeshBasicMaterial({ map: this.videoTexture, overdraw: true, side: THREE.BackSide });

this.movieScreen = new THREE.Mesh(this.movieGeometry, this.movieMaterial);
Expand Down Expand Up @@ -253,16 +254,18 @@ class VR extends Plugin {
// Left eye view
geometry.scale(-1, 1, 1);

let uvAttribute = geometry.getAttribute("uv");
let uvAttribute = geometry.getAttribute('uv');

if (projection !== '180_MONO') {
for (let i = 0; i < uvAttribute.count; i++) {
const u = uvAttribute.getX(i);
const u = uvAttribute.getX(i);

uvAttribute.setX(i, u * 0.5);
}
uvAttribute.needsUpdate = true;
}

this.movieGeometry = geometry
this.movieGeometry = geometry;
this.movieMaterial = new THREE.MeshBasicMaterial({
map: this.videoTexture,
overdraw: true
Expand All @@ -282,14 +285,15 @@ class VR extends Plugin {
);
geometry.scale(-1, 1, 1);

uvAttribute = geometry.getAttribute("uv");
uvAttribute = geometry.getAttribute('uv');
for (let i = 0; i < uvAttribute.count; i++) {
const u = uvAttribute.getX(i);
const u = uvAttribute.getX(i);

uvAttribute.setX(i, u * 0.5 + 0.5);
}
uvAttribute.needsUpdate = true;

this.movieGeometry = geometry
this.movieGeometry = geometry;
this.movieMaterial = new THREE.MeshBasicMaterial({
map: this.videoTexture,
overdraw: true
Expand Down Expand Up @@ -377,26 +381,20 @@ void main() {
vector.x = vector.x / height * (height - contCorrect * 2) + contCorrect / height;
}
}
let uvs = [];
const uvs = [];

uvs.push(...right[2].toArray(), ...right[1].toArray(), ...right[3].toArray());
uvs.push(...right[1].toArray(), ...right[0].toArray(), ...right[3].toArray());

uvs.push(...left[2].toArray(), ...left[1].toArray(), ...left[3].toArray());
uvs.push(...left[1].toArray(), ...left[0].toArray(), ...left[3].toArray());

uvs.push(...top[2].toArray(), ...top[1].toArray(), ...top[3].toArray());
uvs.push(...top[1].toArray(), ...top[0].toArray(), ...top[3].toArray());

uvs.push(...bottom[2].toArray(), ...bottom[1].toArray(), ...bottom[3].toArray());
uvs.push(...bottom[1].toArray(), ...bottom[0].toArray(), ...bottom[3].toArray());

uvs.push(...front[2].toArray(), ...front[1].toArray(), ...front[3].toArray());
uvs.push(...front[1].toArray(), ...front[0].toArray(), ...front[3].toArray());

uvs.push(...back[2].toArray(), ...back[1].toArray(), ...back[3].toArray());
uvs.push(...back[1].toArray(), ...back[0].toArray(), ...back[3].toArray());

this.movieGeometry.setAttribute('uv', new THREE.Float32BufferAttribute(uvs, 2));

this.movieScreen = new THREE.Mesh(this.movieGeometry, this.movieMaterial);
Expand Down

0 comments on commit 5f64fb1

Please sign in to comment.