MCPcopy Create free account
hub / github.com/StereoKit/StereoKit / ui_push_surface

Function ui_push_surface

StereoKitC/ui/ui_core.cpp:606–623  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

604///////////////////////////////////////////
605
606void ui_push_surface(pose_t surface_pose, vec3 layout_start, vec2 layout_dimensions) {
607 vec3 right = surface_pose.orientation * vec3_right;
608 matrix trs = matrix_trs(surface_pose.position + right*layout_start, surface_pose.orientation);
609 hierarchy_push(trs);
610
611 skui_layers.add(layer_t{});
612 ui_layout_push(layout_start, layout_dimensions, true);
613
614 layer_t* layer = &skui_layers.last();
615 const matrix *to_local = hierarchy_to_local();
616 for (int32_t i = 0; i < handed_max; i++) {
617 layer->finger_pos [i] = skui_hand[i].finger = matrix_transform_pt(*to_local, skui_hand[i].finger_world);
618 layer->finger_prev [i] = skui_hand[i].finger_prev = matrix_transform_pt(*to_local, skui_hand[i].finger_world_prev);
619 layer->thumb_pos [i] = skui_hand[i].thumb = matrix_transform_pt(*to_local, skui_hand[i].thumb_world);
620 layer->pinch_pt_pos [i] = skui_hand[i].pinch_pt = matrix_transform_pt(*to_local, skui_hand[i].pinch_pt_world);
621 layer->pinch_pt_prev[i] = skui_hand[i].pinch_pt_prev = matrix_transform_pt(*to_local, skui_hand[i].pinch_pt_world_prev);
622 }
623}
624
625///////////////////////////////////////////
626

Callers 2

ui_stepFunction · 0.85
_ui_handle_beginFunction · 0.85

Calls 6

matrix_trsFunction · 0.85
hierarchy_pushFunction · 0.85
ui_layout_pushFunction · 0.85
hierarchy_to_localFunction · 0.85
matrix_transform_ptFunction · 0.85
addMethod · 0.80

Tested by

no test coverage detected