• Content Count

  • Joined

  • Last visited

Everything posted by adwilson

  1. Thanks Temechon, I'll give this a whirl when I get the time! Thanks for your help
  2. Hi Babylon.js forum, I've been particularly setback by a problem I haven't been able to solve for the last day. I have created a stage in Blender, exported it to Babylon. I had two objects I wanted to create a compound imposter and I found createCompoundImpostor() at this site: It says you have to create a hierarchy so I did, using .parent... except it squashed one of the meshes. I wondered if this was something in my export so I started a new test project in Blender and yet it still squashes a mesh, in particular it squashes the child mesh! Here is a section of my test code var pushers = { pusher: null, rod: null};var loaded = false;BABYLON.SceneLoader.ImportMesh("", "", "Stage-Test-4-TEST001.babylon", scene, function (meshes) { meshes.forEach(function (mesh) { if ( === "Slider_Pusher") { pushers.pusher = mesh; } else if ( === "Slider_Test") { pushers.rod = mesh; } }); pushers.rod.parent = pushers.pusher; var parts = [ { mesh: pushers.pusher, impostor: BABYLON.PhysicsEngine.BoxImpostor }, { mesh: pushers.rod, impostor: BABYLON.PhysicsEngine.BoxImpostor } ] scene.createCompoundImpostor(parts, { mass: 1, friction: 0.1, restitution: 0.1 }); loaded = true;});And here are two screenshots, first from Blender and then from my browser (Ignore the missing faces in pushers.pusher, that's just a stupid problem I encountered making this setup even though all the normals are consistent in Blender) I just cannot figure out what's going on, the only documentation on the entire Internet on this feature is the 2 lines, 1 quoted line and few lines of code from that page! I'm using Oimo.js but in cannon.js it did the same thing. Is this a library bug or am I just doing it completely wrong? Does anyone have any working examples they could share? I'm in despair and losing faith!! Haha! Cheers guys.
  3. Yeah for sure! I'll keep showing off anything I'm working on, thanks for the kind words! I've found the new(ish) <button> tag is perfect to be honest, you can have HTML inside it and style it just as well as a <span> tag because as soon as you set a style on them they lose all their default styles and become like any other element (plus they are semantically correct and correct for accessibility, but that isn't too relevant for games), were you thinking of the old <input type="button"> tag? Because they are dated and very limited.
  4. Here's a progress update... @Temechon: updatePhysicsBodyPosition() let the coins drop through the pusher as you warned it probably would so that couldn't help me this time, but I appreciate your help none the less . @Wingnut: I tried your idea and had reasonable success, testing the position wasn't quite enough as the deceleration made it breach it's limits, so I put very heavy but very small objects in the way, one at the back and one at the front which is almost completely unobtrusive so the coins don't hit it (and isn't visible either). With the ideas and knowledge I have now I'm going to restart the whole thing, do it properly with better calculated values instead of "winging" most of them (which causes the pusher to get wedged sometimes and other funky physics) and build a nicer stage and textures etc. using Blender. Here is the demo - [DEMO] (No interaction on the world, just drops 100 coins at random places, feel free to fiddle with the pusher force though!) This is exciting, did everyone else get this buzz on their first 3D project?
  5. Yeah I'll give that a go for sure. Thanks for bringing that to my attention!
  6. Firstly, thank you for the kind words. I feel very welcome already. I tried setting position as well, like the user on GitHub but obviously it didn't work! Those ideas you suggested are definitely worth a go, it's the only bottleneck in my project so far. Cheers for the idea dude! While you bring the subject up I also want to you join with the attaboy for my own reasons! The whole reason I'm this far this quickly is because of those tutorials, they're fantastic! So yeah, Temechon, thanks for oimo and the tutorials!
  7. Hello Babylon.js forum! I'm developing a coin pusher type game as a foray into 3D game dev. But I'm stumped on something. I put an animation on the pusher var sliderBox = BABYLON.Mesh.CreateBox("slider_box", 2, scene);sliderBox.scaling = new BABYLON.Vector3(2.5, 0.2, 1.5);var sliderZPos = { allIn: backWallBox.position.z, allOut: backWallBox.position.z - sliderBox.scaling.z * 2 }; sliderBox.position = new BABYLON.Vector3(0, 0.2, sliderZPos.allIn); // Slider animation var sliderAnimation = new BABYLON.Animation("slider_animation", "position.z", 60, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE); var keys = [ { frame: 0, value: sliderZPos.allIn }, { frame: 90, value: sliderZPos.allOut }, { frame: 180, value: sliderZPos.allIn }, ]; sliderAnimation.setKeys(keys); sliderBox.animations.push(sliderAnimation); scene.beginAnimation(sliderBox, 0, 180, true, 1); This works great, but I need to enable physics on it and this disables the animation. Physics code is simply... sliderBox.setPhysicsState({ impostor: BABYLON.PhysicsEngine.BoxImpostor, move: false});I do not understand 3D development enough to figure this one out, I've done Google searches but haven't found a solution. How can I emulate what an animation would do with physics? Or am I doing something wrong with regards the animation and/or physics code. Extra info: the rest of the code is standard stuff and I'm using oimo.js for physics. Any help is greatly appreicated. Thanks