This class is rendering multiple circles (called bubbles in the paper) that are randomly placed on the screen space, the radius of the circle is as big as the distance to the nearest tank.
More...
|
| BubbleCursor (Scene *scene, Texture *texture) |
|
virtual | ~BubbleCursor () |
|
void | draw () |
|
void | setShader (Shader *shader) |
|
void | update (double deltaT) |
|
void | updateDistanceState (unsigned int _distance) |
|
void | generateRandomPopulation () |
|
void | keyCallback (GLFWwindow *window, int key, int scancode, int action, int mode) |
|
bool | drawingEnabled () |
|
unsigned int | getDistance () |
|
| SceneObject (std::shared_ptr< SceneObject > &effectParent, const glm::mat4 &modelMatrix=glm::mat4(1)) |
|
| SceneObject (const std::string &name, Scene *scene=0, Model *model=0, const glm::mat4 &modelMatrix=glm::mat4(1)) |
|
virtual | ~SceneObject () |
|
Model * | getModel () const |
|
Shader * | getShader () const |
|
glm::mat4 | getModelMatrix () const |
|
glm::mat4 | getGlobalModelMatrix () const |
|
std::string | getName () const |
|
std::shared_ptr< SceneObject > | getParent () const |
|
void | setAnimationTime (double time) |
|
bool | setAnimation (const Animation &anim) |
|
bool | delChild (size_t idx) |
|
bool | getChild (size_t idx, std::shared_ptr< SceneObject > &child) const |
|
bool | addChild (std::shared_ptr< SceneObject > &child) |
|
bool | remEffect (const std::string &name) |
|
SceneObject * | getEffect (const std::string &name) const |
|
bool | addEffect (const std::string &name, std::unique_ptr< SceneObject > &effect) |
|
bool | doNotRender () |
|
bool | getIsVolSun () |
|
virtual void | reset () |
|
virtual void | draw () const |
|
virtual bool | animate (double time) |
|
This class is rendering multiple circles (called bubbles in the paper) that are randomly placed on the screen space, the radius of the circle is as big as the distance to the nearest tank.
The class BubbleCursor implements the rendering of circles (=bubbles in the paper) that are randomly placed on the screen with the radius as big as the distance to the nearest object.
In the method generateRandomPopulation() 50 points are generated at random that are distributed across the screen space. These 2d points are generated using two Gaussian distributions centered at windowWidth/2 and windowHeight/2 (middle of the screen), with a sigma value of windowWidth/5 and windowHeight/5. The objects used were:
std::default_random_engine generator(time(NULL));
std::normal_distribution<double> distributionY(height / 2.0f, height / 5.0f);
std::normal_distribution<double> distributionX(width / 2.0f, width / 5.0f);
for further details see the function generateRandomPopulation().
In the draw() function the positions of those points are then forwarded to the pickObject method in the class SelectorQuadTree where the distance to the closest object (for each point separately) is computed. A point sprite renderer is then used to draw a transparent circle onto the screen. The radius of the circle is scaled to conicide with the distance to the nearest object (in pixels).
The user can enable/disable the display of these bubbles with the key B, everytime the display of the bubbles is disabled and enabled another random population is created. Rendering all bubbles consumes a huge amount of CPU load since for each of the 50 points the quadtree needs to be queried.
The result looks like:
bubble cursor
bubble cursor
- Author
- Felix Koenig