matriax's Forum Posts

  • matriax Target camera does not have an ellipsoid. Each camera has its own parameters.

    And how can we know that? In the description camera will be great some advices like that, or simply make Babylon not take in consideration the ellipsoid when Target Camera is added to avoid the error.

    BTW, the TargetCamera was for fix the FreeCamera problem when you fly, but with target camera seems we have to build our own controls for movement and camera rotation(for mouse). And also, without ellipsoid how the camera check the collisions? Also the gravity not works with targetCamera...

    So, in my opinion better find a solution/fix for the FreeCamera to avoid fly, instead of build from 0 all the behaviour in Target Camera.

    Any ideas?, Maybe by code in the plugin some action in the camera to switch if the FreeCamera take or not the Y.rotation in consideration? So if deactivated you walk etc... and with that active you can fly or use it as a "JetPack behaviour".

    ---

    Other thing i'm wondering is, will be possible add in the plugin some action to use native Babylon.js code? So i can ask in the Babylon.js forum for a solutions and paste it on the events. Maybe is something impossible, just asking.

    EDIT

    For example i searched in their forums how to solve the problem and found this:

    http://www.html5gamedevs.com/topic/1881 ... p-or-down/

    So with an event to use native Babylon.js code i can try that solutions in case i can't fix myself with the babylon3D plugin.

  • X3M I simply open your FPS template, change the FreeCamera by Target Camera and get the error. just that. i told you in the other post, here the image of the error:

  • X3M Tested better the collision, destroy mesh and other things and glad now it works with duplicates and families, this make the work lots easier. BTW, If for the new update you can add the possibility to destroy any Mesh at the intersect condition will be great. Looks like on interesct condition the first mesh is prepared for something but when you try to destroy/interact with another turns crazy or something.

    Also there is no way to do: When camera collides with a mesh > destroy the mesh . Or at least i was unable to do it.

    ---

    Back to the camera thing, what happens to the TargetCamera? I'm doing some wrong or the Target Camera is a real bug?

    I'm going to try fix the FreeCamera Y, now that i know takes the Yrotation in consideration if not i will pass to other things.

  • X3M Edit, no matter the physics behaviour, seems to destroy the mesh only works when is the first in the condition not the one who receive the collision. ¿?

    I mean:

    This works, but if i try to destroy the other get the error.

    I always tried to destroy the second mesh. i mean, when a bullet collides with the enemy > Destroy enemy. But only works if i set If enemy collides with a bullet > Destroy enemy. Is a bit weird, but now is working.

    In C2 the collision works in Both ways. In fact in C2 also you can set: If Mesh1 collides with Mes2 > Destroy Mesh3.. But in babylon only works with Mesh1.

    -

    EDIT: In case Of collision of Mesh1 and Mesh2 if i try to destroy a Mesh3 this is the error(Same for OBJ-Mesh):

  • X3M Tried both objects or only one of them with the babylon3D physics behaviour added and without physics, always with the same result and other errors:

    They need the Physics behaviour to detect the collision and interact?

    Other tests:

    If i press X and set destroy NewMesh get an error. On OBJ-MESH the mesh is destroyed without problems on press a key. On mesh picked with the mouse the NewMesh object is destroyed on OBJ-Mesh no.

  • Damn more errors

    OBJ mesh on intersect with a point and giving the other OBJ mesh X/Y/Z position (MeshPosX,MeshPosY,MeshPosZ). Also trying to get the center point of the mesh or absolute position,etc...

    I'm trying all the possible ways that comes to my mind to when an object collides with other(Using babylon events) and or not works or get a new error.

    I'm going to leave the collisions and try again the movement thing to see if i can fix the FreeCamera.

  • I was testing the collisions to do when camera or another object collides with other = destroy mesh but i was unable to get it, or not works or i get an error, this one:

    When i try to destroy a NewMesh (No matter how)

    (For example on press X > destroy NewMesh)

    When i try On NewMesh intersects with an OBJ-Mesh, or OBJ-Mesh intersects with another OBJ-Mesh nothing happens, The New/OBJ Mesh stops in their mass center, so detects the collision but the mesh is not destroyed.

    What i'm missing?

    I saw your examples but the Platformer and the Racer have C2 collisions, and the FPS the unique collision is the camera with a wall but without interact/destroy that mesh.

  • I can't set a TargetCamera when i do get this error:

    I tried to set the targetCamera in your FPS to see if was my code and the same error .

    BTW, i tried what you said on FreeCamera and yes when i press a key the camera moves in that direction but in a weird way, i guess because is a FreeCamera.Maybe with that i can fix it for the freeCamera, i will try tomorrow.

    Edit: If you say takes the camera rotation of the player in consideration maybe when we press forward(W) on Freecamera is add some (-Y rotation) coordinates or similar to respect the controls? More things to try.

  • Trying to achieve another thing that i though was more easy...

    If you aim the sky and go forward(W) you can fly or go up, in the same way if you look at the floor and go backwards(S) you can fly or go up.

    I tried to do some fixes but nothing worked. I simply want that when i press W to go forward the camera moves forward over the floor without matter if is aiming the sky. And if i look the floor and press S i want to go backwars no UP.

    I guess maybe the set controls to camera is not what i need here, so i tried with "set position", "translate by" and "translate by ease" but can't get it to move correctly. The one that detect colisions is the "translate by ease", but i can't figure how to set that when i press the key goes to the direction in front the camera not the world axis. I tried the FrontCamera expresions and others like Camera.DirectionX but always is a mess. Also tried that when i press W fix the y position to avoid flying but nothing working 100% fine.

    Is there any solution for this X3M ? I willleave at the moment, I'm going to test other things like jump, crouch,etc....

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • X3M Not really, first the idea is do some kind of template/Engine for FPS, with all the basic parameters added and all working with camera, fog, gravity,etc.. to be easy to use.

    After that will see, but yes for a first try some lowpoly/res game in 8bits with C2 shaders i think can look really cool. Something like Cube Rampage on all are basic shapes but with effects and other techniques give it a cool touch. For that the thing about deactivate anisoptric filtering, nearest instead of bilinear sampling mode,etc... to have sharp pixels.

  • Ohhh i think i fake it the Camera real gravity .

    Still a bit dirty but is working. I'm going to test it all better....

  • matriax The camera uses a native physics engine, it does not use Oimo or Cannon. The native engine doesn't mimic real life physics at 100%.

    Then how i make the gravity of the camera real? MMm maybe some event with a local variable that if camera is not colliding with nothing adds 0.1 of gravity each 0.1 seconds and when collide to something set to 0 ?

    Or maybe there is an expresion that can be added to the Y gravity like "(-9.81*Seconds)/Variable" to fake it?

    Any ideas?

    Edit: Well i already fake it the falling gravity. But now i need some check when the camera is not colliding with nothing. Mmm

  • Why the gravity is constant? I mean i set -9.8 in various sites and in all the same effect, you fall constantly at 9.81 speed or whatever, when in theory you have to fall every time more faster.

    In theory is -9.8 every second(or m/s o something like that), but in the moment there is nothing under your feets the -9.81 is applied, instead of start with 0 and increase 9.8 each second. (I'm talking of memory).

    How can i achieve that? In camera only appear "apply gravity" and in physics like oimo,etc... i set -9.8 with the same result as "scene native gravity",etc... ¿?

    And I guess this also can improve the climb stairs/ramp actions and avoid the "earthquake" effect because instead of 0 or 9.8 gravity will apply 0 and increasing from 0 to whatever.

  • X3M I'm with the stairs/ramp problem again.

    The unique solution is use a bigger scene scale? For the actual scene i'm using a camera ellipsoid of 8,10,8 but some stairs still do some "eartquake" effect when try to go over them and the ramp push me to down.

    Only when the ellipsoid Y is over 50 the ramp stops to push me down,etc... that i guess is how i solved the last time, in blender export or select all and scale all the scene much bigger.

    I tried to set the ellipsoid collision of some objects to 0 but still not works or maybe that funcion is deprecated i don't know.

    So i guess i will have to export the cube again in a x5 scale or do it 5 time bigger to set the elipsoid Y on 50. In your FPS example the camera ellipsoid is "1,30,1" so i guess this is the way to do it.

  • X3M Ah i see! no problem as you said all are just minor things.

    I changed it but not worked correctly, no sets the exact rotation, just by some decimates. I add 90, 180,etc... but not looks correct, with the previous conversion worked perfect.

    I set 90 degress, but in the render i used the debug and to be correct have to be set at 89.5 . So maybe there is an error in that conversion code?

    BTW, i will back to the previous expresion with a note that have to be changed for the next babylon update.