@pmndrs/viverse 0.1.12 → 0.1.14

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.
@@ -6,8 +6,8 @@ export declare class BvhPhysicsWorld {
6
6
  * @deprecated use addBody(object, false) instead
7
7
  */
8
8
  addFixedBody(object: Object3D): void;
9
- addBody(object: Object3D, dynamic: boolean): void;
10
- removeFixedBody(object: Object3D): void;
9
+ addBody(object: Object3D, kinematic: boolean): void;
10
+ removeBody(object: Object3D): void;
11
11
  private computeMatrix;
12
12
  shapecast(intersectsBounds: (box: Box3) => boolean, intersectsTriangle: (triangle: ExtendedTriangle) => void): void;
13
13
  raycast(ray: Ray, far: number): number | undefined;
@@ -13,17 +13,17 @@ export class BvhPhysicsWorld {
13
13
  addFixedBody(object) {
14
14
  this.addBody(object, false);
15
15
  }
16
- addBody(object, dynamic) {
16
+ addBody(object, kinematic) {
17
17
  object.updateWorldMatrix(true, true);
18
18
  if (!(object instanceof InstancedMesh)) {
19
19
  const parent = object.parent;
20
- if (dynamic) {
20
+ if (kinematic) {
21
21
  object.parent = null;
22
22
  object.updateMatrixWorld(true);
23
23
  }
24
24
  const geometry = new StaticGeometryGenerator(object).generate();
25
- this.map.push({ object, bvh: computeBoundsTree.apply(geometry), dynamic });
26
- if (dynamic) {
25
+ this.map.push({ object, bvh: computeBoundsTree.apply(geometry), kinematic });
26
+ if (kinematic) {
27
27
  object.parent = parent;
28
28
  object.updateMatrixWorld(true);
29
29
  }
@@ -38,15 +38,15 @@ export class BvhPhysicsWorld {
38
38
  object,
39
39
  bvh,
40
40
  instanceIndex: i,
41
- dynamic,
41
+ kinematic,
42
42
  });
43
43
  }
44
44
  }
45
- removeFixedBody(object) {
45
+ removeBody(object) {
46
46
  this.map = this.map.filter((entry) => entry.object != object);
47
47
  }
48
- computeMatrix({ dynamic, object, instanceIndex }, target) {
49
- if (!dynamic && instanceIndex == null) {
48
+ computeMatrix({ kinematic, object, instanceIndex }, target) {
49
+ if (!kinematic && instanceIndex == null) {
50
50
  return false;
51
51
  }
52
52
  if (instanceIndex == null) {
@@ -1,5 +1,5 @@
1
1
  import { VRM, VRMUtils } from '@pixiv/three-vrm';
2
- import { action, animationFinished, build, timePassed, forever, parallel, graph, } from '@pmndrs/timeline';
2
+ import { action, animationFinished, start, timePassed, forever, parallel, graph, } from '@pmndrs/timeline';
3
3
  import { AnimationMixer, Euler, Group, LoopOnce, Quaternion, Vector3, } from 'three';
4
4
  import { simpleCharacterAnimationNames, getSimpleCharacterModelAnimationOptions as getSimpleCharacterModelAnimationOptions, loadCharacterModelAnimation as loadCharacterModelAnimation, } from './animation/index.js';
5
5
  import { SimpleCharacterCameraBehavior } from './camera.js';
@@ -310,7 +310,7 @@ export class SimpleCharacter extends Group {
310
310
  this.actions.jumpForward.loop = LoopOnce;
311
311
  this.actions.jumpForward.clampWhenFinished = true;
312
312
  }
313
- this.updateTimeline = build(SimpleCharacterTimeline(camera, this));
313
+ this.updateTimeline = start(SimpleCharacterTimeline(camera, this));
314
314
  this.dispatchEvent({ type: 'loaded' });
315
315
  }
316
316
  update(delta) {
package/package.json CHANGED
@@ -21,12 +21,12 @@
21
21
  "peerDependencies": {
22
22
  "three": "*"
23
23
  },
24
- "version": "0.1.12",
24
+ "version": "0.1.14",
25
25
  "type": "module",
26
26
  "dependencies": {
27
27
  "@pixiv/three-vrm": "^3.4.2",
28
28
  "@pixiv/three-vrm-animation": "^3.4.2",
29
- "@pmndrs/timeline": "^0.1.10",
29
+ "@pmndrs/timeline": "^0.1.15",
30
30
  "@viverse/sdk": "1.2.10-alpha.0",
31
31
  "three-mesh-bvh": "^0.9.1"
32
32
  },