Exemplo n.º 1
0
 private void Awake()
 {
     pose  = GetComponent <SteamVR_Behaviour_Pose>();
     joint = GetComponent <FixedJoint>();
 }
Exemplo n.º 2
0
 private void Awake()
 {
     m_Pose  = GetComponent <SteamVR_Behaviour_Pose>();
     m_Joint = GetComponent <FixedJoint>();
     pointer = GetComponentInChildren <PhysicsPointer>();
 }
Exemplo n.º 3
0
 private void Awake()
 {
     m_Pose = GetComponent <SteamVR_Behaviour_Pose>();
 }
 public void UpdatePosition(SteamVR_Behaviour_Pose pose, SteamVR_Input_Sources s)
 {
     gameObject.transform.position = pose.transform.position;
     gameObject.transform.rotation = pose.transform.rotation;
 }
Exemplo n.º 5
0
    private void Awake()
    {
        _pose = GetComponent <SteamVR_Behaviour_Pose>();

        BlinkAction[SteamVR_Input_Sources.Any].onStateUp += TryBlink;
    }
Exemplo n.º 6
0
 void Start()
 {
     trackedObj = GetComponent <SteamVR_Behaviour_Pose>();
 }
Exemplo n.º 7
0
    private void Awake()
    {
        _pose = GetComponent <SteamVR_Behaviour_Pose>();

        TeleportAction[SteamVR_Input_Sources.Any].onStateUp += TryTeleport;
    }
Exemplo n.º 8
0
 private void Awake()
 {
     m_Pose        = GetComponent <SteamVR_Behaviour_Pose>();
     m_audioSource = GetComponent <AudioSource>();
 }
Exemplo n.º 9
0
 public override void Awake()
 {
     pose = GetComponent <SteamVR_Behaviour_Pose>();
     base.Awake();
 }
Exemplo n.º 10
0
 // Start is called before the first frame update
 void Awake()
 {
     m_Pose  = GetComponent <SteamVR_Behaviour_Pose>();
     m_joint = GetComponent <FixedJoint>();
 }
Exemplo n.º 11
0
 void Start()
 {
     Pose = GetComponent <SteamVR_Behaviour_Pose>();
     //sprayingTracker = GetComponent<SteamVR_Action_Vector3>();
     sprayingTracker = GetComponent <SteamVR_Action_Single>();
 }
Exemplo n.º 12
0
 protected virtual void Awake()
 {
     behaviourPose = GetComponent <SteamVR_Behaviour_Pose>();
 }
Exemplo n.º 13
0
 void Start()
 {
     // Initialize the input_source
     behaviour_pose = GetComponent <SteamVR_Behaviour_Pose>();
     input_source   = behaviour_pose.inputSource;
 }
Exemplo n.º 14
0
 private void Awake()
 {
     trackedObj = GetComponent <SteamVR_Behaviour_Pose>();
 }
Exemplo n.º 15
0
    // Update is called once per frame
    void FixedUpdate()
    {
        if (Time.time < delayUntil)
        {
            return;
        }
        for (uint i = 0; i < trackThese.Length; i++)
        {
            SteamVR_Behaviour_Pose checkMe = trackThese[i];
            if (checkMe == null || !checkMe.gameObject.activeSelf)
            {
                break;
            }
            Camera playerCamera = this.transform.parent.GetComponentInChildren <Camera>();



            // Project from the center of the sphere, through the controller, to the surface of the sphere.
            Vector3 localPointOnSphere = transform.InverseTransformPoint(checkMe.transform.position).normalized *getArmLength();
            // That projection is now the position of the 'front' anchor.
            frontAnchors[i].GetComponent <Rigidbody>().MovePosition(transform.TransformPoint(localPointOnSphere));
            // The 'back' anchor gets moved to the opposite side.
            backAnchors[i].GetComponent <Rigidbody>().MovePosition(transform.TransformPoint(-1 * localPointOnSphere));
            if (opened[i])
            {
                // Don't want to do this until the user has let go at least once, to avoid
                // weird situations if they start the level holding onto the grip buttons.

                if (!heldLastFrame[i] && GrabAction.GetState(checkMe.inputSource))
                {
                    timer = 1;
                    // The player wasn't gripping before, but is now.
                    //  print("Grip start! At arm length: " + getArmLength());

                    // Move the markers into place and show them.
                    markers[i].SetActive(true);
                    markers[i].transform.localPosition = transform.InverseTransformPoint(frontAnchors[i].transform.position);

                    // Create springs
                    AddJoint(frontAnchors[i]);
                    AddJoint(backAnchors[i]);
                }

                if (heldLastFrame[i])
                {
                    SpringTimer();
                }
                if (heldLastFrame[i] && !GrabAction.GetState(checkMe.inputSource))
                {
                    // Remove the springs
                    RemoveSprings(i);
                    timer = 1;
                    // Hide the marker.

                    print("Grip end!");
                }
            }
            heldLastFrame[i] = GrabAction.GetState(checkMe.inputSource);
            if (heldLastFrame[i] == false)
            {
                opened[i] = true;
            }
        }
    }
Exemplo n.º 16
0
 private void Awake()
 {
     pose = GetComponent <SteamVR_Behaviour_Pose>();
     Pointer.SetActive(false);
     NoPointer.SetActive(false);
 }
Exemplo n.º 17
0
 void Awake()
 {
     _pose = GetComponentInParent <SteamVR_Behaviour_Pose>();
 }