PatchGrid is a class which allows you to create "patches". A Patch is a non-physical object which is associated with a specific area in the 3D world. This allows you to associate information or actions with specific areas in space, such as the presence of a chemical or nutrient at that area.Use init-with to create a PatchGrid.
Disables smooth drawing for this PatchGrid. This is the default. See enable-smooth-drawing for details on smooth drawing.
Disables volumetric drawing for this PatchGrid. The grid is drawn as individual cubes. This technique may produce better results visually, but is far slower than the volumetric rendering. See enable-volumetric-drawing for more details.
Enables smooth drawing for this PatchGrid. When smooth drawing is enabled, colors are blended smoothly between patches. Smooth drawing is disabled by default.
Smooth drawing is desirable when a PatchGrid's colors display continuous gradients as with chemicals or temperature, but is undesirable when dealing with discrete states, as in cellular automata simulations.
The method disable-smooth-drawing can be used to disable smooth drawing.
Enables texture drawing for this PatchGrid. This is the default. With volumetric rendering, the grid is drawn as a series of overlapping textured planes. The rendering is fast, but the overlapping planes may leave some visual artifacts. To revert to the older style of cube rendering, see the method disable-volumetric-drawing.
returns the center of the grid.
Returns the Patch in which theLocation resides. Make sure you test for the validity of the returned object, since it is possible that there is no patch at the specified location.
Returns the patch object associated with the specified indices. Note that this method may return a NULL object in the case that the indices given are out of bounds.
Returns the vector size of a single patch.
Returns a list of all patch objects.
If the grid is initialized, returns the size of the grid on the X-axis.
If the grid is initialized, returns the size of the grid on the Y-axis.
If the grid is initialized, returns the size of the grid on the Z-axis.
Creates a PatchGrid centered at center, in which each Patch is a member of patchclass and is the size pSize and in which the total grid dimensions are x by y by z.
Bear in mind that this will create a large number of objects: x * y * z. If you have an iterate method in your patch-class, then this can amount to a great deal of computation which can slow down your simulation.