Commit 4659e490 authored by Aaron Kreuzberg's avatar Aaron Kreuzberg
Browse files

glow-extras changes, change of variable names

parent 84a6505a
Pipeline #18544 passed with stage
in 19 minutes and 58 seconds
glow-extras @ 6d4ea260
Subproject commit c1cffa010f80ab1327996c2bbe6f8bb748fae438
Subproject commit 6d4ea26072854d9ca74d9249b6654823c965e013
imgui @ 8ca0ab36
Subproject commit fcf73e7562f82dca7de2e66666e77cbbcc38be5b
Subproject commit 8ca0ab36f8a5072b8dfaf569646233166f507c84
......@@ -31,18 +31,18 @@ void simple_picking(pm::Mesh& m, pm::vertex_attribute<tg::pos3>& pos, pm::face_a
{
{
// In this case a Picker is defined for the Renderable (Picking Texture filled) but no callback will be executed.
gv::view(pos, col, gv::Picker::pick(), "Picker defined without callback");
gv::view(pos, col, gv::pick(), "Picker defined without callback");
}
{
// Only on_left_click callback defined
gv::view(pos, col, gv::Picker::pick().onLeftClick([&](pm::face_index face_id, tg::pos3 world_pos, tg::vec3 normal) -> picking_result {
gv::view(pos, col, gv::pick().onLeftClick([&](pm::face_index face_id, tg::pos3 world_pos, tg::vec3 normal) -> picking_result {
std::cout << "Something has been picked! ON_LEFT_CLICK"
<< "ID: " << (int)face_id << std::endl;
std::cout << "World_Position " << world_pos << std::endl;
std::cout << "Normal " << normal << std::endl;
picking_result res;
res.picking_color = tg::color3::cyan;
res.mPickingColor = tg::color3::cyan;
return res;
}),
"simple picking: callback on left click");
......@@ -50,7 +50,7 @@ void simple_picking(pm::Mesh& m, pm::vertex_attribute<tg::pos3>& pos, pm::face_a
{
// Only on_left_click callback defined - LineRenderable - uncolored
gv::view(gv::lines(pos), gv::Picker::pick().onLeftClick([&](pm::face_index face_id, tg::pos3 world_pos, tg::vec3 normal) {
gv::view(gv::lines(pos), gv::pick().onLeftClick([&](pm::face_index face_id, tg::pos3 world_pos, tg::vec3 normal) {
std::cout << "Something has been picked! ON_LEFT_CLICK"
<< "ID: " << int(face_id) << std::endl;
std::cout << "World_Position" << world_pos << std::endl;
......@@ -73,7 +73,7 @@ void simple_picking(pm::Mesh& m, pm::vertex_attribute<tg::pos3>& pos, pm::face_a
pos2.copy_from(pos);
gv::interactive([&](auto) {
gv::view(pos2, col, gv::Picker::pick().onLeftClick([&](pm::face_index face_id, tg::pos3 world_pos, tg::vec3 normal) {
gv::view(pos2, col, gv::pick().onLeftClick([&](pm::face_index face_id, tg::pos3 world_pos, tg::vec3 normal) {
std::cout << "Something has been picked! ON_LEFT_CLICK"
<< "ID: " << int(face_id) << std::endl;
std::cout << "World_Position" << world_pos << std::endl;
......@@ -127,7 +127,7 @@ void simple_picking(pm::Mesh& m, pm::vertex_attribute<tg::pos3>& pos, pm::face_a
gv::interactive([&](auto) {
gv::view(gv::points(pos2),
gv::Picker::pick().onLeftClick([&vertex_index_i, &world_pos_i, &normal_i](pm::vertex_index vertex_id, tg::pos3 world_pos, tg::vec3 normal) {
gv::pick().onLeftClick([&vertex_index_i, &world_pos_i, &normal_i](pm::vertex_index vertex_id, tg::pos3 world_pos, tg::vec3 normal) {
std::cout << "Something has been picked! ON_LEFT_CLICK"
<< "ID: " << int(vertex_id) << std::endl;
std::cout << "World_Position" << world_pos << std::endl;
......@@ -166,7 +166,7 @@ void simple_picking(pm::Mesh& m, pm::vertex_attribute<tg::pos3>& pos, pm::face_a
{
// Only on_left_click callback defined - PointRenderable - uncolored
gv::view(gv::points(pos), gv::Picker::pick().onLeftClick([&](pm::vertex_index vertex_id, tg::pos3 world_pos, tg::vec3 normal) {
gv::view(gv::points(pos), gv::pick().onLeftClick([&](pm::vertex_index vertex_id, tg::pos3 world_pos, tg::vec3 normal) {
std::cout << "Something has been picked! ON_LEFT_CLICK"
<< "ID: " << int(vertex_id) << std::endl;
std::cout << "World_Position" << world_pos << std::endl;
......@@ -179,7 +179,7 @@ void simple_picking(pm::Mesh& m, pm::vertex_attribute<tg::pos3>& pos, pm::face_a
{
// Only on_left_click callback defined - PointRenderable - uncolored - square billboards - NOT WORKING APPROPRIATELY
gv::view(gv::points(pos).point_size_world(0.03f).camera_facing().square(),
gv::Picker::pick().onLeftClick([&](pm::vertex_index vertex_id, tg::pos3 world_pos, tg::vec3 normal) {
gv::pick().onLeftClick([&](pm::vertex_index vertex_id, tg::pos3 world_pos, tg::vec3 normal) {
std::cout << "Something has been picked! ON_LEFT_CLICK"
<< "ID: " << int(vertex_id) << std::endl;
std::cout << "World_Position" << world_pos << std::endl;
......@@ -191,7 +191,7 @@ void simple_picking(pm::Mesh& m, pm::vertex_attribute<tg::pos3>& pos, pm::face_a
{
// Only on_right_click callback defined
gv::view(pos, col, gv::Picker::pick().onRightClick([&](pm::face_index face_id, tg::pos3 world_pos, tg::vec3 normal) {
gv::view(pos, col, gv::pick().onRightClick([&](pm::face_index face_id, tg::pos3 world_pos, tg::vec3 normal) {
std::cout << "Something has been picked! ON_RIGHT_CLICK"
<< "ID: " << int(face_id) << std::endl;
return;
......@@ -201,7 +201,7 @@ void simple_picking(pm::Mesh& m, pm::vertex_attribute<tg::pos3>& pos, pm::face_a
{
// Only on_hover callback defined
gv::view(pos, col, gv::Picker::pick().onHover([&](pm::face_index face_id, tg::pos3 world_pos, tg::vec3 normal) {
gv::view(pos, col, gv::pick().onHover([&](pm::face_index face_id, tg::pos3 world_pos, tg::vec3 normal) {
std::cout << "Something has been picked! ON_HOVER"
<< "ID: " << (int)face_id << std::endl;
return;
......@@ -212,7 +212,7 @@ void simple_picking(pm::Mesh& m, pm::vertex_attribute<tg::pos3>& pos, pm::face_a
{
// On_hover, on_right_click, and on_left_click callbacks defined simultaneously
gv::view(pos, col,
gv::Picker::pick()
gv::pick()
.onLeftClick([&](pm::face_index face_id, tg::pos3 world_pos, tg::vec3 normal) {
std::cout << "Something has been picked! ON_LEFT_CLICK"
<< "ID: " << int(face_id) << std::endl;
......@@ -242,13 +242,13 @@ void simple_picking(pm::Mesh& m, pm::vertex_attribute<tg::pos3>& pos, pm::face_a
fa[f] = 1000 + i;
i++;
}
gv::view(pos, col, gv::Picker::pick(fa).onLeftClick([&](pm::face_index face_id, tg::pos3 world_pos, tg::vec3 normal) -> picking_result {
gv::view(pos, col, gv::pick(fa).onLeftClick([&](pm::face_index face_id, tg::pos3 world_pos, tg::vec3 normal) -> picking_result {
std::cout << "Something has been picked! ON_LEFT_CLICK"
<< "ID: " << (int)face_id << std::endl;
std::cout << "World_Position" << world_pos << std::endl;
std::cout << "Normal" << normal << std::endl;
picking_result res;
res.picking_color = tg::color3::cyan;
res.mPickingColor = tg::color3::cyan;
return res;
}),
"simple picking: callback on left click - user-defined IDs");
......@@ -258,13 +258,13 @@ void simple_picking(pm::Mesh& m, pm::vertex_attribute<tg::pos3>& pos, pm::face_a
auto v = gv::view(pos, "Multiple renderables");
// Check multiple Renderables.
gv::view(pos, gv::Picker::pick().onLeftClick([&](pm::face_index face_id, tg::pos3 world_pos, tg::vec3 normal) -> picking_result {
gv::view(pos, gv::pick().onLeftClick([&](pm::face_index face_id, tg::pos3 world_pos, tg::vec3 normal) -> picking_result {
std::cout << "Something has been picked! PICKER 1 "
<< "ID: " << (int)face_id << std::endl;
std::cout << "World_Position" << world_pos << std::endl;
std::cout << "Normal" << normal << std::endl;
picking_result res;
res.picking_color = tg::color3::cyan;
res.mPickingColor = tg::color3::cyan;
return res;
}));
......@@ -279,13 +279,13 @@ void simple_picking(pm::Mesh& m, pm::vertex_attribute<tg::pos3>& pos, pm::face_a
pos2[p] = pos2[p] + tg::vec3(2, 2, 2);
}
gv::view(pos2, gv::Picker::pick().onLeftClick([&](pm::face_index face_id, tg::pos3 world_pos, tg::vec3 normal) -> picking_result {
gv::view(pos2, gv::pick().onLeftClick([&](pm::face_index face_id, tg::pos3 world_pos, tg::vec3 normal) -> picking_result {
std::cout << "Something has been picked! PICKER 2 "
<< "ID: " << (int)face_id << std::endl;
std::cout << "World_Position" << world_pos << std::endl;
std::cout << "Normal" << normal << std::endl;
picking_result res;
res.picking_color = tg::color3::cyan;
res.mPickingColor = tg::color3::cyan;
return res;
}));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment