<commit_before>﻿using System.Collections;
using UnityEngine;
namespace MRTK.Grabbables
{
    /// <summary>
    /// This type of grab makes the grabbed object follow the position and rotation of the grabber, but does not create a parent child relationship
    /// </summary>

    public class GrabbableSimple : BaseGrabbable
    {
        protected override void Start()
        {
            base.Start();
            rb = GetComponent<Rigidbody>();
        }

        /// <summary>
        /// Specify the target and turn off gravity. Otherwise gravity will interfere with desired grab effect
        /// </summary>
        protected override void StartGrab(BaseGrabber grabber)
        {
            base.StartGrab(grabber);
            if (rb)
                rb.useGravity = false;
        }

        /// <summary>
        /// On release turn garvity back on the so the object falls and set the target back to null
        /// </summary>
        protected override void EndGrab()
        {
            if (rb)
            {
                rb.useGravity = true;
            }
            base.EndGrab();
        }

        protected override void OnGrabStay()
        {
            transform.position = GrabberPrimary.GrabHandle.position;
        }

        private Rigidbody rb;
    }
}<commit_msg>match position and match rotation of grabber are now options on GrabbableSimple script<commit_after>﻿using System.Collections;
using UnityEngine;
namespace MRTK.Grabbables
{
    /// <summary>
    /// This type of grab makes the grabbed object follow the position and rotation of the grabber, but does not create a parent child relationship
    /// </summary>

    public class GrabbableSimple : BaseGrabbable
    {
        protected override void Start()
        {
            base.Start();
            rb = GetComponent<Rigidbody>();
        }

        /// <summary>
        /// Specify the target and turn off gravity. Otherwise gravity will interfere with desired grab effect
        /// </summary>
        protected override void StartGrab(BaseGrabber grabber)
        {
            base.StartGrab(grabber);
            if (rb)
                rb.useGravity = false;
        }

        /// <summary>
        /// On release turn garvity back on the so the object falls and set the target back to null
        /// </summary>
        protected override void EndGrab()
        {
            if (rb)
            {
                rb.useGravity = true;
            }
            base.EndGrab();
        }

        protected override void OnGrabStay()
        {
            if(matchPosition)
                transform.position = GrabberPrimary.GrabHandle.position;

            if (matchRotation)
                transform.rotation = GrabberPrimary.GrabHandle.rotation;
        }

        private Rigidbody rb;

        [SerializeField]
        private bool matchPosition = true;
        [SerializeField]
        private bool matchRotation = false;
    }
}
{'fraction_non_alphanumeric': 0.07949932341001353, 'fraction_numerical': 0.0, 'mean_word_length': 1.6735985533453888, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1377728', 'n_tokens_mistral': 751, 'n_tokens_neox': 725, 'n_words': 243}