rigSystems 0.1.1
RigKit pack API - rigSystems
Loading...
Searching...
No Matches
OrbitNav.h File Reference

Orbit camera navigation: tumble, pan, dolly, pivot picking, and framing. More...

#include <glm/glm.hpp>
#include "ecs/MEcs.h"
Include dependency graph for OrbitNav.h:

Classes

struct  rig::OrbitNavFrame
 One Update of cooked orbit input. More...
struct  rig::OrbitNavState
 Drag last-xy + pivot captured at press. More...

Functions

void rig::orbitNavigate (rigkit::MEcs &ecs, entt::entity cam, const OrbitNavFrame &frame, OrbitNavState &state)
 Apply orbit / pan / dolly to cam's COrbitDrive.
void rig::orbitApply (rigkit::MEcs &ecs, entt::entity cam)
 Pose CTransform from COrbitDrive (clamps pitch / radius).
glm::vec3 rig::orbitPickPivot (rigkit::MEcs &ecs, entt::entity cam, float ndcX, float ndcY, float aspect)
 World pivot under a viewport point, for OrbitNavFrame::pivot.
bool rig::orbitFrame (rigkit::MEcs &ecs, entt::entity cam, const glm::vec3 &bmin, const glm::vec3 &bmax)
 Fit the orbit to a world AABB.
bool rig::orbitFrameMeshes (rigkit::MEcs &ecs, entt::entity cam)
 Frame selected triangle meshes, or all of them if none are selected.
void rig::orbitFromView (rigkit::ecs::COrbitDrive &orbit, const glm::mat4 &view, rigkit::ecs::CTransform &camXf)
 Write a view matrix back onto orbit + camera transform (view cube).

Detailed Description

Orbit camera navigation: tumble, pan, dolly, pivot picking, and framing.

Nothing here reads input devices - the app fills an OrbitNavFrame each frame and owns the OrbitNavState that carries a drag between frames.

Function Documentation

◆ orbitApply()

void rig::orbitApply ( rigkit::MEcs & ecs,
entt::entity cam )

Pose CTransform from COrbitDrive (clamps pitch / radius).

Writes near / far from the standoff so ortho zoom cannot hide the scene behind the clip planes.

◆ orbitFrame()

bool rig::orbitFrame ( rigkit::MEcs & ecs,
entt::entity cam,
const glm::vec3 & bmin,
const glm::vec3 & bmax )

Fit the orbit to a world AABB.

Returns
false when the box is empty.

◆ orbitFrameMeshes()

bool rig::orbitFrameMeshes ( rigkit::MEcs & ecs,
entt::entity cam )

Frame selected triangle meshes, or all of them if none are selected.

Skips line meshes (grids). Calls SHierarchy first.

◆ orbitNavigate()

void rig::orbitNavigate ( rigkit::MEcs & ecs,
entt::entity cam,
const OrbitNavFrame & frame,
OrbitNavState & state )

Apply orbit / pan / dolly to cam's COrbitDrive.

Turns auto-orbit off while dragging or wheeling. Ortho zoom is orthoHeight, not a walk into the scene. No-op without COrbitDrive + CTransform. Does not read GLFW.

◆ orbitPickPivot()

glm::vec3 rig::orbitPickPivot ( rigkit::MEcs & ecs,
entt::entity cam,
float ndcX,
float ndcY,
float aspect )

World pivot under a viewport point, for OrbitNavFrame::pivot.

Casts the pixel ray from cam (ndcX / ndcY in -1..1, +Y up; works for perspective and ortho). Returns the ground-plane hit (Y = 0) when the ray lands there in front of the camera at sane range - a grazing ray would put the pivot near the horizon - otherwise falls back to the view plane through COrbitDrive::target.