satguru

Members
  • Content Count

    366
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by satguru

  1. All this time I have been treating the "mesh" function "moveWithColisions" as a function which moves a mesh by certain distance along a vector. But when I look at the class doc, it is defined as "moveWithColisions(velocity)". Is it velocity or distance?
  2. Makes sense now. "camera.useBouncingBehavior = true;" threw me off track. I thought the behaviors were already added to the camera and useXXXBehavior just enabled or disabled them. But now I see that useXXXBehavior is same as addBehavior().
  3. Found the issue. I had the 3.0 version of babylon.waterMaterial.min.js in my path. I replaced that with the latest one and the problem went away, Following thread helped
  4. In my application I am loading a mesh using SceneLoader.ImportMesh. The mesh has StandardMaterial with specular color set to (0.05,0.05,0.05) If I load this using babylonjs 3.0 the specular value loads properly If I load this using babylonjs 3.1 alpha the specular value is set to (1,1,1) Unfortunately I am unable to reproduce this in the playground. In playground the specular value loads properly. So I am assuming the mesh specular value is being effected by some other setting in my app I tried changing light type, light color, scene clear color, scene ambient color, shadow on off, skybox on off. No luck Can't figure out what. Anybody any idea ?
  5. In the demo https://www.babylonjs-playground.com/#6FBD14 you do not have "camera.addBehaviour(BouncingBehavior)", what you have instead is "camera.useBouncingBehavior = true;" But I think I might have misunderstood the purpose of behaviors. Maybe this is meant for BabylonJS Framework developers rather than BabylonJS Application developers. In other words it can be used by Framework developers to add additional functionalities which the Application developers can then use. Yes?
  6. Reading the document again I see it defines an interface for the behavior. So if my class implements the interface I should be able to attach it to a node. Right? Regarding "node.behaviors", I was thinking from a tooling/editor/inspector perspective. Maybe they can use that to discover and list out all the behaviors attached to a node. Also instead of node.useXYZBehavior = true; maybe node.enableBehavior("XYZ"); ? This way every time a new behavior is added, the node properties do not have to change. Also node.isBehaviorEnablerd("XYZ") to find if a behavior is enabled.
  7. Nice! How does one define custom behavior? Currently, "node.behaviors" lists out only enabled behaviors. Maybe it should list out all ,enabled and disabled, behaviors
  8. litegraph.js seems interesting and so also some of the other tools there
  9. @Mythros Sorry I was away and also wasn't getting any notifications of your messages. If instead of climbing up the slope and then sliding down when stationary, you want to prevent the player from climbing up the slope at all then yes that should be possible. Currently I check slope only when new y is less than old y but we can do that at other times too. Also instead of just one slope limit we can take two limits- min and max slope limits. If slope between min and max then player can climb but will slide down if stationary , if more than max then player won't be able to climb at all. Will work on that when I have some time which probably won't be any time soon. Maybe an exercise for you ?
  10. what do you do if the mesh is not moving on ground. In my demo how would you handle moving on the planks?
  11. Do not see the sphere falling down in air. Do not see the problem. If you check my demo you can see the AV accelerate down when it walks off the planks
  12. Impressive indeed! what do you think about this? https://tenso.rs/ worth exploring?
  13. @Mythros Regarding "How can you detect if the player is climbing up the hill?". Compare the Y position of mesh before and after MoveWithCollision. If it has increased then it means the mesh is being probably pushed up a slope. Regarding FollowCamera. ArcRotateCamera worked well for most of my use cases so I never looked into using FollowCamera. So I do not have much knowledge about that. I will eventually look into it but for now, unfortunately, you are on your own as regards that
  14. here's a playground example https://www.babylonjs-playground.com/#638Q6N use WASD and QE to move sphere around. with shift to run space to jump lines 31-33 is what you need for the functionality the CharacterControl itself is from line 40 onwards.
  15. @Mythros The code is a bit convoluted because it is still work in progress. This was inline my main Vishva code. I separated it out into its own class to make it reusable. It is still not complete and I am not sure when I will be able to complete it. When I get some time I will put together a simple playground example to show how it can be used in its current state. The idea behind it is actually very simple. In each frame, based on walk speed, gravity etc., I decide by how much amount do I want to move the mesh in x, y and z direction. I then use moveWithCollision to move it by that amount. I then check to see by how much amount did it actually move. This provides some hint on what might be happening. I then take some action based on that. So lets say I want to move the mesh by -2 meter in y direction but if after moveWithCollision I see that it hasn't moved at all in that direction I then conclude that the mesh might be on ground But if I see that it did, actually, move by -2 meter, I then conclude it is in free fall and I start accelerating it down further For slope I compare the old and new position to calculate the slope by which the mesh moved in vertical plane. If the slope is less than the slope limit I move the mesh back to its old position else I let it slide down.
  16. @Deltakosh Ok . I will revisit my source and also checkout the code you pointed out. Regarding specular you are right, it is not a bone issue. Previously when I loaded mesh they would have a specular color of #000000. Now they have #ffffff.
  17. @Deltakosh, Yes that worked to an extent. But still not there. When I use "BABYLON.SceneLoader.CleanBoneMatrixWeights = true" The uv texture is messed up. See bad_texture.jpg Without the line I get good_texture.jpg Also the the specular color is now set to white. As a result meshes end up being very shiny. Previously it used to be black.
  18. Still the same issue with the latest preview and your line. attached is the code from playground if you wish to try sample.zip
  19. @Mythros See if this helps. This just uses moveWithCollisions and some simple physics. https://ssatguru.github.io/Vishva.ts/public_html/index.html?world=demo2 You will see three planks at different angles. The first plank is less than 30 degree, the other two more than 30 degree. Use WASD or arrow keys to walk the AV over each of those planks. The AV slides down the more than 30 degree planks if its stops while walking up those planks. The slide slope limit is set to 30 degree. The code https://github.com/ssatguru/Vishva.ts/blob/master/src/ts/component/CharacterControl.ts The slide slope limit is set here https://github.com/ssatguru/Vishva.ts/blob/master/src/ts/component/CharacterControl.ts#L18
  20. @Dad72 I do not think the problem is with bind. Animation works fine with bjs 3.0 but not with the 3.1 alpha
  21. Impressive. Gave you a star! Did you know that you can serve pages from github? I cloned your repo and created a link Here's the link if anybody wants to try https://ssatguru.github.io/BabylonFpsDemo/example/index.html
  22. @Deltakosh @gryff we have another problem now. during animation the mesh is distorted See file "latest_anim.jpg" to see how the mesh looks in playground with the latest version of bablylonjs See file "stable_anim.jpg" to see how the mesh looks in playground with the stable version of bablylonjs The code is again "playground_code.txt" The code is same as before except for the following new line at line number 46 mesh.skeleton.beginAnimation("walk",true); playground_code.txt
  23. @Deltakosh, Yes it works now. Thanks for the fix @gryff, Thanks for the troubleshooting. @JCPalmer Impressive demo. Was a bit hesitant to click on the link when I read it though, being in office and all.