JackFalcon

Members
  • Content Count

    416
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by JackFalcon

  1. @Wingnut phenomenal. Same page. Info is spot on. Thanks for insights. Can run new experiments off link: // kill all positional movement sphere.physicsImpostor.setLinearVelocity(new BABYLON.Vector3(0,0,0)); // kill all rotational movement sphere.physicsImpostor.setAngularVelocity(new BABYLON.Vector3(0,0,0)); // kill the pad rotation with by 'newing' its .rotationQuaternion. Goofy, but needed. ground.rotationQuaternion = new BABYLON.Quaternion(); Cheers,
  2. Yes, very helpful... I didn't know about Playground Search. +1. I will use it. Still trying to get habit to craft playgrounds. Backward incompatible deprecations -> make sense. (thank you for confirming). No inconvenience. Comes with the territory. I am almost at compound impostors. Love the details. Current status converting to cannon from checkCollisions=true. Tricky physics tango: need to switch gravity (with cannon) around a cube, got that working, however need similar behavior of moveWithCollisions() with cannon .... looking into that. i.e. character falls over... and spins like a top. : ) Your updates are gr8. MeshBuilder, parenting, and volumetric light scattering... are very helpful for people to catch up... And, found that ghost. Wow, unexpected... constructor override (my best guess/without looking). ... Cheers,
  3. Hi @Wingnut, and every1, great work. I'm following through the steps above, very helpful. I trace steps, and something came up... in the playground links, Seems related to the state-of-the-playground recently. I'm curious what it is. Some of them work and some seem to have versioning error messages? Clear cache (seemed) to have no effect in my case (and I do not understand what might be missing, or what to look for, etc). Issue Description: Playground links (above): Control Test -> this link works: http://playground.babylonjs.com/#10JNZ8#1 But this link has some issue, http://playground.babylonjs.com/#1VITPM#29 -> it gives a good clue: Line 106:26 - wheel1.setPhysicsState is not a functionine 106:26 - wheel1.setPhysicsState is not a function setPhysicsState missing? Is this a Playground versioning issue .... cannon versions or Caching? I don't understand. -> scratches head.. Do you know the fix? Last example: createCompoundImpostor not a function: http://playground.babylonjs.com/#1VITPM#25 Did something change? Thanksmuch, gr8workgents. Line 53:26 - wheel1.setPhysicsState is not a function
  4. Yep that worked. Piece of cake. Here was the solution: onKeyDown = function(e) { switch (e) { case 'touchLeft': movekeys.left=1; ... function animateMovement(){ if(movekeys.left){ sceneFollowCamera.alpha -= 0.05 ; } ... } scene.beforeRender = function () { animateMovement(); }
  5. @Weirdo Nice1. Yes smoothing is needed. It is like an airplane so the jump was visible.... I'll put it under a key flag and drop into beforeRender and post back results for others. Thanks for the tip.
  6. Nice @aWeirdo, exactly what I was looking for. That should do the trick. Thanks.
  7. Hello all, BJS is great. Question: What is the best way to add DOM buttons, for tablet touch, to mimic the left and right arrow keys that control arc rotate camera following a target? Or, how can dom buttons control arc rotate camera (left/right)? Is there an Action Manager action event or something? Digging around, not finding it, hopefully this will help others, looking for the best solution. Here is the context: engine.runRenderLoop(function(){ scene.render(); if(scene.isReady()){ cameraFollowTarget(simpleMesh); //camera positioning call. } }); cameraFollowTarget = function(target){ var rotationControl = -45.5 // -45.5 is backfacing, target.rotation.y = rotationControl - sceneFollowCamera.alpha; sceneFollowCamera.target.x = parseFloat(target.position.x); sceneFollowCamera.target.z = parseFloat(target.position.z); sceneFollowCamera.target.y = parseFloat(target.position.y+2); } //init of sceneFollowCamera ArcRotateCamera... createCameraSets = function (){ //CameraParams: name, alpha, beta, radius, target, scene. sceneFollowCamera = new BABYLON.ArcRotateCamera("CameraBaseRotate", -Math.PI/2, (Math.PI/2.2) - 0.4, 50, new BABYLON.Vector3(0, 5.0, 0), scene); // <------ sceneFollowCamera.wheelPrecision = 15; sceneFollowCamera.lowerRadiusLimit = 2; //zoominandout sceneFollowCamera.upperRadiusLimit = 2222; sceneFollowCamera.upperBetaLimit = 1.3;//1; sceneFollowCamera.beta = 1.5; sceneFollowCamera.radius = 15; //distance camera is from target. scene.activeCamera = sceneFollowCamera; <---- sceneFollowCamera.attachControl(canvas); <---- } //Connected DOM button to onKey handler, which animates Mesh, but it does not mimic arrow key rotation of mesh and camera: keyDown = function(e) { switch (e) { case 37: //'leftarrow': simpleMesh.rotation.z = -0.2; <--airplane banking animation. but does not pan because it is handled within arc rotate camera. break; case 39: //'rightarrow': simpleMesh.rotation.z = 0.2; break; } } Is there an event to mimic arc rotate arrow keys from dom buttons? <a class='btn btn1' href='#'><i id="btnTurnLeft" title="look left" class="fa fa-repeat"></i></a> <a class='btn btn2' href='#'><i id="btnTurnRight" title="look right" class="fa fa-undo"></i></a> <script> document.getElementById('btnTurnLeft').onclick = function(e){ ... action manager event to turn camera? }; document.getElementById('btnTurnRight').onclick = function(e){ ... }; I did a source code dive and saw that it is the camera alpha that needs the behavior, So I added it to the button click handler: case 'touchLeft': sceneFollowCamera.alpha -= 0.2 ; But... that jumps the camera rotation to that point, and not a smooth tween like the arrow key. So getting closer, but still digging deeper... Is there a better (simple) way to get the arrow key behavior for DOM button? Thanks,
  8. For a Node.JS and Babylon solution... check: http://www.html5gamedevs.com/topic/17871-babylonjs-and-nodejs/ and https://github.com/anymscape/babyloninnode
  9. Hello Babylon community, -->Here is good example, of NodeJS serving .babylon files<-- It uses Dynamic Mime Types to populate the response.Content-type field, from the request file sent. But, at just the right moment in Node.createServer(...). Basically this: res.writeHead(200,{ "Content-type" : mimeType, //<-- SET dynamic MIME TYPE when .babylon files come through. "Content-Length" : contents.length }); Instructions: With node installed, clone git, then cmd line run> node server Result (localhost:8080): .babylon meshes loaded successfully by Node in two ways: AssetsManager && SceneLoader.ImportMesh.