Skip to content

Commit

Permalink
Fix support for newer TS versions and update depends (bridge-core#4)
Browse files Browse the repository at this point in the history
* Update package.json for new TS versions

* Update package.json URLs

* Update depends

* Export schema

* Mark scene and controls as accessible but read only

* Update wintersky

* Update package.json for consistent capitalization

---------

Co-authored-by: Liam Hanrahan <[email protected]>
  • Loading branch information
rtm516 and outercloudstudio authored Apr 30, 2024
1 parent 3123302 commit 2e65efc
Show file tree
Hide file tree
Showing 8 changed files with 1,251 additions and 1,468 deletions.
4 changes: 2 additions & 2 deletions dist/Animations/Animation.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MoLang } from 'molang';
import { Molang } from 'molang';
import { ISingleAnimation, TBoneModifier } from '../Schema/Animation';
import { SoundEffect } from './SoundEffect';
import { ParticleEffect } from './ParticleEffect';
Expand All @@ -14,7 +14,7 @@ export declare class Animation {
'query.delta_time': () => number;
'query.life_time': () => number;
};
protected molang: MoLang;
protected molang: Molang;
protected soundEffects: SoundEffect;
protected particleEffects: ParticleEffect;
constructor(animator: Animator, animationData: ISingleAnimation);
Expand Down
6 changes: 4 additions & 2 deletions dist/main.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls';
import { Model } from './Model';
import { IGeoSchema } from './Schema/Model';
export { Model } from './Model';
export * from './Schema/Model';
export * from './Schema/Animation';
export interface IOptions {
antialias?: boolean;
width?: number;
Expand All @@ -14,10 +16,10 @@ export declare class StandaloneModelViewer {
protected options: IOptions;
protected renderer: WebGLRenderer;
protected model: Model;
protected scene: Scene;
readonly scene: Scene;
protected camera: PerspectiveCamera;
protected renderingRequested: boolean;
protected controls: OrbitControls;
readonly controls: OrbitControls;
readonly loadedModel: Promise<void>;
constructor(canvasElement: HTMLCanvasElement, modelData: IGeoSchema, texturePath: string, options: IOptions);
protected loadModel(): Promise<void>;
Expand Down
1,714 changes: 667 additions & 1,047 deletions dist/model-viewer.es.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/model-viewer.umd.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions lib/Animations/Animation.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MoLang } from 'molang'
import { Molang } from 'molang'
import {
ISingleAnimation,
TBoneModifier,
Expand All @@ -18,7 +18,7 @@ export class Animation {
'query.delta_time': () => this.startTimestamp - this.lastFrameTimestamp,
'query.life_time': () => this.currentTime,
}
protected molang = new MoLang(this.env, {
protected molang = new Molang(this.env, {
convertUndefined: true,
})
protected soundEffects: SoundEffect
Expand Down Expand Up @@ -157,7 +157,7 @@ export class Animation {
.map((n) => MathUtils.degToRad(n))
.map(
(val, i) =>
currentRotation[i] + (i === 2 ? val : -val)
(currentRotation[i] as number) + (i === 2 ? val : -val)
) as [number, number, number])
)
}
Expand Down
7 changes: 5 additions & 2 deletions lib/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ import { IGeoSchema } from './Schema/Model'

export { Model } from './Model'

export * from './Schema/Model'
export * from './Schema/Animation'

export interface IOptions {
alpha?: boolean
antialias?: boolean
Expand All @@ -26,10 +29,10 @@ export interface IOptions {
export class StandaloneModelViewer {
protected renderer: WebGLRenderer
protected model: Model
protected scene: Scene
public readonly scene: Scene
protected camera: PerspectiveCamera
protected renderingRequested = false
protected controls: OrbitControls
public readonly controls: OrbitControls
public readonly loadedModel: Promise<void>

constructor(
Expand Down
Loading

0 comments on commit 2e65efc

Please sign in to comment.