Implement dedicated handling for trigger volumes and adjust camera rig scaling for NPCs
This commit is contained in:
@@ -6040,7 +6040,6 @@ export class ViewportHost {
|
|||||||
switch (entity.kind) {
|
switch (entity.kind) {
|
||||||
case "pointLight":
|
case "pointLight":
|
||||||
case "soundEmitter":
|
case "soundEmitter":
|
||||||
case "triggerVolume":
|
|
||||||
case "interactable":
|
case "interactable":
|
||||||
renderObjects.group.position.set(
|
renderObjects.group.position.set(
|
||||||
entity.position.x,
|
entity.position.x,
|
||||||
@@ -6049,7 +6048,29 @@ export class ViewportHost {
|
|||||||
);
|
);
|
||||||
renderObjects.group.rotation.set(0, 0, 0);
|
renderObjects.group.rotation.set(0, 0, 0);
|
||||||
renderObjects.group.quaternion.identity();
|
renderObjects.group.quaternion.identity();
|
||||||
|
renderObjects.group.scale.set(1, 1, 1);
|
||||||
break;
|
break;
|
||||||
|
case "triggerVolume": {
|
||||||
|
const baseSize = renderObjects.group.userData.triggerVolumeSize as
|
||||||
|
| Vec3
|
||||||
|
| undefined;
|
||||||
|
renderObjects.group.position.set(
|
||||||
|
entity.position.x,
|
||||||
|
entity.position.y,
|
||||||
|
entity.position.z
|
||||||
|
);
|
||||||
|
renderObjects.group.rotation.set(
|
||||||
|
(entity.rotationDegrees.x * Math.PI) / 180,
|
||||||
|
(entity.rotationDegrees.y * Math.PI) / 180,
|
||||||
|
(entity.rotationDegrees.z * Math.PI) / 180
|
||||||
|
);
|
||||||
|
renderObjects.group.scale.set(
|
||||||
|
baseSize === undefined ? 1 : entity.size.x / baseSize.x,
|
||||||
|
baseSize === undefined ? 1 : entity.size.y / baseSize.y,
|
||||||
|
baseSize === undefined ? 1 : entity.size.z / baseSize.z
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case "cameraRig":
|
case "cameraRig":
|
||||||
this.applyCameraRigGroupTransform(
|
this.applyCameraRigGroupTransform(
|
||||||
renderObjects.group,
|
renderObjects.group,
|
||||||
@@ -6078,6 +6099,11 @@ export class ViewportHost {
|
|||||||
(entity.yawDegrees * Math.PI) / 180,
|
(entity.yawDegrees * Math.PI) / 180,
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
|
renderObjects.group.scale.set(
|
||||||
|
entity.kind === "npc" ? entity.scale.x : 1,
|
||||||
|
entity.kind === "npc" ? entity.scale.y : 1,
|
||||||
|
entity.kind === "npc" ? entity.scale.z : 1
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user