mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 03:59:50 +02:00
Merge pull request #235 from karelpak1/fix-child-node-position
fix: position of child nodes
This commit is contained in:
1 file changed
+6
-2
@@ -170,8 +170,12 @@ export async function extractModel(vfs: AbstractVFS, path: string) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case "TransformComponent": {
|
case "TransformComponent": {
|
||||||
component["tc.localTranslation"] = [0, 0, 0]; // Game when is loading model resets position to [0, 0, 0], so any set value is ignored.
|
const localTranslation = component["tc.localTranslation"];
|
||||||
node.setTranslation(component["tc.localTranslation"]);
|
// The game resets top-level node translation to [0, 0, 0] on load.
|
||||||
|
// Child nodes must keep their authored local offsets.
|
||||||
|
node.setTranslation(
|
||||||
|
parent instanceof Scene ? [0, 0, 0] : localTranslation,
|
||||||
|
);
|
||||||
node.setRotation(component["tc.localRotation"]);
|
node.setRotation(component["tc.localRotation"]);
|
||||||
node.setScale(component["tc.localScale"]);
|
node.setScale(component["tc.localScale"]);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user