group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
GripPose.hpp File Reference

Authored per-weapon hand grip poses (Phase C of the AAA IK overhaul). More...

#include <array>
#include <cstddef>
#include <glm/glm.hpp>
#include <glm/gtc/quaternion.hpp>
#include <string>
Include dependency graph for GripPose.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  GripPose
 Authored local-space finger angles describing how a hand wraps a weapon. More...
struct  WeaponGripPose
 Per-weapon pair of hand grip poses. More...

Functions

bool loadWeaponGripPose (const std::string &path, WeaponGripPose &out)
 Load a weapon grip pose from a TOML side-table.
bool saveWeaponGripPoseToml (const std::string &path, const WeaponGripPose &pose, bool rightHandValid, bool leftHandValid)
 Save a grip pose back to a TOML file.

Variables

constexpr std::size_t kGripPoseBonesPerFinger = 4
 Number of bones authored per finger.
constexpr std::size_t kGripPoseFingerCount = 5
 Number of fingers per hand: thumb, index, middle, ring, pinky.
constexpr std::size_t kGripPoseJointCount = kGripPoseBonesPerFinger * kGripPoseFingerCount
 Total joint count per hand grip pose (5 fingers × 4 joints = 20 joints).

Detailed Description

Authored per-weapon hand grip poses (Phase C of the AAA IK overhaul).

Function Documentation

◆ loadWeaponGripPose()

bool loadWeaponGripPose ( const std::string & path,
WeaponGripPose & out )

Load a weapon grip pose from a TOML side-table.

File format (pitch / yaw degrees per joint):

[right_hand.thumb]
joints = [[pitch, yaw], [pitch, yaw], [pitch, yaw], [pitch, yaw]]
[right_hand.index]
joints = [...]
# ... middle, ring, pinky
[left_hand.thumb]
joints = [...]
# ... (sections may be omitted; missing hand stays invalid + falls back
# to the animated finger pose at runtime)
Returns
True if the file parsed successfully (at least one hand valid).

◆ saveWeaponGripPoseToml()

bool saveWeaponGripPoseToml ( const std::string & path,
const WeaponGripPose & pose,
bool rightHandValid,
bool leftHandValid )

Save a grip pose back to a TOML file.

Writes the same shape the loader expects. Sections for a hand are omitted when the matching hand is invalid (so a single-hand TOML round-trips correctly). Returns false on filesystem failure; the caller is expected to log appropriately.

Variable Documentation

◆ kGripPoseBonesPerFinger

std::size_t kGripPoseBonesPerFinger = 4
inlineconstexpr

Number of bones authored per finger.

Mixamo finger chains are 4 joints long (thumb1..thumb4, etc.) — the last joint is the tip and is the rotation-bearing leaf even though it has no children of its own.

◆ kGripPoseFingerCount

std::size_t kGripPoseFingerCount = 5
inlineconstexpr

Number of fingers per hand: thumb, index, middle, ring, pinky.

◆ kGripPoseJointCount

std::size_t kGripPoseJointCount = kGripPoseBonesPerFinger * kGripPoseFingerCount
inlineconstexpr

Total joint count per hand grip pose (5 fingers × 4 joints = 20 joints).