Bombadilo101

Members
  • Content Count

    4
  • Joined

  • Last visited

  1. strange... seems there's no velocity check after all. Not sure if they took it out or renamed it, but I ended up going with this: var zCheck = truevar veloZ = PC.absolutePosition.z; scene.registerBeforeRender(function(){ if (Math.abs(PC.absolutePosition.z - veloZ) > 10) { zCheck = false } else { zCheck = true } veloZ = PC.absolutePosition.z}); not pretty, but it seems to work. I feel like there's got to be an easier way though. What's a physics engine without a built in velocity checker. Also I'm not certain whether renders are over a variable length of time or not so my checker could be seriously flawed. just a z-axis check for the moment, still deciding whether to go with a 2-d or 3-d speedcheck in order to limit max impulse.
  2. Is there some built in way to find the velocity of an object? Was hoping to build in a maximum velocity and variable impulse for my spaceship game but was having trouble finding out whether or not an object was moving in space. Currently using cannon.js for the physics engine. Apparently if you use cannon with Three.js you can just do object.velocity.y or object.velocity.norm() but it doesn't seem to work in babylon.
  3. I was not, problem was fixed.
  4. So... I've been trying for days now to get modules to play nice with babylon.js, thus far without success. babelify, webpack, browserify, nothing seems to be working. Can anyone give me a hint on how to properly package it so that it actually functions? The current error I'm running into (and there have been dozens of various errors from the various attempts) is that BABYLON is not defined. require ('./babylon.js');var createScene = require ('./Sub_Scene1.js'); console.log('1');window.addEventListener('DOMContentLoaded', function(){ var canvas = document.getElementById('renderCanvas');var engine = new BABYLON.Engine(canvas, true); console.log('2'); var scene = createScene;engine.runRenderLoop(function(){scene.render();}); window.addEventListener('resize', function() {engine.resize();});});console.log('3');