feat: add joystick movement with character animations, add smooth camera behaviour with look-ahead effect

This commit is contained in:
Mykyta Slobodianiuk
2026-06-03 13:07:26 +03:00
parent 0003919f4c
commit 0b469df12c
8 changed files with 272 additions and 48 deletions
+1 -18
View File
@@ -1,7 +1,6 @@
import {
CameraC_internal,
CameraType,
// JoystickC,
Physics_internal,
Template,
Template3d,
@@ -24,23 +23,7 @@ export const beforeResourcesLoadedCb = () => {
ThreeC.createBaseLights();
ThreeC.setupDirectionalLight();
let physicsWorld = Physics_internal.init(new Vec3(0, -9.81, 0));
// example of using joystick. Uncomment if you need joystick
// JoystickC.init({
// zone: document.getElementById("joystick_zone") as HTMLDivElement,
// fadeTime: 0,
// mode: "dynamic",
// restJoystick: true,
// catchDistance: 1,
// restOpacity: 0,
// follow: false,
// });
// JoystickC.onJoysticMove.addDelegate(({event, data}) => {
// console.log('onJoysticMove', event, data);
// })
Physics_internal.init(new Vec3(0, -9.81, 0));
Template.updateVariableConfig.addDelegate(([category, variable, value]) => {
if (category === "global") {