Skip to content

MOTOR DE GESTOS V11.0 - "MINORITY REPORT #49

@LVT-ENG

Description

@LVT-ENG

/** 🛡️ MOTOR DE GESTOS V11.0 - "MINORITY REPORT"

  • PATENTE: PCT/EP2025/067317
  • Optimizado para: Rendimiento 60fps & Cero Falsos Positivos
    */

const GESTURE_CONFIG = {
SNAP_THRESHOLD: 0.05, // Umbral de cercanía en 3D
STABILITY_FRAMES: 3, // Cuántos frames debe durar el contacto
COOLDOWN_MS: 2000 // Evitar compras dobles
};

let snapFrameCount = 0;
let lastTriggerTime = 0;

export const detectSovereignSnap = (handLandmarks) => {
if (!handLandmarks) return false;

const now = Date.now();
if (now - lastTriggerTime < GESTURE_CONFIG.COOLDOWN_MS) return false;

const thumb = handLandmarks[4]; // Pulgar
const middle = handLandmarks[12]; // Corazón

// 1. Cálculo en Espacio 3D (Z Incluido) - Recomendación Auditoría 1
const dist = Math.hypot(
thumb.x - middle.x,
thumb.y - middle.y,
(thumb.z || 0) - (middle.z || 0)
);

// 2. Filtro de Estabilidad - Recomendación Auditoría 2
if (dist < GESTURE_CONFIG.SNAP_THRESHOLD) {
snapFrameCount++;
if (snapFrameCount >= GESTURE_CONFIG.STABILITY_FRAMES) {
snapFrameCount = 0;
lastTriggerTime = now;
return true; // PA, PA, PA.
}
} else {
snapFrameCount = 0;
}

return false;
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions