Update version references and refactor collider generation logic
This commit is contained in:
@@ -1489,7 +1489,7 @@ export function migrateSceneDocument(source: unknown): SceneDocument {
|
||||
const assets = readAssets(source.assets);
|
||||
|
||||
return {
|
||||
version: ENTITY_NAMES_SCENE_DOCUMENT_VERSION,
|
||||
version: SCENE_DOCUMENT_VERSION,
|
||||
name: expectString(source.name, "name"),
|
||||
world: readWorldSettings(source.world),
|
||||
materials,
|
||||
|
||||
@@ -6,7 +6,6 @@ import {
|
||||
Mesh,
|
||||
Quaternion,
|
||||
Vector3,
|
||||
type BufferAttribute,
|
||||
type BufferGeometry
|
||||
} from "three";
|
||||
|
||||
@@ -206,7 +205,13 @@ function computeWorldBoundsFromLocalBox(localBounds: GeneratedColliderBounds, mo
|
||||
return computeBoundsFromPoints(corners.map((corner) => corner.applyMatrix4(modelMatrix)));
|
||||
}
|
||||
|
||||
function readIndexedVertex(position: BufferAttribute, index: number, matrix: Matrix4): Vector3 {
|
||||
interface PositionLikeAttribute {
|
||||
getX(index: number): number;
|
||||
getY(index: number): number;
|
||||
getZ(index: number): number;
|
||||
}
|
||||
|
||||
function readIndexedVertex(position: PositionLikeAttribute, index: number, matrix: Matrix4): Vector3 {
|
||||
return new Vector3(position.getX(index), position.getY(index), position.getZ(index)).applyMatrix4(matrix);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import RAPIER from "@dimforge/rapier3d-compat";
|
||||
import { Euler, MathUtils, Quaternion, Vector3 } from "three";
|
||||
import { Euler, MathUtils, Quaternion } from "three";
|
||||
|
||||
import type { Vec3 } from "../core/vector";
|
||||
import type {
|
||||
@@ -18,14 +18,6 @@ const COLLISION_EPSILON = 1e-5;
|
||||
|
||||
let rapierInitPromise: Promise<typeof RAPIER> | null = null;
|
||||
|
||||
function cloneVec3(vector: Vec3): Vec3 {
|
||||
return {
|
||||
x: vector.x,
|
||||
y: vector.y,
|
||||
z: vector.z
|
||||
};
|
||||
}
|
||||
|
||||
function componentScale(vector: Vec3, scale: Vec3): Vec3 {
|
||||
return {
|
||||
x: vector.x * scale.x,
|
||||
|
||||
@@ -510,7 +510,11 @@ export class RuntimeHost {
|
||||
name: modelInstance.name,
|
||||
position: modelInstance.position,
|
||||
rotationDegrees: modelInstance.rotationDegrees,
|
||||
scale: modelInstance.scale
|
||||
scale: modelInstance.scale,
|
||||
collision: {
|
||||
mode: "none",
|
||||
visible: false
|
||||
}
|
||||
},
|
||||
asset,
|
||||
loadedAsset,
|
||||
|
||||
Reference in New Issue
Block a user