From c6f8c1e6a5202944bfd87a58701786af8e3938c4 Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Sat, 13 Jun 2026 21:13:33 -0500 Subject: [PATCH] lighting and correct rotation ZY swap --- packages/game/Models/MonoGltf.cs | 7 ++++++- .../src/components/TankopediaLighting.tsx | 2 +- .../src/components/TankopediaSandbox/index.tsx | 7 ++----- .../src/components/TankopediaSceneProps.tsx | 16 ++++++++++++++++ 4 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 packages/website-ue/src/components/TankopediaSceneProps.tsx diff --git a/packages/game/Models/MonoGltf.cs b/packages/game/Models/MonoGltf.cs index 3f175e401..adb4d699f 100644 --- a/packages/game/Models/MonoGltf.cs +++ b/packages/game/Models/MonoGltf.cs @@ -86,7 +86,7 @@ public class MonoGltf if (transform.TryGet("Rotation", out var rotation)) { - parent.WithLocalRotation(rotation); + parent.WithLocalRotation(SwapYZ(rotation)); } if (transform.TryGet("Translation", out var translation)) @@ -279,6 +279,11 @@ public class MonoGltf return res; } + public static Quaternion SwapYZ(Quaternion q) + { + return Quaternion.Normalize(new Quaternion(q.X, q.Z, q.Y, -q.W)); + } + public static FVector SwapYZAndNormalize(FVector vec) { var res = SwapYZ(vec); diff --git a/packages/website-ue/src/components/TankopediaLighting.tsx b/packages/website-ue/src/components/TankopediaLighting.tsx index 5438dbbd0..bd08ff2b2 100644 --- a/packages/website-ue/src/components/TankopediaLighting.tsx +++ b/packages/website-ue/src/components/TankopediaLighting.tsx @@ -9,7 +9,7 @@ const THETA_OFFSET = degToRad(-152); const LIGHT_DISTANCE = 13; const LIGHT_HEIGHT_0 = 4; const LIGHT_HEIGHT_1 = 2; -const INTENSITY_0 = 3.5; +const INTENSITY_0 = 2.5; const INTENSITY_1 = 1.5; const HEMISPHERE_INTENSITY = 2; diff --git a/packages/website-ue/src/components/TankopediaSandbox/index.tsx b/packages/website-ue/src/components/TankopediaSandbox/index.tsx index b1195dc19..cfde0340a 100644 --- a/packages/website-ue/src/components/TankopediaSandbox/index.tsx +++ b/packages/website-ue/src/components/TankopediaSandbox/index.tsx @@ -6,6 +6,7 @@ import { useTankGunModel } from "../../hooks/useTankGunModel"; import { useTankHullModel } from "../../hooks/useTankHullModel"; import { useTankTurretModel } from "../../hooks/useTankTurretModel"; import { TankopediaLighting } from "../TankopediaLighting"; +import { SceneProps } from "../TankopediaSceneProps"; import styles from "./index.module.css"; interface TankopediaSandboxProps { @@ -51,11 +52,7 @@ function Content({ parameters }: TankopediaSandboxProps) { - - - - - + diff --git a/packages/website-ue/src/components/TankopediaSceneProps.tsx b/packages/website-ue/src/components/TankopediaSceneProps.tsx new file mode 100644 index 000000000..98aca917e --- /dev/null +++ b/packages/website-ue/src/components/TankopediaSceneProps.tsx @@ -0,0 +1,16 @@ +const SIZE = 2 ** 6; + +export function SceneProps() { + return ( + + + + + ); +}