• Content count

  • Joined

  • Last visited

  • Days Won


JohnK last won the day on December 4

JohnK had the most liked content!

1 Follower

About JohnK

  • Rank
    Advanced Member

Contact Methods

  • Website URL

Profile Information

  • Gender
  • Location
    England, Buckinghamshire

Recent Profile Visitors

3,507 profile views
  1. Is this still the allowJump problem. If I understand you correctly you only want a jump action possible if the "character" or "camera as character" is in contact with an object, for example the ground. So you want If character in collision allowJump = true If character exits collision allowJump = false
  2. Pivot Problems

    Hi and welcome. You are positioning the sphere using cylinder02.getPivotPoint(); but as you haven't set the pivot point this returns 0 Secondly using the developer tools inspection panel in the browser quickly shows these errors in the console ReferenceError: Cylinder01 is not defined ReferenceError: Cylinder02 is not defined You used c for your cylinder variables not C.
  3. Have a play with this
  4. Would have appreciated seeing a PG of your first attempt as more than likely it was pretty close to this and just needed a bit of tweaking .
  5. Hi and welcome to the forum. Here are some stairs using ExtrudePolygon documentation
  6. Working for me on an Android tabled. Touch away from object which is deselected. Select texture touch object texture changed on object, touch new texture this texture applied to object.
  7. The forum post goes on to say So taking this idea plus this SPS playground and combining shows 2550 solid particles colliding with a sphere imposter around a camera gives (wait for batch of red particles to go then green particles are fired towards the camera turning red when colliding with the camera imposter and being diverted). This is a quick demo cobbled together to show performance without any attempt at any optimisation. OK you want a camera that moves and (possibly stationary meshes) but this would probably improve performance. Keep trying and I am sure you will get where you want to be.
  8. In this case there are problems in wanting to use internal methods (collisions and falling under gravity) to change an external variable (allowJump) this is a (poor) attempt to use @Gijs's method of checking for changes in y. One problem is that the gravity and collision methods used seem to change the y of the camera even when moving horizontally. Anyway use the left arrow key to move of the ground and the sphere turns red when falling (but on occasions can do when moving horizontally). With onCollide I can see how allowJump can be set to true but do not see how to set to false when not in collision. Probably needs a notInCollision observable. An alternative is or to use BABYLON.ActionManager.OnIntersectionEnterTrigger and BABYLON.ActionManager.OnIntersectionExitTrigger in an actionManager Sorry but cannot be of more help. Interesting issue for 3D platform games as well that would need someone more skilled than me.
  9. True but there is no indication that kurlaa is using this method.
  10. How do you know you are no longer on a mesh and so must fall? If you have some logic that says you have moved off a mesh and so activate a fall then when activating the fall also set allowJump to be false.
  11. ExtrudeShapeCustom not working right

    Easiest way is to do what I did in #4 reverse lower/upper (top/Bottom) values
  12. ExtrudeShapeCustom not working right

    Bit trickier than I thought but here it is but I may have got it upside down so Note that because your poly data is all positive and scaling is set at the origin the shape is skewed see better with bigger chamfer If you want to the base centres in alignment then you need to adjust your data to have the origin at the centre
  13. ExtrudeShapeCustom not working right

    As an alternative extrude without caps use createPolygon or PolygonMeshBuilder to make the caps and merge the meshes.
  14. When a wall is created and positioned can you not make the normal a property of the wall. You could also check this out In particular getFacetsAtLocalCoordinates and getFacetNormal EDIT Started this answer a couple of hours ago on my mobile while waiting for an appointment. Finished it when I got home before checking for replies. Answer is probably now redundant.
  15. The fps can vary depending on the number of meshes and other conditions. If you want your mesh to move at a predetermined speed say V units per sec then you need to know how far to move per frame. When the frame rate is F fps then the time taken T for a given frame at that time is 1/F so the distance moved by the mesh is VT = V/F. scene.registerBeforeRender or scene.registerAfterRender can be used to make changes for one frame. So for a mesh with speed V in the direction of the X axis scene.registerBeforeRender (function (){ var F = engine.getFps (); mesh.position.x += V/F; })