As I mentioned in the previous post, I have been working on
fire grids and I wanted to post some updates on my progress.
To start things off I created two main classes: FireGrid and
GridCell; a fire grid is simply a 2D array of GridCell instances that also
provides utility methods to get a specific cell from a coordinate or to get the
neighbours of the provided cell.
I will be using an expression to simulate the logic and I
decided to structure my code so that everything happens in steps: those are
going to be calculated and executed every frame through an expression that
calls some python code and that’s where most of the logic is going to lie.
In order to test things out I create a polyCube instance for
each Cell and I have added some global variables to regulate both the cell size
and the grid size: those will be exposed later on by the tool I will be writing
to allow the user to tweak the simulation based on how big the scene is going
to be.
For the next week my plan is to research and find a way to
specify a material for each cell, one of the methods I have in mind to solve it
would be raycasting but I would need to research this further and look at the
documentation to find out if it’s possible to do so.