Creates a new asteroid field around a given transform
The seed of the asteroid field
A parent transform node for the asteroids
The scene where the asteroid field exists
ReadonlyaverageReadonlyinnerReadonlyneighborReadonlyouterReadonlyparentReadonlypatchReadonlypatchReadonlyresolutionReadonlyrngReadonlysceneReadonlyseedReadonlyspreadReleases all held resources
Updates the asteroid field. The position of the camera is used to determine which chunks to load and unload. The delta seconds are used to fade in and out the chunks
The position of the camera in world space
The seconds elapsed since last frame
StaticCreateCreates a matrix buffer for an asteroid patch. The patch has a given square size, subdivided in cells by the resolution parameter. Each cell contains one instance. The min and max radius ensure the asteroid don't spread to far
The position of the patch in the local space of the parent transform of any field
The subdivision of the chunk, each cell contains a single instance
The overall planar size of the patch
The vertical spread of the patch
The minimum radius at which the field starts
The maximum radius at which the field ends
A random number generator
A new matrix 4x4 buffer
An asteroid field is basically a collection of instance chunks that can be created and destroyed depending on where the player is. This allows to only render the asteroids close to the player, saving immense resources.