#include "exman.h"
#include "blob_exhibit.h"
#include "dbg_gui.h"
+#include "geomdraw.h"
#define NEAR_CLIP 5.0
#define FAR_CLIP 10000.0
static long prev_msec;
static ExhibitManager *exman;
-static BlobExhibit *blobs;
static bool show_blobs;
ExSelection exsel_active, exsel_hover;
}
*/
- blobs = new BlobExhibit;
- blobs->node = new SceneNode;
- blobs->init();
- blobs->node->set_position(Vec3(-680, 160, -100));
- blobs->node->set_scaling(Vec3(28, 28, 28));
- blobs->node->update(0);
-
- exman->add(blobs);
-
if(!(sdr_ltmap_notex = create_program_load("sdr/lightmap.v.glsl", "sdr/lightmap-notex.p.glsl"))) {
return false;
}
}
*/
+ if(debug_gui && dbg_sel_node) {
+ AABox bvol = dbg_sel_node->get_bounds();
+ draw_geom_object(&bvol);
+ }
+
if(show_walk_mesh && mscn->walk_mesh) {
glPushAttrib(GL_ENABLE_BIT);
glEnable(GL_BLEND);
} else {
if(exsel_grab_mouse) {
// cancel grab on mouse release
- debug_log("releasing...\n");
Exhibit *ex = exsel_grab_mouse.ex;
Vec3 pos = exslot_mouse.node.get_position();
- debug_log("release location: %g %g %g\n", pos.x, pos.y, pos.z);
- ExhibitSlot *slot = exman->nearest_empty_slot(pos);
+ debug_log("releasing at %g %g %g ...\n", pos.x, pos.y, pos.z);
+
+ exslot_mouse.detach_exhibit();
+
+ ExhibitSlot *slot = exman->nearest_empty_slot(pos, 100);
if(!slot) {
- debug_log("no nearby slot\n");
+ debug_log("no empty slot nearby\n");
if(ex->prev_slot && ex->prev_slot->empty()) {
slot = ex->prev_slot;
- debug_log("previous slot available though\n");
+ debug_log("using previous slot");
}
}