Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17825

Object placement in O(1)

$
0
0
Today I started implementing Poisson Disc generator, however halfway through the implementation I realized this was not what I was using 5 years ago. First off, while I can implement this with a min and max radius, it doesn't help me fill in the void (so to speak) if I should generate a wrappable array from this data. So, this is what I need to know the name of: 1. The algorithm probaby uses poisson-disc to start with 2. It then creates a power-of-2 sized array 3. It fills the array with radius-values, distanced so that if you access the array at any position modulo the array size, you can use lequal to know if you can place your object. An example row: [1, 2, 3, 2, 1, 2, 6, 2, 1, 2, ...] <-- if i remembered the specifics I wouldnt be asking 4. This is O(1) because an object can be try_placed with `array(wrap(x), wrap(y)) < radius` Anyone know the name of this procedure? Any help would be appreciated.

Viewing all articles
Browse latest Browse all 17825

Trending Articles