Skip to content

Commit

Permalink
Update three-scene.js
Browse files Browse the repository at this point in the history
  • Loading branch information
davespser authored Dec 10, 2024
1 parent 7179616 commit a9a1ec8
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions js/three-scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ import * as THREE from "three";
import { GLTFLoader } from "three/addons/loaders/GLTFLoader.js";
import { TerrainMesh } from "../js/terrain2/TerrainMesh.js";
import { createMenu, createJoypad, createStats } from "./ui.js";
import Ammo from "ammo";

Ammo().then((AmmoLib) => {
// Código usando Ammo.js
console.log("Ammo.js inicializado", AmmoLib);
});
// Asegúrate de que Ammo se carga correctamente
if (typeof Ammo === "undefined") {
console.error("Ammo.js no se ha cargado correctamente. Verifica tu importmap o la conexión con la CDN.");
} else {
Ammo().then((AmmoLib) => {
// Código usando Ammo.js
console.log("Ammo.js inicializado", AmmoLib);
let scene, camera, renderer, cube, robot, light, mixer, physicsWorld, transform, cubeBody;
let speed = 0.02; // Velocidad inicial
let cameraOffset = new THREE.Vector3(0, 5, 10); // Offset de la cámara detrás del cubo
Expand Down

0 comments on commit a9a1ec8

Please sign in to comment.