Explosions and TNT block and entity
#27
Now I see why the pattern shows so much regularity in the cardinal directions, and also some other directions (you can see that in the stone picture much more clearly).
I think you've misunderstood the concept of rays. The point is to cast a bunch of rays and then process whatever they hit. Instead, you create a ray for each block in the range. This skews the chances for the blocks that are on coords that are integer-multiples of other integers relative to the explosion center.

Also, you've created an O(N^3) algorithm (where N is the size of the explosion). However, the rays should be only an O(N^2) algorithm - project them only at the walls of the cube, not the internals. You'll end up with a faster thing and a better looking result Smile

Side note for your code - it doesn't do any blockentity checking, so things like chests and furnaces will break without spilling their items. Whether this is expected behavior or not I leave upon you.
Reply
Thanks given by:


Messages In This Thread
Explosions and TNT block and entity - by keyboard - 04-18-2013, 12:54 PM
RE: Explosions and TNT block and entity - by xoft - 04-18-2013, 05:45 PM
RE: Explosions and TNT block and entity - by xoft - 04-18-2013, 11:32 PM
RE: Explosions and TNT block and entity - by xoft - 04-19-2013, 06:28 PM
RE: Explosions and TNT block and entity - by xoft - 04-21-2013, 05:49 AM
RE: Explosions and TNT block and entity - by xoft - 04-21-2013, 06:14 AM
RE: Explosions and TNT block and entity - by xoft - 04-21-2013, 06:46 AM
RE: Explosions and TNT block and entity - by xoft - 03-09-2014, 04:03 AM
RE: Explosions and TNT block and entity - by xoft - 03-09-2014, 06:27 AM



Users browsing this thread: 2 Guest(s)