public void CustomInitialState()
        {
            Vector3State actualResult = new Vector3State(false, true, false);

            Assert.IsFalse(actualResult.xState);
            Assert.IsTrue(actualResult.yState);
            Assert.IsFalse(actualResult.zState);
        }
        public void DefaultStateTrue()
        {
            Vector3State actualResult = Vector3State.True;

            Assert.IsTrue(actualResult.xState);
            Assert.IsTrue(actualResult.yState);
            Assert.IsTrue(actualResult.zState);
        }
Esempio n. 3
0
        public void DefaultStateZAxis()
        {
            Vector3State actualResult = Vector3State.ZOnly;

            Assert.IsFalse(actualResult.xState);
            Assert.IsFalse(actualResult.yState);
            Assert.IsTrue(actualResult.zState);
        }
        public void DefaultStateFalse()
        {
            Vector3State actualResult = Vector3State.False;

            Assert.IsFalse(actualResult.xState);
            Assert.IsFalse(actualResult.yState);
            Assert.IsFalse(actualResult.zState);
        }
Esempio n. 5
0
        public void Comparison()
        {
            Vector3State stateA = Vector3State.True;
            Vector3State stateB = Vector3State.True;
            Vector3State stateC = Vector3State.False;

            Assert.IsTrue(stateA.Equals(stateB));
            Assert.IsFalse(stateA.Equals(stateC));
            Assert.IsFalse(stateB.Equals(stateC));
            Assert.AreEqual(stateA, stateB);
            Assert.AreNotEqual(stateA, stateC);
            Assert.AreNotEqual(stateB, stateC);
        }
Esempio n. 6
0
        /// <summary>
        /// The Initalise method is used to set up the state of the secondary action when the Interactable Object is initially grabbed by a secondary Interact Grab.
        /// </summary>
        /// <param name="currentGrabbdObject">The Interactable Object script for the object currently being grabbed by the primary grabbing object.</param>
        /// <param name="currentPrimaryGrabbingObject">The Interact Grab script for the object that is associated with the primary grabbing object.</param>
        /// <param name="currentSecondaryGrabbingObject">The Interact Grab script for the object that is associated with the secondary grabbing object.</param>
        /// <param name="primaryGrabPoint">The point on the Interactable Object where the primary Interact Grab initially grabbed the Interactable Object.</param>
        /// <param name="secondaryGrabPoint">The point on the Interactable Object where the secondary Interact Grab initially grabbed the Interactable Object.</param>
        public override void Initialise(VRTK_InteractableObject currentGrabbdObject, VRTK_InteractGrab currentPrimaryGrabbingObject, VRTK_InteractGrab currentSecondaryGrabbingObject, Transform primaryGrabPoint, Transform secondaryGrabPoint)
        {
            base.Initialise(currentGrabbdObject, currentPrimaryGrabbingObject, currentSecondaryGrabbingObject, primaryGrabPoint, secondaryGrabPoint);
            initialScale       = currentGrabbdObject.transform.localScale;
            initalLength       = (grabbedObject.transform.position - secondaryGrabbingObject.transform.position).magnitude;
            initialScaleFactor = currentGrabbdObject.transform.localScale.x / initalLength;

#pragma warning disable 618
            if ((lockXAxis || lockYAxis || lockZAxis) && lockAxis == Vector3State.False)
            {
                lockAxis = new Vector3State(lockXAxis, lockYAxis, lockZAxis);
            }
#pragma warning restore 618
        }
 /// <summary>
 /// Sets the <see cref="FollowOnAxis"/> x value.
 /// </summary>
 /// <param name="value">The value to set to.</param>
 public void SetFollowOnAxisX(bool value)
 {
     FollowOnAxis = new Vector3State(value, FollowOnAxis.yState, FollowOnAxis.zState);
 }
Esempio n. 8
0
 /// <summary>
 /// Sets the <see cref="ApplyToAxis"/> z value.
 /// </summary>
 /// <param name="value">The value to set to.</param>
 public virtual void SetApplyToAxisZ(bool value)
 {
     ApplyToAxis = new Vector3State(ApplyToAxis.xState, ApplyToAxis.yState, value);
 }
Esempio n. 9
0
 /// <summary>
 /// Sets the <see cref="ApplyToAxis"/> x value.
 /// </summary>
 /// <param name="value">The value to set to.</param>
 public virtual void SetApplyToAxisX(bool value)
 {
     ApplyToAxis = new Vector3State(value, ApplyToAxis.yState, ApplyToAxis.zState);
 }
Esempio n. 10
0
 /// <summary>
 /// Sets the <see cref="CheckAxis"/> z value.
 /// </summary>
 /// <param name="value">The value to set to.</param>
 public virtual void SetCheckAxisZ(bool value)
 {
     CheckAxis = new Vector3State(CheckAxis.xState, CheckAxis.yState, value);
 }
Esempio n. 11
0
        public void ConvertToString()
        {
            Vector3State rangeA = new Vector3State(true, false, true);

            Assert.AreEqual("{ xState = True | yState = False | zState = True }", rangeA.ToString());
        }
 /// <summary>
 /// Sets the <see cref="ApplyOriginOnAxis"/> y value.
 /// </summary>
 /// <param name="value">The value to set to.</param>
 public virtual void SetApplyOriginOnAxisY(bool value)
 {
     ApplyOriginOnAxis = new Vector3State(ApplyOriginOnAxis.xState, value, ApplyOriginOnAxis.zState);
 }
 /// <summary>
 /// Sets the <see cref="MutateOnAxis"/> z value.
 /// </summary>
 /// <param name="value">The value to set to.</param>
 public virtual void SetMutateOnAxisZ(bool value)
 {
     MutateOnAxis = new Vector3State(MutateOnAxis.xState, MutateOnAxis.yState, value);
 }
 /// <summary>
 /// Sets the <see cref="MutateOnAxis"/> x value.
 /// </summary>
 /// <param name="value">The value to set to.</param>
 public virtual void SetMutateOnAxisX(bool value)
 {
     MutateOnAxis = new Vector3State(value, MutateOnAxis.yState, MutateOnAxis.zState);
 }
 /// <summary>
 /// Sets the <see cref="ApplyFacingDirectionOnAxis"/> z value.
 /// </summary>
 /// <param name="value">The value to set to.</param>
 public virtual void SetApplyFacingDirectionOnAxisZ(bool value)
 {
     ApplyFacingDirectionOnAxis = new Vector3State(ApplyFacingDirectionOnAxis.xState, ApplyFacingDirectionOnAxis.yState, value);
 }
 /// <summary>
 /// Sets the <see cref="FollowOnAxis"/> z value.
 /// </summary>
 /// <param name="value">The value to set to.</param>
 public void SetFollowOnAxisZ(bool value)
 {
     FollowOnAxis = new Vector3State(FollowOnAxis.xState, FollowOnAxis.yState, value);
 }
 /// <summary>
 /// Sets the <see cref="FollowOnAxis"/> y value.
 /// </summary>
 /// <param name="value">The value to set to.</param>
 public virtual void SetFollowOnAxisY(bool value)
 {
     FollowOnAxis = new Vector3State(FollowOnAxis.xState, value, FollowOnAxis.zState);
 }
Esempio n. 18
0
 /// <summary>
 /// Sets the <see cref="CheckAxis"/> x value.
 /// </summary>
 /// <param name="value">The value to set to.</param>
 public virtual void SetCheckAxisX(bool value)
 {
     CheckAxis = new Vector3State(value, CheckAxis.yState, CheckAxis.zState);
 }