Jump to content

Search the Community

Showing results for tags 'raycast'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 14 results

  1. How does one structure a humanoid mesh and then use it within babylon such that one can ray pick isolated body parts as they move through animations? Does one just leave each body part as a separate object in blender..? How will pickResult tell me that a ray traveled through the right hand? Currently the character is 11 separate meshes and animated completely in javascript, which makes the picking work just fine but is non-desirable for adding animations :D. Also not sure about the performance ramifications
  2. Hi there, learning Babylon.js since 2 days I've created a "container" mesh (with no geometry), and then added to it 2 children meshes, a box and a sphere. I would like to pick the container mesh on mouseClick event, but actually either box or sphere get selected. Is there a way to ignore submeshes? I know there would be many workarounds, like for example creating the container as a box with a transparent material, but I was just wondering if there was a flag/parameter a can set when doing raycasting. Here you can find the PG: https://www.babylonjs-playground.com/#BD4L6U
  3. Hello all Sorry for my bad english in advance . I have a littel issue with GUI and I want to understand why it works like taht . What is the issue ? I made this function : function vecToLocal (vector, mesh){ var m = mesh.getWorldMatrix(); var v = BABYLON.Vector3.TransformCoordinates(vector, m); return v; } class Raycast { constructor() { } doorOpener(letHit, myGUI, scene){ this.scene = scene; var origin = player.position; var forward = new BABYLON.Vector3( 0, 0, 1,); forward = vecToLocal(forward, player); var direction
  4. Hello I found one bug I think. In this exampel https://www.babylonjs-playground.com/#KNE0O#4 I found this example o https://doc.babylonjs.com/babylon101/raycasts ray.show(scene, new BABYLON.Color3(1, 1, 0.1)); When I tried this code, which was prepared in exampel then babylon.js stop worked. Sorry for my poor english.
  5. Hello everybody, I'm currently trying to get a mesh by clicking on the canvas. So far, it works really great but I still have a problem: On click, the mesh gets highlighted. Fine but when I drag the mouse on the canvas in order to move the cam, when I release the button of the mouse, a click event is triggered and the mesh beneath it get selected. I tried to add an event listener on 'mouseup' to stop propagation to the click event but it seems BJS already "intercepts" this event so it is never triggered. I created a codepen to illustrate : https://codepen.io/3dos/pen/mLEEdq
  6. when i create and use raycast in my scene it is in not in exact position means the below code is i'm using. based on the code the ray can be in straight line towards z axis but it is inclined var front = new BABYLON.Ray(); var frontHelper = new BABYLON.RayHelper(front); var frontLocalMeshDirection = new BABYLON.Vector3(0, 0, 500); var frontLocalMeshOrigin = new BABYLON.Vector3(0, 0, 1); var frontLength = 3; frontHelper.attachToMesh(this.__this.player, frontLocalMeshDirection, frontLocalMeshOrigi
  7. Hi, when using var hitInfo = scene.pickWithRay(ray, null, true); I would expect that the ray only checks the boundingboxes and not the mesh. So if I import an "open package" where the ray can go through the object without collision, I want to check only if the ray hits the boundingbox, but this doesn't seem to work. Here is a playground: http://www.babylonjs-playground.com/#5PMLFP Thanks, Steffen
  8. Hello, Raycast TerrainMap and get MixMap %'s? CONTEXT: Raycast over a Terrain Map... and determine the type of terrain (floor, rock, grass, etc) where the Ray Intersects mesh. Looking at Mixed-Map-Materials and Facet-Data... QUESTION: is there a way, to get the MixMap through a Raycast Intersection? Or any suggestions on detecting floor, rock, grass... thx. Kind regards, UPDATE: using this playground, stepping into raycast... http://www.babylonjs-playground.com/#7CPS7 Found: results[0].pickedMesh, pickedPoint, collisionGroup, looking ar
  9. Hey guys... got a couple of quick questions about raycasting... 1... Is recasting an 'Expensive Thing' for BabylonJS. I ask because in unity, a fully scripted player character might by casting 6 - 10 rays on each frame... One ray might be be checking ground distance... Four separate rays might be casting to the four near clip plane points of the camera to check for Collision and or occlusion and one ray might checking wall distance ... and so on... Now that apparently is FINE in Unity on a native platform... Would that many rays be TOO MUCH for a BabylonJS Game... ??? 2..
  10. Hello, Looking into the particle system, http://doc.babylonjs.com/overviews/solid_particle_system, Wondering... Can particles be detected with raycast? When trying this: var hitInfo = ray.intersectsMeshes(particleArray); Gets error: i.getWorldMatrix is not a function, and I see why... Tried: {isPickable: true}, same result. Guess: attempting to draw a line and use intersectsMesh()... Would that be a good approach, or other suggestions? UPDATE: dra
  11. My character fires a bullet and how far it goes depends on what it hits or passes through. Box2D and other physics engines have useful callbacks for collision detection for moving objects, but this bullet would be rendered instantaneously so I figured raytracing would be the solution. How would I go about doing this?
  12. Hi all, Having started with Phaser a few days ago, I can't find any example or documentation about raycasting. So, to explain what I'm after: For a simple platformer, I have a character that's shooting at enemies. But, I don't want the bullets to be objects (sprites), because of the fast speed (the collision check might fail). So I thought about using raycasting, and have the first enemy in the line of sight take damage. Or, in some case, every enemy in the line of sight (until a specific tile is hit, the end of the world is reached, or a specific distance). The ray is always horizonta
  13. Hi, I'm started to port an Box2dWeb/CreateJS prototype game to Phaser (just to test and compare). With Box2dWeb I was able to do a dynamic shadow for a 2D game plateform with a raycast like this : Is it possible to do same compute with the actual physics system ? I see on github that on next major release "Integration with an advanced physics system. We've been experimenting with p2.js but have yet to conclude our research.". I found nothing about raycast with p2.js, but may be it is in your experimentation ? Anyway congrats for phaser/pixi.js, always cool to see/test new tools
  14. "Time Flies Straight" a non-usual game of fractal time, Starring Carl Sagan. This was my entry for Ludum Dare 27 - a Wolf3D raycast-style adventure game. Wander the maze of fractal time searching for a precious few seconds to finish your quest. The game was pretty well received in the comp (ended up placing 23rd overall, which I was really happy about) and also got covered on a bunch of outlets - pcgamer.com, indiegames.com, and best was Indie Impressions - where the video got, like, 4000 views. Pretty cool! It's more of an "experience" than a game - certainly suffers from limited replayab
  • Create New...