Complete enough.

This commit is contained in:
2016-06-28 04:02:31 -04:00
parent cecd37420d
commit fecc196ae7
9 changed files with 211 additions and 95 deletions

View File

@@ -52,17 +52,6 @@ typedef struct PHERO_SENSOR {
probs[i] = 0.0f;
}
}
void set_probabilities() {
float phero_sum = 0.0f;
for(unsigned int i = 0; i < NUM_PHERO_SAMPLES; i++)
phero_sum += samples[i];
for(unsigned int i = 0; i < NUM_PHERO_SAMPLES; i++) {
probs[i] = 1.0f / (samples[i] / phero_sum);
}
}
float operator[](unsigned int index) {
if(index >= NUM_PHERO_SAMPLES)
@@ -78,12 +67,13 @@ public:
~PheromoneMap();
GLuint s_build_texture();
bool s_deposit_pheromone(float x, float y);
void s_deposit_pheromone(float x, float y, float yaw, float radius);
void s_evaporate();
void s_sample(phero_sensor_t * sensor, float x, float y, float yaw, float radius);
private:
unsigned char * data;
int * data;
unsigned char * tex_data;
unsigned m_width;
unsigned m_height;
unsigned char m_bpp;