• Content Count

  • Joined

  • Last visited

About X3MC2

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi, Since the TouchCamera extends the FreeCamera class and works well both on Desktop and Mobile devices, why the need of the FreeCamera ?
  2. Hi, Some documentation classes (such as ArcRotateCamera ) return 404, were they moved somewhere else ? And also some tutorials are not displaying anymore. I'm I the only one who's getting the 404 error ? Can someone verify ?
  3. I need to set the X axis as Z and vice versa, so everything should be ZYX instead of XYZ, is it possible ?
  4. @RaananW Thank you for the great work you've done !
  5. @Deltakosh There seems to be something wrong when assigning something to a Vector3 method like .position or .rotation, I've noticed this behavior before and I thought that I was doing something wrong, what I did is create two box meshes "Box1" and "Box2" and set : box1.position = box2.position; This somehow affected the box2.position. And @Xav's example shows exactly whats wrong, but using a variable instead. camera.rotation=rot; Is also acting like : rot = camera.rotation;
  6. Parenting the light to the camera was the issue. http://www.babylonjs-playground.com/#MKF8U#2
  7. Forced the physics to update the body of the child, now it seems to work: http://www.babylonjs-playground.com/#18UP4N#2 But its nowhere near a robust solution, it needs more tweaking .
  8. The only way you can do it is by creating an invisible mesh parent which will hold the loaded obj models, since there are some obj models out there that contain more that one mesh, and often they do not have the same scaling factor. After that you should set the scaling of each mesh to : parent.getBoundingInfo().boundingBox.extendSize; Here is an example : var container = BABYLON.Mesh.CreateBox("ObjParent", 1, scene); container.position = new BABYLON.Vector3(myposZ,myposY,myposZ); container.rotation = new BABYLON.Vector3(0,0,0); container.scaling = new BABYLON.Vector3(myscalingX,myscalingY,myscalingZ); var OBJ = loader.addMeshTask("ObjLoader", "", "", "batman.obj"); OBJ.onSuccess = function (t) { t.loadedMeshes.forEach(function (m, i) { m.parent = container; m.scaling = container.getBoundingInfo().boundingBox.extendSize; m.position = new BABYLON.Vector3(0,0,0); // Put at the origin of the parent }); };
  9. Hi there Mr.Wingnut , actually I need to parent the greenbox to the camera (Player) , I'm working on a small demo where you play as a steward (The camera) and have to deliver a cup (The crate) on a platter (The green box) while avoiding dropping it. So the greenbox should be carried, and the only way to do this is to set the camera as its parent, but there is something wrong with the parenting of a rigid body, after some invistigation, it turns out that parenting does not dispose the physics impostor of the child, the physics body is still there but does not follow its mesh anymore after parenting. Its like the parenting is only applied to the physicsImpostor.object, the physicsImpostor.body and its shape are being left alone. Well atleast this is what I noticed after some tests. One more thing, I cannot create a compound object between the camera and the greenbox since the camera does not have physics, and even if I do add a physics impostor to it, it does not work well with the native controls.
  10. Hi there, I'm stuck and I can't seem to find a workaround for achieving this, basically what I wanna do is set the Camera as a parent for a small Platform which has a Box impostor of Mass 0, and make a crate which also has physics (Mass 1) land on it. But the problem is that the platform acts as if it has no physics at all, instead of landing on it, the crate goes through , here is the PG : http://www.babylonjs-playground.com/#18UP4N Any help would be really appreciated. Thanks.
  11. Why ? var rawVerts = object.getVerticesData ? object.getVerticesData(BABYLON.VertexBuffer.PositionKind) : []; var rawFaces = object.getIndices ? object.getIndices() : []; BABYLON.Tools.Warn("MeshImpostor only collides against spheres."); returnValue = new CANNON.Trimesh(rawVerts, rawFaces); Even tho CannonJS supports mesh/plane collision ? : Demo : https://schteppe.github.io/cannon.js/demos/bunny.html Source : https://github.com/schteppe/cannon.js/blob/master/demos/bunny.html // ground plane var groundShape = new CANNON.Plane(); var groundBody = new CANNON.Body({ mass: 0, position: new CANNON.Vec3(0,0,-5) }); groundBody.addShape(groundShape); world.addBody(groundBody); demo.addVisual(groundBody); Edit: Ok, I overlooked the fact that the Mesh impostor is infact a Trimesh shape (https://schteppe.github.io/cannon.js/demos/trimesh.html). So can you add ConvexPolyhedron shapes in the next release please ?
  12. Hello everyone, Seems like this playground doesn't work offline http://www.babylonjs-playground.com/#E6OZX#6 , I get this error : BJS - [18:56:31]: Babylon.js engine (v2.5.-beta) launched (index):56 Uncaught TypeError: BABYLON.SkyMaterial is not a constructor Edit: Silly me, the playground uses a material library , the babylon.skyMaterial.js To be locked, sorry for the inconvenience
  13. No errors, just the info from babylon that it was launched : BJS - [16:37:16]: Babylon.js engine (v2.5.-alpha) launched As @aWeirdo mentionned, if setPreventDefault is set to false, it works. This thread can be closed, as the solution was given by aWeirdo.
  14. Hi there, I'm having a problem getting a playground sample to work on my xampp localhost, I got the Zip file of the Collisions example from the playground (http://www.babylonjs-playground.com/# -9 Collisions), the freecamera works perfectly when I run the online example, but when I test it on the localhost, the camera won't move at all, it will rotate with the mouse, but will not respond to my arrow key presses. Can someone explain why does the example works online and not on local ? Update: When tested using Internet Explorer, it works, but does not work using Firefox or Opera. So is there a difference between IE and other browsers conserning handling local html files ?