Serious Game - Electrónica VR 1.0.0
Loading...
Searching...
No Matches
MouseGrabSimulator Class Reference

Simula la mano VR del Explorador usando el mouse. Permite agarrar, mover y soltar componentes sin Meta Quest. More...

Inheritance diagram for MouseGrabSimulator:
Inheritance graph
Collaboration diagram for MouseGrabSimulator:
Collaboration graph

Public Attributes

float maxGrabDistance = 10f
float holdDistance = 1.5f
float followSpeed = 15f
float scrollSpeed = 0.5f
float lookSpeed = 2f
float moveSpeed = 3f

Private Member Functions

void Start ()
void Update ()
void FixedUpdate ()
void HandleGrab ()
void TryGrab ()
void Release ()
void MoveHeldObject ()
void HandleScroll ()
void HandleCameraMovement ()

Private Attributes

GameObject _heldObject
bool _isHolding = false
Camera _cam
Rigidbody _heldRb
float _currentDistance
float _rotX
float _rotY

Detailed Description

Simula la mano VR del Explorador usando el mouse. Permite agarrar, mover y soltar componentes sin Meta Quest.

CONTROLES: Click izquierdo en un objeto → lo agarra (sigue al mouse) Click izquierdo en vacío → suelta el objeto Scroll → acercar/alejar el objeto agarrado

SETUP:

  1. Agregar este script a la ExplorerCamera
  2. Asegurarse que los objetos a agarrar tienen Collider + Rigidbody
  3. Los prefabs de componentes entregados necesitan Rigidbody

NOTA: Este script es SOLO para testing sin VR. Eliminarlo antes de la build final con Meta Quest.

Member Function Documentation

◆ FixedUpdate()

void MouseGrabSimulator.FixedUpdate ( )
private

◆ HandleCameraMovement()

void MouseGrabSimulator.HandleCameraMovement ( )
private

◆ HandleGrab()

void MouseGrabSimulator.HandleGrab ( )
private

◆ HandleScroll()

void MouseGrabSimulator.HandleScroll ( )
private

◆ MoveHeldObject()

void MouseGrabSimulator.MoveHeldObject ( )
private

◆ Release()

void MouseGrabSimulator.Release ( )
private

◆ Start()

void MouseGrabSimulator.Start ( )
private

◆ TryGrab()

void MouseGrabSimulator.TryGrab ( )
private

◆ Update()

void MouseGrabSimulator.Update ( )
private

Member Data Documentation

◆ _cam

Camera MouseGrabSimulator._cam
private

◆ _currentDistance

float MouseGrabSimulator._currentDistance
private

◆ _heldObject

GameObject MouseGrabSimulator._heldObject
private

◆ _heldRb

Rigidbody MouseGrabSimulator._heldRb
private

◆ _isHolding

bool MouseGrabSimulator._isHolding = false
private

◆ _rotX

float MouseGrabSimulator._rotX
private

◆ _rotY

float MouseGrabSimulator._rotY
private

◆ followSpeed

float MouseGrabSimulator.followSpeed = 15f

◆ holdDistance

float MouseGrabSimulator.holdDistance = 1.5f

◆ lookSpeed

float MouseGrabSimulator.lookSpeed = 2f

◆ maxGrabDistance

float MouseGrabSimulator.maxGrabDistance = 10f

◆ moveSpeed

float MouseGrabSimulator.moveSpeed = 3f

◆ scrollSpeed

float MouseGrabSimulator.scrollSpeed = 0.5f

The documentation for this class was generated from the following file: