void calibrateTransform() { if (optiTrack != null) { Vector3 targetPos = optiTrack.getRbPos(player + 3); if (targetPos != Vector3.zero) { CmdMoveTo(targetPos * 100f); Vector3 dir = optiTrack.getRbDir(player + 3); float angle = calnAngle(transform.forward, dir); CmdRotateTo(transform.eulerAngles.y + angle); } } }
void calibrateTransform() { OptiTrack track = GetComponent <OptiTrack>(); if (track != null) { Vector3 targetPos = track.getRbPos(player + 1); if (targetPos != Vector3.zero) { moveTo(targetPos * 100f); Vector3 dir = track.getRbDir(player + 1); float angle = calnAngle(eye.transform.forward, dir); if (Mathf.Abs(angle) > 90f) { rotateTo(transform.eulerAngles.y + angle); } } } }