MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / _notification

Method _notification

modules/gridmap/grid_map.cpp:1036–1094  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1034}
1035
1036void GridMap::_notification(int p_what) {
1037 switch (p_what) {
1038 case NOTIFICATION_ENTER_WORLD: {
1039 last_transform = get_global_transform();
1040
1041 for (const KeyValue<OctantKey, Octant *> &E : octant_map) {
1042 _octant_enter_world(E.key);
1043 }
1044
1045 for (int i = 0; i < baked_meshes.size(); i++) {
1046 RS::get_singleton()->instance_set_scenario(baked_meshes[i].instance, get_world_3d()->get_scenario());
1047 RS::get_singleton()->instance_set_transform(baked_meshes[i].instance, get_global_transform());
1048 }
1049 } break;
1050
1051 case NOTIFICATION_ENTER_TREE: {
1052#if defined(DEBUG_ENABLED) && !defined(NAVIGATION_3D_DISABLED)
1053 if (bake_navigation && NavigationServer3D::get_singleton()->get_debug_navigation_enabled()) {
1054 _update_navigation_debug_edge_connections();
1055 }
1056#endif // defined(DEBUG_ENABLED) && !defined(NAVIGATION_3D_DISABLED)
1057 _update_visibility();
1058 } break;
1059
1060 case NOTIFICATION_TRANSFORM_CHANGED: {
1061 Transform3D new_xform = get_global_transform();
1062 if (new_xform == last_transform) {
1063 break;
1064 }
1065 //update run
1066 for (const KeyValue<OctantKey, Octant *> &E : octant_map) {
1067 _octant_transform(E.key);
1068 }
1069
1070 last_transform = new_xform;
1071
1072 for (int i = 0; i < baked_meshes.size(); i++) {
1073 RS::get_singleton()->instance_set_transform(baked_meshes[i].instance, get_global_transform());
1074 }
1075 } break;
1076
1077 case NOTIFICATION_EXIT_WORLD: {
1078 for (const KeyValue<OctantKey, Octant *> &E : octant_map) {
1079 _octant_exit_world(E.key);
1080 }
1081
1082 //_queue_octants_dirty(MAP_DIRTY_INSTANCES|MAP_DIRTY_TRANSFORMS);
1083 //_update_octants_callback();
1084 //_update_area_instances();
1085 for (int i = 0; i < baked_meshes.size(); i++) {
1086 RS::get_singleton()->instance_set_scenario(baked_meshes[i].instance, RID());
1087 }
1088 } break;
1089
1090 case NOTIFICATION_VISIBILITY_CHANGED: {
1091 _update_visibility();
1092 } break;
1093 }

Callers

nothing calls this directly

Calls 6

RIDClass · 0.85
instance_set_scenarioMethod · 0.80
get_scenarioMethod · 0.80
sizeMethod · 0.65

Tested by

no test coverage detected