15. Raycasting in BabylonJS
Raycasting is incredibly useful for detecting other objects using a "ray". These are commonly used for "hitscan" weapons in first-person shooters. Raycasting creates an invisible line within our scene that we can use to detect other meshes. We can then get specifics about what we hit to include the exact Vector3 position of the hit, what mesh we hit, or even just check for a generic hit. BabylonJS: https://www.babylonjs.com/ Github Code Repo (15_Raycasting): https://github.com/Babylon-Projects/Babylon_101/tree/15_Raycasting Paint Splatters: superawesomevectors.com/paintball-splatters/ Chapters: 0:00 Intro 0:25 Code Overview 2:04 Create Textures Method 6:55 Raycast Overview 7:50 Create Picking Ray Method 12:05 Creating Decals Dynamically 18:02 Adding Raycast Impulse 19:55 Parenting Decals 20:47 Adding Mass #babylonjs #typescript #tutorial
Download
0 formatsNo download links available.