architwin 1.0.59 → 1.0.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -12,6 +12,10 @@ export declare class Plane {
|
|
|
12
12
|
visible: boolean;
|
|
13
13
|
aspectRatio: number;
|
|
14
14
|
clickFlag: number;
|
|
15
|
+
viewport: {
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
};
|
|
15
19
|
};
|
|
16
20
|
playbackState: string;
|
|
17
21
|
audio: string;
|
|
@@ -45,8 +49,6 @@ export declare class Plane {
|
|
|
45
49
|
renderPauseButtonModel(): void;
|
|
46
50
|
renderMuteModel(): void;
|
|
47
51
|
renderUnmuteModel(): void;
|
|
48
|
-
createBufferSliders(): void;
|
|
49
|
-
createTrackSlider(): void;
|
|
50
52
|
renderNextModel(): void;
|
|
51
53
|
renderPrevModel(): void;
|
|
52
54
|
createMediaButtonTextures(): void;
|
|
@@ -22,7 +22,11 @@ export class Plane {
|
|
|
22
22
|
autoplay: false,
|
|
23
23
|
visible: true,
|
|
24
24
|
aspectRatio: 1,
|
|
25
|
-
clickFlag: 0
|
|
25
|
+
clickFlag: 0,
|
|
26
|
+
viewport: {
|
|
27
|
+
width: 0,
|
|
28
|
+
height: 0
|
|
29
|
+
}
|
|
26
30
|
};
|
|
27
31
|
this.playbackState = 'pause';
|
|
28
32
|
this.audio = 'unmuted';
|
|
@@ -110,6 +114,8 @@ export class Plane {
|
|
|
110
114
|
const context = canvas.getContext('2d');
|
|
111
115
|
canvas.width = viewport.width;
|
|
112
116
|
canvas.height = viewport.height;
|
|
117
|
+
this.inputs.viewport.width = viewport.width * 0.003;
|
|
118
|
+
this.inputs.viewport.height = viewport.height * 0.003;
|
|
113
119
|
// Render the page to the canvas
|
|
114
120
|
const renderContext = {
|
|
115
121
|
canvasContext: context,
|
|
@@ -173,7 +179,15 @@ export class Plane {
|
|
|
173
179
|
default:
|
|
174
180
|
this.texture = new THREE.TextureLoader().load(this.inputs.url);
|
|
175
181
|
}
|
|
176
|
-
|
|
182
|
+
// Create plane geometry
|
|
183
|
+
let geometry;
|
|
184
|
+
if (this.inputs.type == 'pdf') {
|
|
185
|
+
geometry = new THREE.PlaneGeometry(this.inputs.viewport.width, this.inputs.viewport.height);
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
geometry = new THREE.PlaneGeometry(1.0, 1.0);
|
|
189
|
+
}
|
|
190
|
+
this.mesh = new THREE.Mesh(geometry, new THREE.MeshBasicMaterial({
|
|
177
191
|
map: this.texture,
|
|
178
192
|
transparent: true,
|
|
179
193
|
needsUpdate: true,
|
|
@@ -188,13 +202,15 @@ export class Plane {
|
|
|
188
202
|
color: 0xFFFFFF
|
|
189
203
|
}));
|
|
190
204
|
this.mesh.add(mesh);
|
|
205
|
+
}
|
|
206
|
+
else if (this.inputs.type == 'pdf') {
|
|
191
207
|
this.createArrowButtonTextures();
|
|
192
208
|
//Create next button
|
|
193
209
|
this.renderNextModel();
|
|
194
210
|
//Create previous button
|
|
195
211
|
this.renderPrevModel();
|
|
196
212
|
}
|
|
197
|
-
if (this.inputs.type == 'video') {
|
|
213
|
+
else if (this.inputs.type == 'video') {
|
|
198
214
|
this.createMediaButtonTextures();
|
|
199
215
|
//Create play button
|
|
200
216
|
this.renderPlayButtonModel();
|
|
@@ -270,7 +286,7 @@ export class Plane {
|
|
|
270
286
|
this.inputs.clickFlag++;
|
|
271
287
|
}
|
|
272
288
|
else if (data.collider.name == 'prevBtn') {
|
|
273
|
-
this.inputs.clickFlag
|
|
289
|
+
this.inputs.clickFlag = Math.abs(--this.inputs.clickFlag);
|
|
274
290
|
}
|
|
275
291
|
}
|
|
276
292
|
else if (this.inputs.type == 'image') {
|
|
@@ -405,31 +421,63 @@ export class Plane {
|
|
|
405
421
|
renderNextModel() {
|
|
406
422
|
const THREE = this.context.three;
|
|
407
423
|
const nextButtonGeometry = new THREE.PlaneGeometry(0.2, 0.2);
|
|
408
|
-
|
|
424
|
+
const x = (this.inputs.viewport.width / 2) * 0.4;
|
|
425
|
+
const y = this.inputs.viewport.height * -0.46;
|
|
426
|
+
nextButtonGeometry.translate(x, y, 0.01);
|
|
409
427
|
this.nextButtonModel = new THREE.Mesh(nextButtonGeometry, new THREE.MeshBasicMaterial({
|
|
410
428
|
map: this.nextBtnTexture,
|
|
411
429
|
transparent: true,
|
|
412
430
|
needsUpdate: true,
|
|
413
431
|
alphaTest: 0.5
|
|
414
432
|
}));
|
|
415
|
-
this.nextButtonModel.visible =
|
|
433
|
+
this.nextButtonModel.visible = true;
|
|
416
434
|
this.nextButtonModel.name = "nextBtn";
|
|
417
435
|
this.mesh.add(this.nextButtonModel);
|
|
418
436
|
}
|
|
419
437
|
renderPrevModel() {
|
|
420
438
|
const THREE = this.context.three;
|
|
421
439
|
const prevButtonGeometry = new THREE.PlaneGeometry(0.2, 0.2);
|
|
422
|
-
|
|
440
|
+
const x = (this.inputs.viewport.width / 2) * -0.4;
|
|
441
|
+
const y = this.inputs.viewport.height * -0.46;
|
|
442
|
+
prevButtonGeometry.translate(x, y, 0.01);
|
|
423
443
|
this.prevButtonModel = new THREE.Mesh(prevButtonGeometry, new THREE.MeshBasicMaterial({
|
|
424
444
|
map: this.prevBtnTexture,
|
|
425
445
|
transparent: true,
|
|
426
446
|
needsUpdate: true,
|
|
427
447
|
alphaTest: 0.5
|
|
428
448
|
}));
|
|
429
|
-
this.prevButtonModel.visible =
|
|
449
|
+
this.prevButtonModel.visible = true;
|
|
430
450
|
this.prevButtonModel.name = "prevBtn";
|
|
431
451
|
this.mesh.add(this.prevButtonModel);
|
|
432
452
|
}
|
|
453
|
+
createBufferSliders() {
|
|
454
|
+
const THREE = this.context.three;
|
|
455
|
+
//Buffer slider
|
|
456
|
+
const bufferSliderGeometry = new THREE.PlaneGeometry(0.9, 0.03);
|
|
457
|
+
bufferSliderGeometry.translate(0, -0.3, 0.01);
|
|
458
|
+
this.bufferSliderModel = new THREE.Mesh(bufferSliderGeometry, new THREE.MeshBasicMaterial({
|
|
459
|
+
color: 0xc0c0c0,
|
|
460
|
+
transparent: true,
|
|
461
|
+
needsUpdate: true,
|
|
462
|
+
side: THREE.DoubleSide
|
|
463
|
+
}));
|
|
464
|
+
this.bufferSliderModel.name = 'bufferSlider';
|
|
465
|
+
this.mesh.add(this.bufferSliderModel);
|
|
466
|
+
}
|
|
467
|
+
createTrackSlider() {
|
|
468
|
+
const THREE = this.context.three;
|
|
469
|
+
//Track slider
|
|
470
|
+
const trackSliderGeometry = new THREE.PlaneGeometry(0.5, 0.03);
|
|
471
|
+
trackSliderGeometry.translate(-0.2, -0.3, 0.01);
|
|
472
|
+
this.trackSliderModel = new THREE.Mesh(trackSliderGeometry, new THREE.MeshBasicMaterial({
|
|
473
|
+
color: 0xff0000,
|
|
474
|
+
transparent: true,
|
|
475
|
+
needsUpdate: true,
|
|
476
|
+
side: THREE.DoubleSide
|
|
477
|
+
}));
|
|
478
|
+
this.bufferSliderModel.name = 'trackSlider';
|
|
479
|
+
this.mesh.add(this.trackSliderModel);
|
|
480
|
+
}
|
|
433
481
|
createMediaButtonTextures() {
|
|
434
482
|
//Generate textures for each icon
|
|
435
483
|
const THREE = this.context.three;
|
package/package.json
CHANGED
package/static/nexticon.png
CHANGED
|
Binary file
|
package/static/previousicon.png
CHANGED
|
Binary file
|