ian

Members
  • Content count

    237
  • Joined

  • Last visited

About ian

  • Rank
    Advanced Member
  • Birthday

Contact Methods

  • Website URL
    https://ajna4taiga.no-ip.org/ajna4taigaWeb/

Profile Information

  • Gender
    Male

Recent Profile Visitors

1,854 profile views
  1. http://www.babylonjs-playground.com/#CKEHJ#1 Is there any way how to force box collider to rotate as child of his parent?
  2. I add function for debugging physics (as you show us how to debug). http://www.babylonjs-playground.com/#CKEHJ#1 I add FOR DEBUGING - HERE WE CAN SEE BOX IMPOSTORs of colliders[] are not rotating - hey are static! function PhysicsImposterViewer(physicsPlugin, scene) PhysicsImposterViewer.prototype.update = function () var bodyViewer = new PhysicsImposterViewer(physicsPlugin, scene); engine.runRenderLoop(function() { if (scene) { scene.render(); bodyViewer.update(); poskrbiZaRotacijo(); } });
  3. Uncaught TypeError: Cannot read property 'x' of undefined at RotateAround (eval at compileAndRun (index.js:188), <anonymous>:87:65) at e.poskrbiZaRotacijo [as callback] (eval at compileAndRun (index.js:188), <anonymous>:66:4) at e.notifyObservers (babylon.js:2) at i.render (babylon.js:12) at index.js:179 at n._renderLoop (babylon.js:4) This error is gone. "I think the problem was because quaternion..." perplexus.rotationQuaternion = new BABYLON.Quaternion(); (I think this line define perplexus to behave rotation like quaternion). (But I see somewhere that there are 2 different quaternion one like babylon_quaternion and second like physics_quaternion. "Am I right? Are babylon and physics quaternion same") But the main problem is that pareting BoxImpostor physics boxes are not working. I think that BabalonJS dosn't support parenting physicsImpostors. if (newMesheI.id == "Path") { perplexus = newMesheI; //perplexus.checkCollisions = true; //perplexus.physicsImpostor = new BABYLON.PhysicsImpostor( perplexus, BABYLON.PhysicsImpostor.MeshImpostor, { mass : 0, friction : 1, restitution : 0 }, scene); perplexus.rotationQuaternion = new BABYLON.Quaternion(); perplexusWorldMatrixBegin = perplexus.getWorldMatrix(); } if ( newMesheI.id.substring(0, 4) == "Cube") { colliders.push( newMesheI ); } if (newMesheI.id == "Sphere") { playBall = newMesheI; playBall.checkCollisions = true; playBall.physicsImpostor = new BABYLON.PhysicsImpostor( playBall, BABYLON.PhysicsImpostor.SphereImpostor, { mass : 5, friction : 1, restitution : 0 }, scene); // 0.597=metal ball } } // this code below parenting each collider box as child of perplexus mesh. for (var a=0; a<colliders.length; a++) { colliders[a].isVisible = true; // 1. parenting !!! colliders[a].parent = perplexus; // 2. set physicsImpostor !!! colliders[a].physicsImpostor = new BABYLON.PhysicsImpostor( colliders[a], BABYLON.PhysicsImpostor.BoxImpostor, { mass : 0, friction : 1, restitution : 0 }, scene); colliders[a].checkCollisions = true; } By default camera always look at center of ball (if we disable - make ball static.. //playBall.checkCollisions = true; //playBall.physicsImpostor = new BABYLON.PhysicsImpostor( playBall, BABYLON.PhysicsImpostor.SphereImpostor, { mass : 5, friction : 1, restitution : 0 }, scene); // 0.597=metal ball we can see that perplexus mesh and box colliders are rotating OK ) (rendering is ok but physics is not ok) I THINK THE MAIN PROBLEM IS THAT colliders(box impostors) ARE NOT WOKING WITH PHYSICS WHEN WE PARENTING... Is there any way to DEBUG or TO SEE what is going on with box colliders/BoxImpostors of each colliders[]? It will be nice if Debug-er will have option to turn on/off to see what is going on with each meshes impostor. -------------------- RaananW, I can't remove this two functions and make playground simpler. This two function take care to rotate perplexus around current ball position. Very complicated/magic functions function RotateAround(transform, center, axis, angle) function RotateVector3ByQuaternion(vector, quaternion) and I can't remove loading model and key listeners
  4. Here is playground http://www.babylonjs-playground.com/#CKEHJ#0 Use keys WSAD to rotate mode (blue color). I would like to comment // perplexus.physicsImpostor = new BABYLON.PhysicsImpostor( perplexus, BABYLON.PhysicsImpostor.MeshImpostor, { mass : 0, friction : 1, restitution : 0 }, scene); and instead MeshImpostor use all colliders[a] as BABYLON.PhysicsImpostor.BoxImpostor I do parenting but if I comment // perplexus.physicsImpostor = new BABYLON.PhysicsImpostor( perplexus, BABYLON.PhysicsImpostor.MeshImpostor, { mass : 0, friction : 1, restitution : 0 }, scene); Ball fall throught and get Uncaught TypeError: Cannot read property 'x' of undefined at RotateAround (eval at compileAndRun (index.js:188), <anonymous>:87:65) at e.poskrbiZaRotacijo [as callback] (eval at compileAndRun (index.js:188), <anonymous>:66:4) at e.notifyObservers (babylon.js:2) at i.render (babylon.js:12) at index.js:179 at n._renderLoop (babylon.js:4) Can anybody HELP ME SOLVE THIS PROBLEM? for (var a=0; a<colliders.length; a++) { colliders[a].isVisible = true; // 1. parenting !!! colliders[a].parent = perplexus; // 2. set physicsImpostor !!! colliders[a].physicsImpostor = new BABYLON.PhysicsImpostor( colliders[a], BABYLON.PhysicsImpostor.BoxImpostor, { mass : 0, friction : 1, restitution : 0 }, scene); //colliders[a].physicsImpostor.forceUpdate(); colliders[a].checkCollisions = true; } @RaananW
  5. Ok I solve problem. But I still would like to see any example code around those functions onCollisionPositionChange onCollisionPositionChangeObservable onCollide
  6. ground.position.y is always same (ground have his own origin/pivot point and ground.position.y is ground's origin vertex). If ground is diagonally/alive/when_you_rotate_in_runtime than this ground.position.y is every time different (vertex where ball contact the ground). I don't understand why onCollisionPositionChangeObservable : Observable<Vector3> An event triggered when the collision's position changes Are this functions for Mesh or Mesh's collider? Any example playground will be good to learn us how to use this callback functions. Doesn't work. Or I don't know how to use this method/funciton of API. What is going on with this callback functions? I try debug but functions are not called. I think we should do like (we define our callback function which it should invoked) perplexus.onCollisionPositionChange = new function(vertex) { // here we should get vertex (x,y,z) of point where ball collide with perplexus console.log( vertex ); } Is this onCollisionPositionChangeObserve function implemented and does it work? If this will work it will be perfect solution. What am I doint wrong??? Can anybody help us to understand this three functions? I would like to made custom auto align FreeCamera (I am experimenting) and I need vertex=contact of Sphere and Perplexus for each frame. Is there any another way to obtain vertext where two meshes touch each other ------------- // I'am trying this but, // callback functions don't invoke ????? perplexus.onCollisionPositionChange = function(vertex) { console.log("Test"+ vertext+" "+this); } perplexus.onCollisionPositionChangeObservable = function(vertex) { console.log("Test1"+ vertex); } perplexus.onCollide = function() { console.log("Test1"+this); } JohnK Thanks for your help. Is BabylonJS capable to achive that with BabylonJS's APIs? Or should we hack math like JohnK is doing? @RaananW @Deltakosh Greetings Ian
  7. How can I get vertex where Ball(Sphere) collide with Ground? Can anybody help me solve this problem? var perplexusIntersectionPoint = 0; if (perplexus.intersectsMesh(playBall, true)) { vertex(x,y,z) of perplexus where playBall/Sphere collide with perplexus/Mesh }
  8. all infos are here and will be https://plus.google.com/u/0/communities/104218839969593290847 I add videos how looks playing (it si playable game, but still I would like to make camera to be align for easy playing) Now it is ArcCamera and player have to align camera first and than play with WSAD (It is possible to play on phone or tablet (but user have to set PHYSIC STEP depand on gpu/phonge gpu ) Faster GPU set 80 physics step, slower phone set physics step 15 or 20... or game url (still slow - I don't have better upload and it is hosted on restbarry for now... https://ajna4taiga.no-ip.org/PerplexusShadowOpen/Home.html you can try offline or online mode..
  9. Here is template (two start point .blender files) https://drive.google.com/file/d/0B-XfqtExpOmpamFuWWJTY1A5ajQ/view
  10. What already achieved is possibility to upload any number of custom builded perplexuses with boxes. Here is missing start numbers an finish. Game works everywhere because of Babylon. People can change his friends who can play better time for each Perplexus.
  11. Just new model (now no coding only updated new model)
  12. OK, https://ajna4taiga.no-ip.org/PerplexusShadowOpen/PerplexusProd.html Anonymous online 3 Level = Tested SLOW DOWN PHYSICS STEP (SETTINGS) IF BALL IS TO FAST ROLLING OK this level have red spots where ball always fall through. How is this possible? Why happens this? Can anybody help me here? Is this mesh collision problem or exporter from blender to .babylon file? My friend try same model with unity. He load .blender file and he have not problems on this red spots with ball (ball fall through problem). I would like to create around 50 models but if babylon is not reliable maybe I should move to unity. I really like babylon because (I love WebGL), but something is not reliable. (or mesh collision or blender-babylon exporter). I try to add box colliders (as patches) around this spots and set those boxes as child of perplexus. Boxes are rotating ok with perplexus, but colliders does not work! I attached blender perplexus Model. If you know blender you can see final model. Layer 11 (Layer 1 has primitive components) If anybody have knowladge how to create algorithm to build perplexus form components (layer 1 attached .blender file) , please contact me. greetings Ian PerplexusComponents.blend