wonder Expert Licensed User Longtime User Nov 15, 2016 #1 I almost had a brain meltdown porting this into B4x... So far it appear to work as expected... Give it a try. Controls: [Left-Click] Draw blocks [Right-Click] Activate raycasting [Right-Drag] Move light source Note: Casting from inside a block looks broken, but it's an intentional speed-up. Attachments raycaster.jar raycaster.jar 323.2 KB · Views: 713
I almost had a brain meltdown porting this into B4x... So far it appear to work as expected... Give it a try. Controls: [Left-Click] Draw blocks [Right-Click] Activate raycasting [Right-Drag] Move light source Note: Casting from inside a block looks broken, but it's an intentional speed-up.
wonder Expert Licensed User Longtime User Nov 15, 2016 #3 No, no, not at all... Give it a try and you'll understand!
ilan Expert Licensed User Longtime User Nov 15, 2016 #4 nice, if you want to simulate a grenade explosion then you can use it to see where is a wall and no force will go through it so if a player stand behind that wall he wont get hit by the grenade only who is in the range of the yellow lines.
nice, if you want to simulate a grenade explosion then you can use it to see where is a wall and no force will go through it so if a player stand behind that wall he wont get hit by the grenade only who is in the range of the yellow lines.
wonder Expert Licensed User Longtime User Nov 15, 2016 #5 ilan said: to simulate a grenade explosion Click to expand... Yes, you can use raycasting for lots of things, but what I'm really after, is lighting effects...
ilan said: to simulate a grenade explosion Click to expand... Yes, you can use raycasting for lots of things, but what I'm really after, is lighting effects...
melonZgz Active Member Licensed User Longtime User Nov 15, 2016 #6 And if you use Box2D you have the awesome box2DLights, with raycasting, light type, shadows... (C'mon @wonder , you know that someday you'll try box2d)
And if you use Box2D you have the awesome box2DLights, with raycasting, light type, shadows... (C'mon @wonder , you know that someday you'll try box2d)
wonder Expert Licensed User Longtime User Nov 15, 2016 #8 Maybe one day... but I really like writing and tweaking my own code. So, if everything goes well, I'll rewrite this algorithm in C++ and I'll implement it in my project.
Maybe one day... but I really like writing and tweaking my own code. So, if everything goes well, I'll rewrite this algorithm in C++ and I'll implement it in my project.