| 131 | void sample_engine_performance::on_window_resize(int2 size) {} |
| 132 | |
| 133 | void sample_engine_performance::on_input(const app_input_event & event) |
| 134 | { |
| 135 | flycam.handle_input(event); |
| 136 | imgui->update_input(event); |
| 137 | |
| 138 | if (event.type == app_input_event::MOUSE && event.action == GLFW_RELEASE) |
| 139 | { |
| 140 | if (event.value[0] == GLFW_MOUSE_BUTTON_LEFT) |
| 141 | { |
| 142 | const ray r = cam.get_world_ray(event.cursor, float2(static_cast<float>(event.windowSize.x), static_cast<float>(event.windowSize.y))); |
| 143 | |
| 144 | if (length(r.direction) > 0) |
| 145 | { |
| 146 | entity_hit_result result = scene.get_collision_system()->raycast(r); |
| 147 | if (result.r.hit) |
| 148 | { |
| 149 | base_object & hit_obj = scene.get_graph().get_object(result.e); |
| 150 | material_component * mc = hit_obj.get_component<material_component>(); |
| 151 | mc->material = material_handle("renderer-wireframe"); |
| 152 | } |
| 153 | } |
| 154 | } |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | void sample_engine_performance::on_update(const app_update_event & e) |
| 159 | { |
nothing calls this directly
no test coverage detected