• Content Count

  • Joined

  • Last visited

About Dwengo

  • Rank

Profile Information

  • Gender

Contact Methods

  • Twitter
  1. Ahh gawd, its always the simple things... Sometimes its just an extra pair of eye that helps: I've updated it to use a box: https://playground.babylonjs.com/#645VV4#17 Thanks for the help
  2. Hi all, so question is in topic really, I'm toying with point and click functionality using oimo js. You can see the effects here: https://playground.babylonjs.com/#645VV4#10 (old one) https://playground.babylonjs.com/#645VV4#12 If i use a sphereimposter for the mesh i'm moving, it works (kind of). but if i use the boxImposter (which i kind of want to) the box just falls off the map after a while, I don't update the Y axis at any point. I did try a kind of hack where i apply a little impulse to lift it off the ground... But it just kept going ._.; Any ideas on how to prevent this?
  3. I feel like this is an issue that must have been solved and is a simple algorithm, but I'm struggling to figure it out myself.. https://playground.babylonjs.com/#6R8BFY#11 The problem I'm having is that if I click on the ground (so that the mesh moves towards it). If the destination point is not perfectly diagonal or straight, then the x axis or the z axis is reached first. It kind of goes diagonally for a bit before going straight for the rest of the route. The code is really simple, And my feeling is the movement logic needs improving. I'm essentially applying a force of 1 or -1 on each axis depending on where the mesh is currently until it reaches its point. Is there a better way to do this?
  4. TL;DR The `loadMesh` onSuccess gets called, But i got no mesh! haaaaalp! Hi all, I've been having a problem with my asset-manager when loading meshes. I've taken a look at the playground 'import mesh' and the code is almost the same, however on the 'addMeshTask' success callback I do not get access to the loaded mesh via 'task.getLoadedMeshes[0]' (as seen in the playground). I'm really confused as to what could be causing it to trigger a success event, but not have any 'loaded' meshes. My code is open source: https://github.com/dweng0/wildflower to get it up and running you'll need to do an `npm install` and npm install -g` when thats all done, in the command line, you'll need to run `webpack` then set up the mock server with `npm run serve` Then in your browser go to localhost:3000 (have the console open). I've added a debug in the offending function, but it starts in the AssetsManager.ts -> `loadCharacter` function loadCharacter(url: string, character: CharacterManifest, manifest: ICharacterData) { let bodyTextureUrl = url + character.url + "/textures" + manifest.textureUrl; let meshUrl = url + character.url + manifest.meshUrl; debugger; // load body texture this.loadTexture(character.name + "_texture", bodyTextureUrl, () => { console.log(character.name + " texture loaded"); }, () => {}); // todo load mesh this.loadMesh(character.name + "_mesh", manifest.meshes[0], meshUrl, (task: BABYLON.MeshAssetTask) => { console.log(task.loadedMeshes[0]); <==== No mesh WTF!!!!!!!!!!! task.loadedMeshes[0].material = this._scene.getMaterialByName(character.name + "_texture"); / }, () => { debugger; console.log('did it fail?'); }); } loadMesh(taskName: string, meshNames: any, rootUrl: string, success: (meshAsset: BABYLON.MeshAssetTask) => any, fail: () => any) { console.log('loading mesh', taskName); let meshLoader = this._assets.addMeshTask(taskName, taskName, rootUrl, meshNames); meshLoader.onSuccess = success.bind(this); meshLoader.onError = fail.bind(this); return meshLoader; }
  5. I've been looking at implementing physics into a simple scene, but I feel the documentation is out of date and thus much of the stuff you find online is out of date also. Take for example meshes, in order to activate physics on one, you now need to set the `mesh.physicsImposter` member variable, whereas almost all relevant topics call the (now redundant) function `myMesh.setPhysicsState()`. This is confounded by the fact that oimojs has documentation that fleets between Three, Babylon, and sometimes neither! Could we perhaps update the Babylon playground to contain more physics demos using Babylon 3 at the very minimum? Is anyone else finding the out of date content available online an issue? could we do something more in the documentation?