@twick/core 0.14.21 → 0.15.0
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.
- package/dist/index.cjs +6465 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +3919 -0
- package/dist/index.d.ts +3919 -0
- package/dist/index.js +6225 -0
- package/dist/index.js.map +1 -0
- package/package.json +28 -18
- package/tsconfig.project.json +1 -0
- package/lib/app/Logger.d.ts +0 -105
- package/lib/app/Logger.d.ts.map +0 -1
- package/lib/app/Logger.js +0 -77
- package/lib/app/PlaybackManager.d.ts +0 -55
- package/lib/app/PlaybackManager.d.ts.map +0 -1
- package/lib/app/PlaybackManager.js +0 -179
- package/lib/app/PlaybackStatus.d.ts +0 -30
- package/lib/app/PlaybackStatus.d.ts.map +0 -1
- package/lib/app/PlaybackStatus.js +0 -46
- package/lib/app/Player.d.ts +0 -130
- package/lib/app/Player.d.ts.map +0 -1
- package/lib/app/Player.js +0 -375
- package/lib/app/Project.d.ts +0 -145
- package/lib/app/Project.d.ts.map +0 -1
- package/lib/app/Project.js +0 -10
- package/lib/app/Renderer.d.ts +0 -90
- package/lib/app/Renderer.d.ts.map +0 -1
- package/lib/app/Renderer.js +0 -318
- package/lib/app/SharedWebGLContext.d.ts +0 -24
- package/lib/app/SharedWebGLContext.d.ts.map +0 -1
- package/lib/app/SharedWebGLContext.js +0 -200
- package/lib/app/Stage.d.ts +0 -30
- package/lib/app/Stage.d.ts.map +0 -1
- package/lib/app/Stage.js +0 -75
- package/lib/app/TimeEstimator.d.ts +0 -53
- package/lib/app/TimeEstimator.d.ts.map +0 -1
- package/lib/app/TimeEstimator.js +0 -70
- package/lib/app/index.d.ts +0 -16
- package/lib/app/index.d.ts.map +0 -1
- package/lib/app/index.js +0 -16
- package/lib/app/makeProject.d.ts +0 -15
- package/lib/app/makeProject.d.ts.map +0 -1
- package/lib/app/makeProject.js +0 -72
- package/lib/app/project-settings.d.ts +0 -8
- package/lib/app/project-settings.d.ts.map +0 -1
- package/lib/app/project-settings.js +0 -13
- package/lib/decorators/decorate.d.ts +0 -2
- package/lib/decorators/decorate.d.ts.map +0 -1
- package/lib/decorators/decorate.js +0 -10
- package/lib/decorators/deprecated.d.ts +0 -5
- package/lib/decorators/deprecated.d.ts.map +0 -1
- package/lib/decorators/deprecated.js +0 -23
- package/lib/decorators/index.d.ts +0 -9
- package/lib/decorators/index.d.ts.map +0 -1
- package/lib/decorators/index.js +0 -9
- package/lib/decorators/lazy.d.ts +0 -14
- package/lib/decorators/lazy.d.ts.map +0 -1
- package/lib/decorators/lazy.js +0 -27
- package/lib/decorators/threadable.d.ts +0 -2
- package/lib/decorators/threadable.d.ts.map +0 -1
- package/lib/decorators/threadable.js +0 -9
- package/lib/events/AsyncEventDispatcher.d.ts +0 -45
- package/lib/events/AsyncEventDispatcher.d.ts.map +0 -1
- package/lib/events/AsyncEventDispatcher.js +0 -33
- package/lib/events/EventDispatcher.d.ts +0 -38
- package/lib/events/EventDispatcher.d.ts.map +0 -1
- package/lib/events/EventDispatcher.js +0 -29
- package/lib/events/EventDispatcherBase.d.ts +0 -55
- package/lib/events/EventDispatcherBase.d.ts.map +0 -1
- package/lib/events/EventDispatcherBase.js +0 -68
- package/lib/events/FlagDispatcher.d.ts +0 -54
- package/lib/events/FlagDispatcher.d.ts.map +0 -1
- package/lib/events/FlagDispatcher.js +0 -63
- package/lib/events/ValueDispatcher.d.ts +0 -81
- package/lib/events/ValueDispatcher.d.ts.map +0 -1
- package/lib/events/ValueDispatcher.js +0 -97
- package/lib/events/index.d.ts +0 -11
- package/lib/events/index.d.ts.map +0 -1
- package/lib/events/index.js +0 -11
- package/lib/exporter/Exporter.d.ts +0 -101
- package/lib/exporter/Exporter.d.ts.map +0 -1
- package/lib/exporter/Exporter.js +0 -2
- package/lib/exporter/FFmpegExporter.d.ts +0 -50
- package/lib/exporter/FFmpegExporter.d.ts.map +0 -1
- package/lib/exporter/FFmpegExporter.js +0 -140
- package/lib/exporter/ImageExporter.d.ts +0 -34
- package/lib/exporter/ImageExporter.d.ts.map +0 -1
- package/lib/exporter/ImageExporter.js +0 -80
- package/lib/exporter/WasmExporter.d.ts +0 -19
- package/lib/exporter/WasmExporter.d.ts.map +0 -1
- package/lib/exporter/WasmExporter.js +0 -78
- package/lib/exporter/download-videos.d.ts +0 -3
- package/lib/exporter/download-videos.d.ts.map +0 -1
- package/lib/exporter/download-videos.js +0 -45
- package/lib/exporter/index.d.ts +0 -5
- package/lib/exporter/index.d.ts.map +0 -1
- package/lib/exporter/index.js +0 -5
- package/lib/flow/all.d.ts +0 -18
- package/lib/flow/all.d.ts.map +0 -1
- package/lib/flow/all.js +0 -25
- package/lib/flow/any.d.ts +0 -18
- package/lib/flow/any.d.ts.map +0 -1
- package/lib/flow/any.js +0 -25
- package/lib/flow/chain.d.ts +0 -36
- package/lib/flow/chain.d.ts.map +0 -1
- package/lib/flow/chain.js +0 -46
- package/lib/flow/delay.d.ts +0 -29
- package/lib/flow/delay.d.ts.map +0 -1
- package/lib/flow/delay.js +0 -39
- package/lib/flow/every.d.ts +0 -41
- package/lib/flow/every.d.ts.map +0 -1
- package/lib/flow/every.js +0 -61
- package/lib/flow/index.d.ts +0 -17
- package/lib/flow/index.d.ts.map +0 -1
- package/lib/flow/index.js +0 -17
- package/lib/flow/join.d.ts +0 -35
- package/lib/flow/join.d.ts.map +0 -1
- package/lib/flow/join.js +0 -33
- package/lib/flow/loop.d.ts +0 -58
- package/lib/flow/loop.d.ts.map +0 -1
- package/lib/flow/loop.js +0 -51
- package/lib/flow/loopFor.d.ts +0 -25
- package/lib/flow/loopFor.d.ts.map +0 -1
- package/lib/flow/loopFor.js +0 -42
- package/lib/flow/names.d.ts +0 -3
- package/lib/flow/names.d.ts.map +0 -1
- package/lib/flow/names.js +0 -11
- package/lib/flow/run.d.ts +0 -45
- package/lib/flow/run.d.ts.map +0 -1
- package/lib/flow/run.js +0 -14
- package/lib/flow/scheduling.d.ts +0 -18
- package/lib/flow/scheduling.d.ts.map +0 -1
- package/lib/flow/scheduling.js +0 -33
- package/lib/flow/sequence.d.ts +0 -22
- package/lib/flow/sequence.d.ts.map +0 -1
- package/lib/flow/sequence.js +0 -31
- package/lib/index.d.ts +0 -16
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -16
- package/lib/media/index.d.ts +0 -7
- package/lib/media/index.d.ts.map +0 -1
- package/lib/media/index.js +0 -7
- package/lib/media/loadImage.d.ts +0 -8
- package/lib/media/loadImage.d.ts.map +0 -1
- package/lib/media/loadImage.js +0 -29
- package/lib/plugin/DefaultPlugin.d.ts +0 -10
- package/lib/plugin/DefaultPlugin.d.ts.map +0 -1
- package/lib/plugin/DefaultPlugin.js +0 -17
- package/lib/plugin/Plugin.d.ts +0 -53
- package/lib/plugin/Plugin.d.ts.map +0 -1
- package/lib/plugin/Plugin.js +0 -2
- package/lib/plugin/index.d.ts +0 -3
- package/lib/plugin/index.d.ts.map +0 -1
- package/lib/plugin/index.js +0 -3
- package/lib/plugin/makePlugin.d.ts +0 -15
- package/lib/plugin/makePlugin.d.ts.map +0 -1
- package/lib/plugin/makePlugin.js +0 -16
- package/lib/scenes/GeneratorScene.d.ts +0 -95
- package/lib/scenes/GeneratorScene.d.ts.map +0 -1
- package/lib/scenes/GeneratorScene.js +0 -273
- package/lib/scenes/Inspectable.d.ts +0 -71
- package/lib/scenes/Inspectable.d.ts.map +0 -1
- package/lib/scenes/Inspectable.js +0 -4
- package/lib/scenes/LifecycleEvents.d.ts +0 -18
- package/lib/scenes/LifecycleEvents.d.ts.map +0 -1
- package/lib/scenes/LifecycleEvents.js +0 -45
- package/lib/scenes/Random.d.ts +0 -66
- package/lib/scenes/Random.d.ts.map +0 -1
- package/lib/scenes/Random.js +0 -101
- package/lib/scenes/Scene.d.ts +0 -298
- package/lib/scenes/Scene.d.ts.map +0 -1
- package/lib/scenes/Scene.js +0 -25
- package/lib/scenes/SceneState.d.ts +0 -34
- package/lib/scenes/SceneState.d.ts.map +0 -1
- package/lib/scenes/SceneState.js +0 -35
- package/lib/scenes/Shaders.d.ts +0 -63
- package/lib/scenes/Shaders.d.ts.map +0 -1
- package/lib/scenes/Shaders.js +0 -158
- package/lib/scenes/Slides.d.ts +0 -33
- package/lib/scenes/Slides.d.ts.map +0 -1
- package/lib/scenes/Slides.js +0 -115
- package/lib/scenes/Threadable.d.ts +0 -19
- package/lib/scenes/Threadable.d.ts.map +0 -1
- package/lib/scenes/Threadable.js +0 -4
- package/lib/scenes/Variables.d.ts +0 -24
- package/lib/scenes/Variables.d.ts.map +0 -1
- package/lib/scenes/Variables.js +0 -39
- package/lib/scenes/index.d.ts +0 -16
- package/lib/scenes/index.d.ts.map +0 -1
- package/lib/scenes/index.js +0 -16
- package/lib/signals/CompoundSignalContext.d.ts +0 -21
- package/lib/signals/CompoundSignalContext.d.ts.map +0 -1
- package/lib/signals/CompoundSignalContext.js +0 -73
- package/lib/signals/ComputedContext.d.ts +0 -14
- package/lib/signals/ComputedContext.d.ts.map +0 -1
- package/lib/signals/ComputedContext.js +0 -36
- package/lib/signals/DependencyContext.d.ts +0 -32
- package/lib/signals/DependencyContext.d.ts.map +0 -1
- package/lib/signals/DependencyContext.js +0 -87
- package/lib/signals/SignalContext.d.ts +0 -120
- package/lib/signals/SignalContext.d.ts.map +0 -1
- package/lib/signals/SignalContext.js +0 -245
- package/lib/signals/createComputed.d.ts +0 -3
- package/lib/signals/createComputed.d.ts.map +0 -1
- package/lib/signals/createComputed.js +0 -5
- package/lib/signals/createComputedAsync.d.ts +0 -4
- package/lib/signals/createComputedAsync.d.ts.map +0 -1
- package/lib/signals/createComputedAsync.js +0 -15
- package/lib/signals/createSignal.d.ts +0 -5
- package/lib/signals/createSignal.d.ts.map +0 -1
- package/lib/signals/createSignal.js +0 -6
- package/lib/signals/index.d.ts +0 -16
- package/lib/signals/index.d.ts.map +0 -1
- package/lib/signals/index.js +0 -16
- package/lib/signals/symbols.d.ts +0 -2
- package/lib/signals/symbols.d.ts.map +0 -1
- package/lib/signals/symbols.js +0 -2
- package/lib/signals/types.d.ts +0 -51
- package/lib/signals/types.d.ts.map +0 -1
- package/lib/signals/types.js +0 -2
- package/lib/signals/utils.d.ts +0 -5
- package/lib/signals/utils.d.ts.map +0 -1
- package/lib/signals/utils.js +0 -10
- package/lib/threading/Thread.d.ts +0 -77
- package/lib/threading/Thread.d.ts.map +0 -1
- package/lib/threading/Thread.js +0 -169
- package/lib/threading/ThreadGenerator.d.ts +0 -39
- package/lib/threading/ThreadGenerator.d.ts.map +0 -1
- package/lib/threading/ThreadGenerator.js +0 -17
- package/lib/threading/cancel.d.ts +0 -17
- package/lib/threading/cancel.d.ts.map +0 -1
- package/lib/threading/cancel.js +0 -26
- package/lib/threading/index.d.ts +0 -11
- package/lib/threading/index.d.ts.map +0 -1
- package/lib/threading/index.js +0 -11
- package/lib/threading/spawn.d.ts +0 -28
- package/lib/threading/spawn.d.ts.map +0 -1
- package/lib/threading/spawn.js +0 -30
- package/lib/threading/threads.d.ts +0 -46
- package/lib/threading/threads.d.ts.map +0 -1
- package/lib/threading/threads.js +0 -89
- package/lib/transitions/fadeTransition.d.ts +0 -8
- package/lib/transitions/fadeTransition.d.ts.map +0 -1
- package/lib/transitions/fadeTransition.js +0 -16
- package/lib/transitions/index.d.ts +0 -11
- package/lib/transitions/index.d.ts.map +0 -1
- package/lib/transitions/index.js +0 -11
- package/lib/transitions/slideTransition.d.ts +0 -18
- package/lib/transitions/slideTransition.d.ts.map +0 -1
- package/lib/transitions/slideTransition.js +0 -14
- package/lib/transitions/useTransition.d.ts +0 -10
- package/lib/transitions/useTransition.d.ts.map +0 -1
- package/lib/transitions/useTransition.js +0 -27
- package/lib/transitions/zoomInTransition.d.ts +0 -10
- package/lib/transitions/zoomInTransition.d.ts.map +0 -1
- package/lib/transitions/zoomInTransition.js +0 -33
- package/lib/transitions/zoomOutTransition.d.ts +0 -10
- package/lib/transitions/zoomOutTransition.d.ts.map +0 -1
- package/lib/transitions/zoomOutTransition.js +0 -33
- package/lib/tsconfig.build.tsbuildinfo +0 -1
- package/lib/tweening/helpers.d.ts +0 -5
- package/lib/tweening/helpers.d.ts.map +0 -1
- package/lib/tweening/helpers.js +0 -16
- package/lib/tweening/index.d.ts +0 -11
- package/lib/tweening/index.d.ts.map +0 -1
- package/lib/tweening/index.js +0 -11
- package/lib/tweening/interpolationFunctions.d.ts +0 -38
- package/lib/tweening/interpolationFunctions.d.ts.map +0 -1
- package/lib/tweening/interpolationFunctions.js +0 -107
- package/lib/tweening/spring.d.ts +0 -20
- package/lib/tweening/spring.d.ts.map +0 -1
- package/lib/tweening/spring.js +0 -103
- package/lib/tweening/timingFunctions.d.ts +0 -46
- package/lib/tweening/timingFunctions.d.ts.map +0 -1
- package/lib/tweening/timingFunctions.js +0 -233
- package/lib/tweening/tween.d.ts +0 -3
- package/lib/tweening/tween.d.ts.map +0 -1
- package/lib/tweening/tween.js +0 -21
- package/lib/types/BBox.d.ts +0 -73
- package/lib/types/BBox.d.ts.map +0 -1
- package/lib/types/BBox.js +0 -249
- package/lib/types/Canvas.d.ts +0 -3
- package/lib/types/Canvas.d.ts.map +0 -1
- package/lib/types/Canvas.js +0 -2
- package/lib/types/Color.d.ts +0 -65
- package/lib/types/Color.d.ts.map +0 -1
- package/lib/types/Color.js +0 -185
- package/lib/types/Matrix.d.ts +0 -3
- package/lib/types/Matrix.d.ts.map +0 -1
- package/lib/types/Matrix.js +0 -10
- package/lib/types/Matrix2D.d.ts +0 -363
- package/lib/types/Matrix2D.d.ts.map +0 -1
- package/lib/types/Matrix2D.js +0 -554
- package/lib/types/Origin.d.ts +0 -17
- package/lib/types/Origin.d.ts.map +0 -1
- package/lib/types/Origin.js +0 -53
- package/lib/types/Spacing.d.ts +0 -36
- package/lib/types/Spacing.d.ts.map +0 -1
- package/lib/types/Spacing.js +0 -70
- package/lib/types/Type.d.ts +0 -9
- package/lib/types/Type.d.ts.map +0 -1
- package/lib/types/Type.js +0 -5
- package/lib/types/Vector.d.ts +0 -203
- package/lib/types/Vector.d.ts.map +0 -1
- package/lib/types/Vector.js +0 -355
- package/lib/types/alignment-enums.d.ts +0 -22
- package/lib/types/alignment-enums.d.ts.map +0 -1
- package/lib/types/alignment-enums.js +0 -25
- package/lib/types/index.d.ts +0 -17
- package/lib/types/index.d.ts.map +0 -1
- package/lib/types/index.js +0 -17
- package/lib/types/vector-transformations.d.ts +0 -20
- package/lib/types/vector-transformations.d.ts.map +0 -1
- package/lib/types/vector-transformations.js +0 -31
- package/lib/utils/DetailedError.d.ts +0 -24
- package/lib/utils/DetailedError.d.ts.map +0 -1
- package/lib/utils/DetailedError.js +0 -16
- package/lib/utils/ExperimentalError.d.ts +0 -10
- package/lib/utils/ExperimentalError.d.ts.map +0 -1
- package/lib/utils/ExperimentalError.js +0 -32
- package/lib/utils/Semaphore.d.ts +0 -12
- package/lib/utils/Semaphore.d.ts.map +0 -1
- package/lib/utils/Semaphore.js +0 -25
- package/lib/utils/beginSlide.d.ts +0 -3
- package/lib/utils/beginSlide.d.ts.map +0 -1
- package/lib/utils/beginSlide.js +0 -12
- package/lib/utils/capitalize.d.ts +0 -2
- package/lib/utils/capitalize.d.ts.map +0 -1
- package/lib/utils/capitalize.js +0 -4
- package/lib/utils/createRef.d.ts +0 -15
- package/lib/utils/createRef.d.ts.map +0 -1
- package/lib/utils/createRef.js +0 -21
- package/lib/utils/createRefArray.d.ts +0 -27
- package/lib/utils/createRefArray.d.ts.map +0 -1
- package/lib/utils/createRefArray.js +0 -49
- package/lib/utils/createRefMap.d.ts +0 -50
- package/lib/utils/createRefMap.d.ts.map +0 -1
- package/lib/utils/createRefMap.js +0 -77
- package/lib/utils/debug.d.ts +0 -24
- package/lib/utils/debug.d.ts.map +0 -1
- package/lib/utils/debug.js +0 -47
- package/lib/utils/deprecate.d.ts +0 -9
- package/lib/utils/deprecate.d.ts.map +0 -1
- package/lib/utils/deprecate.js +0 -15
- package/lib/utils/errorToLog.d.ts +0 -3
- package/lib/utils/errorToLog.d.ts.map +0 -1
- package/lib/utils/errorToLog.js +0 -8
- package/lib/utils/experimentalLog.d.ts +0 -3
- package/lib/utils/experimentalLog.d.ts.map +0 -1
- package/lib/utils/experimentalLog.js +0 -10
- package/lib/utils/getContext.d.ts +0 -2
- package/lib/utils/getContext.d.ts.map +0 -1
- package/lib/utils/getContext.js +0 -8
- package/lib/utils/index.d.ts +0 -26
- package/lib/utils/index.d.ts.map +0 -1
- package/lib/utils/index.js +0 -26
- package/lib/utils/math.d.ts +0 -15
- package/lib/utils/math.d.ts.map +0 -1
- package/lib/utils/math.js +0 -15
- package/lib/utils/range.d.ts +0 -40
- package/lib/utils/range.d.ts.map +0 -1
- package/lib/utils/range.js +0 -18
- package/lib/utils/useContext.d.ts +0 -13
- package/lib/utils/useContext.d.ts.map +0 -1
- package/lib/utils/useContext.js +0 -18
- package/lib/utils/usePlayback.d.ts +0 -8
- package/lib/utils/usePlayback.d.ts.map +0 -1
- package/lib/utils/usePlayback.js +0 -20
- package/lib/utils/useScene.d.ts +0 -17
- package/lib/utils/useScene.d.ts.map +0 -1
- package/lib/utils/useScene.js +0 -33
- package/lib/utils/useThread.d.ts +0 -8
- package/lib/utils/useThread.d.ts.map +0 -1
- package/lib/utils/useThread.js +0 -24
- package/lib/utils/useTime.d.ts +0 -19
- package/lib/utils/useTime.d.ts.map +0 -1
- package/lib/utils/useTime.js +0 -22
- package/project.d.ts +0 -24
package/lib/scenes/Random.js
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { map } from '../tweening';
|
|
2
|
-
import { range } from '../utils';
|
|
3
|
-
/**
|
|
4
|
-
* // TODO(refactor): maybe we can delete this
|
|
5
|
-
*
|
|
6
|
-
* A random number generator based on
|
|
7
|
-
* {@link https://gist.github.com/tommyettinger/46a874533244883189143505d203312c | Mulberry32}.
|
|
8
|
-
*/
|
|
9
|
-
export class Random {
|
|
10
|
-
constructor(state) {
|
|
11
|
-
this.state = state;
|
|
12
|
-
/**
|
|
13
|
-
* Previously generated Gaussian random number.
|
|
14
|
-
*
|
|
15
|
-
* @remarks
|
|
16
|
-
* This is an optimization.
|
|
17
|
-
* Since {@link gauss} generates a pair of independent Gaussian random
|
|
18
|
-
* numbers, it returns one immediately and stores the other for the next call
|
|
19
|
-
* to {@link gauss}.
|
|
20
|
-
*/
|
|
21
|
-
this.nextGauss = null;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* @internal
|
|
25
|
-
*/
|
|
26
|
-
static createSeed() {
|
|
27
|
-
return Math.floor(Math.random() * 4294967296);
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Get the next random float in the given range.
|
|
31
|
-
*
|
|
32
|
-
* @param from - The start of the range.
|
|
33
|
-
* @param to - The end of the range.
|
|
34
|
-
*/
|
|
35
|
-
nextFloat(from = 0, to = 1) {
|
|
36
|
-
return map(from, to, this.next());
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Get the next random integer in the given range.
|
|
40
|
-
*
|
|
41
|
-
* @param from - The start of the range.
|
|
42
|
-
* @param to - The end of the range. Exclusive.
|
|
43
|
-
*/
|
|
44
|
-
nextInt(from = 0, to = 4294967296) {
|
|
45
|
-
let value = Math.floor(map(from, to, this.next()));
|
|
46
|
-
if (value === to) {
|
|
47
|
-
value = from;
|
|
48
|
-
}
|
|
49
|
-
return value;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Get a random float from a gaussian distribution.
|
|
53
|
-
* @param mean - The mean of the distribution.
|
|
54
|
-
* @param stdev - The standard deviation of the distribution.
|
|
55
|
-
*/
|
|
56
|
-
gauss(mean = 0, stdev = 1) {
|
|
57
|
-
let z = this.nextGauss;
|
|
58
|
-
this.nextGauss = null;
|
|
59
|
-
if (z === null) {
|
|
60
|
-
const x2pi = this.next() * 2 * Math.PI;
|
|
61
|
-
const g2rad = Math.sqrt(-2 * Math.log(1 - this.next()));
|
|
62
|
-
z = Math.cos(x2pi) * g2rad;
|
|
63
|
-
this.nextGauss = Math.sin(x2pi) * g2rad;
|
|
64
|
-
}
|
|
65
|
-
return mean + z * stdev;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Get an array filled with random floats in the given range.
|
|
69
|
-
*
|
|
70
|
-
* @param size - The size of the array.
|
|
71
|
-
* @param from - The start of the range.
|
|
72
|
-
* @param to - The end of the range.
|
|
73
|
-
*/
|
|
74
|
-
floatArray(size, from = 0, to = 1) {
|
|
75
|
-
return range(size).map(() => this.nextFloat(from, to));
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
Get an array filled with random integers in the given range.
|
|
79
|
-
*
|
|
80
|
-
* @param size - The size of the array.
|
|
81
|
-
* @param from - The start of the range.
|
|
82
|
-
* @param to - The end of the range. Exclusive.
|
|
83
|
-
*/
|
|
84
|
-
intArray(size, from = 0, to = 4294967296) {
|
|
85
|
-
return range(size).map(() => this.nextInt(from, to));
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Create a new independent generator.
|
|
89
|
-
*/
|
|
90
|
-
spawn() {
|
|
91
|
-
return new Random(this.nextInt());
|
|
92
|
-
}
|
|
93
|
-
next() {
|
|
94
|
-
this.state |= 0;
|
|
95
|
-
this.state = (this.state + 0x6d2b79f5) | 0;
|
|
96
|
-
let t = Math.imul(this.state ^ (this.state >>> 15), 1 | this.state);
|
|
97
|
-
t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;
|
|
98
|
-
return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmFuZG9tLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3NjZW5lcy9SYW5kb20udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFDLEdBQUcsRUFBQyxNQUFNLGFBQWEsQ0FBQztBQUNoQyxP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0FBRyxFQUFFLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxJQUFJLEVBQUUsRUFBRSxDQUFDLENBQUMsQ0FBQztJQUN2RCxDQUFDO0lBRUQ7O09BRUc7SUFDSSxLQUFLO1FBQ1YsT0FBTyxJQUFJLE1BQU0sQ0FBQyxJQUFJLENBQUMsT0FBTyxFQUFFLENBQUMsQ0FBQztJQUNwQyxDQUFDO0lBRU8sSUFBSTtRQUNWLElBQUksQ0FBQyxLQUFLLElBQUksQ0FBQyxDQUFDO1FBQ2hCLElBQUksQ0FBQyxLQUFLLEdBQUcsQ0FBQyxJQUFJLENBQUMsS0FBSyxHQUFHLFVBQVUsQ0FBQyxHQUFHLENBQUMsQ0FBQztRQUMzQyxJQUFJLENBQUMsR0FBRyxJQUFJLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxLQUFLLEdBQUcsQ0FBQyxJQUFJLENBQUMsS0FBSyxLQUFLLEVBQUUsQ0FBQyxFQUFFLENBQUMsR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFDLENBQUM7UUFDcEUsQ0FBQyxHQUFHLENBQUMsQ0FBQyxHQUFHLElBQUksQ0FBQyxJQUFJLENBQUMsQ0FBQyxHQUFHLENBQUMsQ0FBQyxLQUFLLENBQUMsQ0FBQyxFQUFFLEVBQUUsR0FBRyxDQUFDLENBQUMsQ0FBQyxHQUFHLENBQUMsQ0FBQztRQUMvQyxPQUFPLENBQUMsQ0FBQyxDQUFDLEdBQUcsQ0FBQyxDQUFDLEtBQUssRUFBRSxDQUFDLENBQUMsS0FBSyxDQUFDLENBQUMsR0FBRyxVQUFVLENBQUM7SUFDL0MsQ0FBQztDQUNGIn0=
|
package/lib/scenes/Scene.d.ts
DELETED
|
@@ -1,298 +0,0 @@
|
|
|
1
|
-
import type { AssetInfo, Logger, PlaybackStatus, SharedWebGLContext } from '../app';
|
|
2
|
-
import type { SubscribableEvent, SubscribableValueEvent } from '../events';
|
|
3
|
-
import type { Plugin } from '../plugin';
|
|
4
|
-
import type { SignalValue } from '../signals';
|
|
5
|
-
import type { Vector2 } from '../types';
|
|
6
|
-
import type { LifecycleEvents } from './LifecycleEvents';
|
|
7
|
-
import type { Shaders } from './Shaders';
|
|
8
|
-
import type { Slides } from './Slides';
|
|
9
|
-
import type { Variables } from './Variables';
|
|
10
|
-
/**
|
|
11
|
-
* The constructor used when creating new scenes.
|
|
12
|
-
*
|
|
13
|
-
* @remarks
|
|
14
|
-
* Each class implementing the {@link Scene} interface should have a matching
|
|
15
|
-
* constructor.
|
|
16
|
-
*
|
|
17
|
-
* @typeParam T - The type of the configuration object. This object will be
|
|
18
|
-
* passed to the constructor from
|
|
19
|
-
* {@link SceneDescription.config}.
|
|
20
|
-
*/
|
|
21
|
-
export interface SceneConstructor<T> {
|
|
22
|
-
new (description: FullSceneDescription<T>): Scene;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Describes a scene exposed by scene files.
|
|
26
|
-
*
|
|
27
|
-
* @typeParam T - The type of the configuration object.
|
|
28
|
-
*/
|
|
29
|
-
export interface SceneDescription<T = unknown> {
|
|
30
|
-
/**
|
|
31
|
-
* Name of the scene.
|
|
32
|
-
*/
|
|
33
|
-
name: string;
|
|
34
|
-
/**
|
|
35
|
-
* The class used to instantiate the scene.
|
|
36
|
-
*/
|
|
37
|
-
klass: SceneConstructor<T>;
|
|
38
|
-
/**
|
|
39
|
-
* Configuration object.
|
|
40
|
-
*/
|
|
41
|
-
config: T;
|
|
42
|
-
/**
|
|
43
|
-
* The stack trace at the moment of creation.
|
|
44
|
-
*/
|
|
45
|
-
stack?: string;
|
|
46
|
-
/**
|
|
47
|
-
* A list of plugins to include in the project.
|
|
48
|
-
*/
|
|
49
|
-
plugins?: (Plugin | string)[];
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Describes a complete scene together with the meta file.
|
|
53
|
-
*
|
|
54
|
-
* @typeParam T - The type of the configuration object.
|
|
55
|
-
*/
|
|
56
|
-
export interface FullSceneDescription<T = unknown> extends SceneDescription<T> {
|
|
57
|
-
size: Vector2;
|
|
58
|
-
resolutionScale: number;
|
|
59
|
-
playback: PlaybackStatus;
|
|
60
|
-
logger: Logger;
|
|
61
|
-
sharedWebGLContext: SharedWebGLContext;
|
|
62
|
-
experimentalFeatures?: boolean;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* A part of the {@link SceneDescription} that can be updated during reload.
|
|
66
|
-
*
|
|
67
|
-
* @typeParam T - The type of the configuration object.
|
|
68
|
-
*/
|
|
69
|
-
export interface SceneDescriptionReload<T = unknown> {
|
|
70
|
-
size?: Vector2;
|
|
71
|
-
resolutionScale?: number;
|
|
72
|
-
config?: T;
|
|
73
|
-
stack?: string;
|
|
74
|
-
}
|
|
75
|
-
export type DescriptionOf<TScene> = TScene extends Scene<infer TConfig> ? SceneDescription<TConfig> : never;
|
|
76
|
-
/**
|
|
77
|
-
* Describes cached information about the timing of a scene.
|
|
78
|
-
*/
|
|
79
|
-
export interface CachedSceneData {
|
|
80
|
-
firstFrame: number;
|
|
81
|
-
lastFrame: number;
|
|
82
|
-
transitionDuration: number;
|
|
83
|
-
duration: number;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Signifies the various stages of a {@link Scene}'s render lifecycle.
|
|
87
|
-
*/
|
|
88
|
-
export declare enum SceneRenderEvent {
|
|
89
|
-
/**
|
|
90
|
-
* Occurs before the render starts when the Scene transitions are applied.
|
|
91
|
-
*/
|
|
92
|
-
BeforeRender = 0,
|
|
93
|
-
/**
|
|
94
|
-
* Occurs at the beginning of a render when the Scene's
|
|
95
|
-
* {@link utils.useContext} handlers are applied.
|
|
96
|
-
*/
|
|
97
|
-
BeginRender = 1,
|
|
98
|
-
/**
|
|
99
|
-
* Occurs at the end of a render when the Scene's
|
|
100
|
-
* {@link utils.useContextAfter} handlers are applied.
|
|
101
|
-
*/
|
|
102
|
-
FinishRender = 2,
|
|
103
|
-
/**
|
|
104
|
-
* Occurs after a render ends.
|
|
105
|
-
*/
|
|
106
|
-
AfterRender = 3
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* The main interface for scenes.
|
|
110
|
-
*
|
|
111
|
-
* @remarks
|
|
112
|
-
* Any class implementing this interface should have a constructor matching
|
|
113
|
-
* {@link SceneConstructor}.
|
|
114
|
-
*
|
|
115
|
-
* @typeParam T - The type of the configuration object.
|
|
116
|
-
*/
|
|
117
|
-
export interface Scene<T = unknown> {
|
|
118
|
-
/**
|
|
119
|
-
* Name of the scene.
|
|
120
|
-
*
|
|
121
|
-
* @remarks
|
|
122
|
-
* Will be passed as the second argument to the constructor.
|
|
123
|
-
*/
|
|
124
|
-
readonly name: string;
|
|
125
|
-
/**
|
|
126
|
-
* Reference to the project.
|
|
127
|
-
*/
|
|
128
|
-
readonly playback: PlaybackStatus;
|
|
129
|
-
/**
|
|
130
|
-
* @experimental
|
|
131
|
-
*/
|
|
132
|
-
readonly shaders: Shaders;
|
|
133
|
-
readonly slides: Slides;
|
|
134
|
-
readonly logger: Logger;
|
|
135
|
-
readonly variables: Variables;
|
|
136
|
-
creationStack?: string;
|
|
137
|
-
/**
|
|
138
|
-
* The frame at which this scene starts.
|
|
139
|
-
*/
|
|
140
|
-
get firstFrame(): number;
|
|
141
|
-
/**
|
|
142
|
-
* The frame at which this scene ends.
|
|
143
|
-
*/
|
|
144
|
-
get lastFrame(): number;
|
|
145
|
-
/**
|
|
146
|
-
* Triggered when the cached data changes.
|
|
147
|
-
*
|
|
148
|
-
* @eventProperty
|
|
149
|
-
*/
|
|
150
|
-
get onCacheChanged(): SubscribableValueEvent<CachedSceneData>;
|
|
151
|
-
/**
|
|
152
|
-
* Triggered when the scene is reloaded.
|
|
153
|
-
*
|
|
154
|
-
* @eventProperty
|
|
155
|
-
*/
|
|
156
|
-
get onReloaded(): SubscribableEvent<void>;
|
|
157
|
-
/**
|
|
158
|
-
* Triggered after scene is recalculated.
|
|
159
|
-
*
|
|
160
|
-
* @eventProperty
|
|
161
|
-
*/
|
|
162
|
-
get onRecalculated(): SubscribableEvent<void>;
|
|
163
|
-
/**
|
|
164
|
-
* The {@link scenes.LifecycleEvents} of this scene.
|
|
165
|
-
*/
|
|
166
|
-
get lifecycleEvents(): LifecycleEvents;
|
|
167
|
-
/**
|
|
168
|
-
* The {@link scenes.LifecycleEvents} of this scene.
|
|
169
|
-
*
|
|
170
|
-
* @deprecated Use {@link lifecycleEvents} instead.
|
|
171
|
-
*/
|
|
172
|
-
get LifecycleEvents(): LifecycleEvents;
|
|
173
|
-
/**
|
|
174
|
-
* Triggered at various stages of the render lifecycle with an event title and a Context2D.
|
|
175
|
-
*
|
|
176
|
-
* @eventProperty
|
|
177
|
-
*/
|
|
178
|
-
get onRenderLifecycle(): SubscribableEvent<[
|
|
179
|
-
SceneRenderEvent,
|
|
180
|
-
CanvasRenderingContext2D
|
|
181
|
-
]>;
|
|
182
|
-
/**
|
|
183
|
-
* Triggered when the scene is reset.
|
|
184
|
-
*
|
|
185
|
-
* @eventProperty
|
|
186
|
-
*/
|
|
187
|
-
get onReset(): SubscribableEvent<void>;
|
|
188
|
-
/**
|
|
189
|
-
* The scene directly before this scene, or null if omitted for performance.
|
|
190
|
-
*/
|
|
191
|
-
get previous(): Scene | null;
|
|
192
|
-
/**
|
|
193
|
-
* Whether experimental features are enabled.
|
|
194
|
-
*/
|
|
195
|
-
get experimentalFeatures(): boolean;
|
|
196
|
-
/**
|
|
197
|
-
* Render the scene onto a canvas.
|
|
198
|
-
*
|
|
199
|
-
* @param context - The context to used when rendering.
|
|
200
|
-
*/
|
|
201
|
-
render(context: CanvasRenderingContext2D): Promise<void>;
|
|
202
|
-
/**
|
|
203
|
-
* Reload the scene.
|
|
204
|
-
*
|
|
205
|
-
* @remarks
|
|
206
|
-
* This method is called whenever something related to this scene has changed:
|
|
207
|
-
* time events, source code, metadata, etc.
|
|
208
|
-
*
|
|
209
|
-
* Should trigger {@link onReloaded}.
|
|
210
|
-
*
|
|
211
|
-
* @param description - If present, an updated version of the description.
|
|
212
|
-
*/
|
|
213
|
-
reload(description?: SceneDescriptionReload<T>): void;
|
|
214
|
-
/**
|
|
215
|
-
* Recalculate the scene.
|
|
216
|
-
*
|
|
217
|
-
* @remarks
|
|
218
|
-
* The task of this method is to calculate new timings stored in the cache.
|
|
219
|
-
* When this method is invoked, `this.project.frame` is set to the frame at
|
|
220
|
-
* which this scene should start ({@link firstFrame}).
|
|
221
|
-
*
|
|
222
|
-
* At the end of execution, this method should set `this.project.frame` to the
|
|
223
|
-
* frame at which this scene ends ({@link lastFrame}).
|
|
224
|
-
*
|
|
225
|
-
* Should trigger {@link onRecalculated}.
|
|
226
|
-
*/
|
|
227
|
-
recalculate(setFrame: (frame: number) => void): Promise<void>;
|
|
228
|
-
/**
|
|
229
|
-
* Progress this scene one frame forward.
|
|
230
|
-
*/
|
|
231
|
-
next(): Promise<void>;
|
|
232
|
-
/**
|
|
233
|
-
* Reset this scene to its initial state.
|
|
234
|
-
*
|
|
235
|
-
* @param previous - If present, the previous scene.
|
|
236
|
-
*/
|
|
237
|
-
reset(previous?: Scene): Promise<void>;
|
|
238
|
-
/**
|
|
239
|
-
* Get the size of this scene.
|
|
240
|
-
*
|
|
241
|
-
* @remarks
|
|
242
|
-
* Usually returns `this.project.getSize()`.
|
|
243
|
-
*/
|
|
244
|
-
getSize(): Vector2;
|
|
245
|
-
/**
|
|
246
|
-
* Get the real size of this scene.
|
|
247
|
-
*
|
|
248
|
-
* @remarks
|
|
249
|
-
* Returns the size of the scene multiplied by the resolution scale.
|
|
250
|
-
* This is the actual size of the canvas onto which the scene is rendered.
|
|
251
|
-
*/
|
|
252
|
-
getRealSize(): Vector2;
|
|
253
|
-
/**
|
|
254
|
-
* Is this scene in the {@link SceneState.AfterTransitionIn} state?
|
|
255
|
-
*/
|
|
256
|
-
isAfterTransitionIn(): boolean;
|
|
257
|
-
/**
|
|
258
|
-
* Is this scene in the {@link SceneState.CanTransitionOut} state?
|
|
259
|
-
*/
|
|
260
|
-
canTransitionOut(): boolean;
|
|
261
|
-
/**
|
|
262
|
-
* Is this scene in the {@link SceneState.Finished} state?
|
|
263
|
-
*/
|
|
264
|
-
isFinished(): boolean;
|
|
265
|
-
/**
|
|
266
|
-
* Enter the {@link SceneState.Initial} state.
|
|
267
|
-
*/
|
|
268
|
-
enterInitial(): void;
|
|
269
|
-
/**
|
|
270
|
-
* Enter the {@link SceneState.AfterTransitionIn} state.
|
|
271
|
-
*/
|
|
272
|
-
enterAfterTransitionIn(): void;
|
|
273
|
-
/**
|
|
274
|
-
* Enter the {@link SceneState.CanTransitionOut} state.
|
|
275
|
-
*/
|
|
276
|
-
enterCanTransitionOut(): void;
|
|
277
|
-
/**
|
|
278
|
-
* Is this scene cached?
|
|
279
|
-
*
|
|
280
|
-
* @remarks
|
|
281
|
-
* Used only by {@link GeneratorScene}. Seeking through a project that
|
|
282
|
-
* contains at least one uncached scene will log a warning to the console.
|
|
283
|
-
*
|
|
284
|
-
* Should always return `true`.
|
|
285
|
-
*/
|
|
286
|
-
isCached(): boolean;
|
|
287
|
-
/**
|
|
288
|
-
* Get all media assets
|
|
289
|
-
*/
|
|
290
|
-
getMediaAssets(): Array<AssetInfo>;
|
|
291
|
-
stopAllMedia(): void;
|
|
292
|
-
adjustVolume(volumeScale: number): void;
|
|
293
|
-
/**
|
|
294
|
-
* Should this scene be rendered below the previous scene during a transition?
|
|
295
|
-
*/
|
|
296
|
-
previousOnTop: SignalValue<boolean>;
|
|
297
|
-
}
|
|
298
|
-
//# sourceMappingURL=Scene.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Scene.d.ts","sourceRoot":"","sources":["../../src/scenes/Scene.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,MAAM,EACN,cAAc,EACd,kBAAkB,EACnB,MAAM,QAAQ,CAAC;AAChB,OAAO,KAAK,EAAC,iBAAiB,EAAE,sBAAsB,EAAC,MAAM,WAAW,CAAC;AACzE,OAA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IAErB;;OAEG;IACH,sBAAsB,IAAI,IAAI,CAAC;IAE/B;;OAEG;IACH,qBAAqB,IAAI,IAAI,CAAC;IAE9B;;;;;;;;OAQG;IACH,QAAQ,IAAI,OAAO,CAAC;IAEpB;;OAEG;IACH,cAAc,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC;IAEnC,YAAY,IAAI,IAAI,CAAC;IAErB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAExC;;OAEG;IACH,aAAa,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CACrC"}
|
package/lib/scenes/Scene.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Signifies the various stages of a {@link Scene}'s render lifecycle.
|
|
3
|
-
*/
|
|
4
|
-
export var SceneRenderEvent;
|
|
5
|
-
(function (SceneRenderEvent) {
|
|
6
|
-
/**
|
|
7
|
-
* Occurs before the render starts when the Scene transitions are applied.
|
|
8
|
-
*/
|
|
9
|
-
SceneRenderEvent[SceneRenderEvent["BeforeRender"] = 0] = "BeforeRender";
|
|
10
|
-
/**
|
|
11
|
-
* Occurs at the beginning of a render when the Scene's
|
|
12
|
-
* {@link utils.useContext} handlers are applied.
|
|
13
|
-
*/
|
|
14
|
-
SceneRenderEvent[SceneRenderEvent["BeginRender"] = 1] = "BeginRender";
|
|
15
|
-
/**
|
|
16
|
-
* Occurs at the end of a render when the Scene's
|
|
17
|
-
* {@link utils.useContextAfter} handlers are applied.
|
|
18
|
-
*/
|
|
19
|
-
SceneRenderEvent[SceneRenderEvent["FinishRender"] = 2] = "FinishRender";
|
|
20
|
-
/**
|
|
21
|
-
* Occurs after a render ends.
|
|
22
|
-
*/
|
|
23
|
-
SceneRenderEvent[SceneRenderEvent["AfterRender"] = 3] = "AfterRender";
|
|
24
|
-
})(SceneRenderEvent || (SceneRenderEvent = {}));
|
|
25
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU2NlbmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvc2NlbmVzL1NjZW5lLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWlHQTs7R0FFRztBQUNILE1BQU0sQ0FBTixJQUFZLGdCQW1CWDtBQW5CRCxXQUFZLGdCQUFnQjtJQUMxQjs7T0FFRztJQUNILHVFQUFZLENBQUE7SUFDWjs7O09BR0c7SUFDSCxxRUFBVyxDQUFBO0lBQ1g7OztPQUdHO0lBQ0gsdUVBQVksQ0FBQTtJQUNaOztPQUVHO0lBQ0gscUVBQVcsQ0FBQTtBQUNiLENBQUMsRUFuQlcsZ0JBQWdCLEtBQWhCLGdCQUFnQixRQW1CM0IifQ==
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Describes the state of a scene.
|
|
3
|
-
*/
|
|
4
|
-
export declare enum SceneState {
|
|
5
|
-
/**
|
|
6
|
-
* The scene has just been created/reset.
|
|
7
|
-
*/
|
|
8
|
-
Initial = 0,
|
|
9
|
-
/**
|
|
10
|
-
* The scene has finished transitioning in.
|
|
11
|
-
*
|
|
12
|
-
* @remarks
|
|
13
|
-
* Informs the Project that the previous scene is no longer necessary and can
|
|
14
|
-
* be disposed of.
|
|
15
|
-
*/
|
|
16
|
-
AfterTransitionIn = 1,
|
|
17
|
-
/**
|
|
18
|
-
* The scene is ready to transition out.
|
|
19
|
-
*
|
|
20
|
-
* @remarks
|
|
21
|
-
* Informs the project that the next scene can begin.
|
|
22
|
-
* The {@link Scene.next} method will still be invoked until the next scene
|
|
23
|
-
* enters {@link AfterTransitionIn}.
|
|
24
|
-
*/
|
|
25
|
-
CanTransitionOut = 2,
|
|
26
|
-
/**
|
|
27
|
-
* The scene has finished.
|
|
28
|
-
*
|
|
29
|
-
* @remarks
|
|
30
|
-
* Invoking {@link Scene.next} won't have any effect.
|
|
31
|
-
*/
|
|
32
|
-
Finished = 3
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=SceneState.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SceneState.d.ts","sourceRoot":"","sources":["../../src/scenes/SceneState.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,UAAU;IACpB;;OAEG;IACH,OAAO,IAAA;IAEP;;;;;;OAMG;IACH,iBAAiB,IAAA;IAEjB;;;;;;;OAOG;IACH,gBAAgB,IAAA;IAEhB;;;;;OAKG;IACH,QAAQ,IAAA;CACT"}
|
package/lib/scenes/SceneState.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Describes the state of a scene.
|
|
3
|
-
*/
|
|
4
|
-
export var SceneState;
|
|
5
|
-
(function (SceneState) {
|
|
6
|
-
/**
|
|
7
|
-
* The scene has just been created/reset.
|
|
8
|
-
*/
|
|
9
|
-
SceneState[SceneState["Initial"] = 0] = "Initial";
|
|
10
|
-
/**
|
|
11
|
-
* The scene has finished transitioning in.
|
|
12
|
-
*
|
|
13
|
-
* @remarks
|
|
14
|
-
* Informs the Project that the previous scene is no longer necessary and can
|
|
15
|
-
* be disposed of.
|
|
16
|
-
*/
|
|
17
|
-
SceneState[SceneState["AfterTransitionIn"] = 1] = "AfterTransitionIn";
|
|
18
|
-
/**
|
|
19
|
-
* The scene is ready to transition out.
|
|
20
|
-
*
|
|
21
|
-
* @remarks
|
|
22
|
-
* Informs the project that the next scene can begin.
|
|
23
|
-
* The {@link Scene.next} method will still be invoked until the next scene
|
|
24
|
-
* enters {@link AfterTransitionIn}.
|
|
25
|
-
*/
|
|
26
|
-
SceneState[SceneState["CanTransitionOut"] = 2] = "CanTransitionOut";
|
|
27
|
-
/**
|
|
28
|
-
* The scene has finished.
|
|
29
|
-
*
|
|
30
|
-
* @remarks
|
|
31
|
-
* Invoking {@link Scene.next} won't have any effect.
|
|
32
|
-
*/
|
|
33
|
-
SceneState[SceneState["Finished"] = 3] = "Finished";
|
|
34
|
-
})(SceneState || (SceneState = {}));
|
|
35
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU2NlbmVTdGF0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zY2VuZXMvU2NlbmVTdGF0ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUNILE1BQU0sQ0FBTixJQUFZLFVBZ0NYO0FBaENELFdBQVksVUFBVTtJQUNwQjs7T0FFRztJQUNILGlEQUFPLENBQUE7SUFFUDs7Ozs7O09BTUc7SUFDSCxxRUFBaUIsQ0FBQTtJQUVqQjs7Ozs7OztPQU9HO0lBQ0gsbUVBQWdCLENBQUE7SUFFaEI7Ozs7O09BS0c7SUFDSCxtREFBUSxDQUFBO0FBQ1YsQ0FBQyxFQWhDVyxVQUFVLEtBQVYsVUFBVSxRQWdDckIifQ==
|
package/lib/scenes/Shaders.d.ts
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import type { SharedWebGLContext, WebGLContextOwner } from '../app/SharedWebGLContext';
|
|
2
|
-
import type { Scene } from './Scene';
|
|
3
|
-
/**
|
|
4
|
-
* @internal
|
|
5
|
-
*/
|
|
6
|
-
export declare const UNIFORM_RESOLUTION = "resolution";
|
|
7
|
-
/**
|
|
8
|
-
* @internal
|
|
9
|
-
*/
|
|
10
|
-
export declare const UNIFORM_DESTINATION_TEXTURE = "destinationTexture";
|
|
11
|
-
/**
|
|
12
|
-
* @internal
|
|
13
|
-
*/
|
|
14
|
-
export declare const UNIFORM_SOURCE_TEXTURE = "sourceTexture";
|
|
15
|
-
/**
|
|
16
|
-
* @internal
|
|
17
|
-
*/
|
|
18
|
-
export declare const UNIFORM_TIME = "time";
|
|
19
|
-
/**
|
|
20
|
-
* @internal
|
|
21
|
-
*/
|
|
22
|
-
export declare const UNIFORM_DELTA_TIME = "deltaTime";
|
|
23
|
-
/**
|
|
24
|
-
* @internal
|
|
25
|
-
*/
|
|
26
|
-
export declare const UNIFORM_FRAMERATE = "framerate";
|
|
27
|
-
/**
|
|
28
|
-
* @internal
|
|
29
|
-
*/
|
|
30
|
-
export declare const UNIFORM_FRAME = "frame";
|
|
31
|
-
/**
|
|
32
|
-
* @internal
|
|
33
|
-
*/
|
|
34
|
-
export declare const UNIFORM_SOURCE_MATRIX = "sourceMatrix";
|
|
35
|
-
/**
|
|
36
|
-
* @internal
|
|
37
|
-
*/
|
|
38
|
-
export declare const UNIFORM_DESTINATION_MATRIX = "destinationMatrix";
|
|
39
|
-
/**
|
|
40
|
-
* @internal
|
|
41
|
-
*/
|
|
42
|
-
export declare class Shaders implements WebGLContextOwner {
|
|
43
|
-
private readonly scene;
|
|
44
|
-
private readonly sharedContext;
|
|
45
|
-
private gl;
|
|
46
|
-
private positionBuffer;
|
|
47
|
-
private sourceTexture;
|
|
48
|
-
private destinationTexture;
|
|
49
|
-
private positionLocation;
|
|
50
|
-
private readonly quadPositions;
|
|
51
|
-
constructor(scene: Scene, sharedContext: SharedWebGLContext);
|
|
52
|
-
setup(gl: WebGL2RenderingContext): void;
|
|
53
|
-
teardown(gl: WebGL2RenderingContext): void;
|
|
54
|
-
private handleReload;
|
|
55
|
-
private updateViewport;
|
|
56
|
-
getGL(): WebGL2RenderingContext;
|
|
57
|
-
getProgram(fragment: string): WebGLProgram | null;
|
|
58
|
-
copyTextures(destination: TexImageSource, source: TexImageSource): void;
|
|
59
|
-
clear(): void;
|
|
60
|
-
render(): void;
|
|
61
|
-
private copyTexture;
|
|
62
|
-
}
|
|
63
|
-
//# sourceMappingURL=Shaders.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Shaders.d.ts","sourceRoot":"","sources":["../../src/scenes/Shaders.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,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