{"_id":"5b1f8576c2505d00031254b6","category":{"_id":"5b1f8576c2505d0003125428","version":"5b1f8576c2505d00031254db","project":"571fa55ca0acd42000af9545","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-01-01T16:41:26.797Z","from_sync":false,"order":4,"slug":"locomotion","title":"Locomotion"},"parentDoc":null,"user":"571fa519db52d01700f5cf3d","project":"571fa55ca0acd42000af9545","version":{"_id":"5b1f8576c2505d00031254db","project":"571fa55ca0acd42000af9545","__v":4,"forked_from":"594949e52be16d0026ec04cd","createdAt":"2017-06-20T16:14:29.816Z","releaseDate":"2017-06-20T16:14:29.816Z","categories":["5b1f8576c2505d0003125424","5b1f8576c2505d0003125425","5b1f8576c2505d0003125426","5b1f8576c2505d0003125427","5b1f8576c2505d0003125428","5b1f8576c2505d0003125429","5b1f8576c2505d000312542a","5b1f8576c2505d000312542b","5b1f8576c2505d000312542c","5b1f8576c2505d000312542d","5b1f8576c2505d000312542e","5b1f8576c2505d000312542f","5b1f8576c2505d0003125430","5b1f8576c2505d0003125431","5b1f8576c2505d0003125432","5b1f8576c2505d0003125433","5b1f8576c2505d0003125434","5b1f8576c2505d0003125435","5b1f8576c2505d0003125436","5b1f8576c2505d0003125437","5b1f8576c2505d0003125438","5b1f8aab9c683000032979e7","5b1f8b2f3073470003ffa5da","5b1f8bd9fd653400031d94f4","5b1f900bd4c5f000036b57bd"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"Mangalica","version_clean":"3.3.0","version":"3.3.0"},"githubsync":"","__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-01-01T16:44:51.993Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":9,"body":"## Overview\n\nMoves the SDK Camera Rig based on the motion of the headset and/or the controllers. Attempts to recreate the concept of physically walking on the spot to create scene movement.\n\n  > This locomotion method is based on Immersive Movement, originally created by Highsight. Thanks to KJack (author of Arm Swinger) for additional work.\n\n**Optional Components:**\n * `VRTK_BodyPhysics` - A Body Physics script to help determine potential collisions in the moving direction and prevent collision tunnelling.\n\n**Script Usage:**\n * Place the `VRTK_MoveInPlace` script on any active scene GameObject.\n\n**Script Dependencies:**\n * The Controller Events script on the controller Script Alias to determine when the engage button is pressed.\n\n## Inspector Parameters\n\n * **Left Controller:** If this is checked then the left controller engage button will be enabled to move the play area.\n * **Right Controller:** If this is checked then the right controller engage button will be enabled to move the play area.\n * **Engage Button:** The button to press to activate the movement.\n * **Control Options:** The device to determine the movement paramters from.\n * **Direction Method:** The method in which to determine the direction of forward movement.\n * **Speed Scale:** The speed in which to move the play area.\n * **Max Speed:** The maximun speed in game units. (If 0 or less, max speed is uncapped)\n * **Deceleration:** The speed in which the play area slows down to a complete stop when the engage button is released. This deceleration effect can ease any motion sickness that may be suffered.\n * **Falling Deceleration:** The speed in which the play area slows down to a complete stop when falling is occuring.\n * **Smart Decouple Threshold:** The degree threshold that all tracked objects (controllers, headset) must be within to change direction when using the Smart Decoupling Direction Method.\n * **Sensitivity:** The maximum amount of movement required to register in the virtual world.  Decreasing this will increase acceleration, and vice versa.\n * **Body Physics:** An optional Body Physics script to check for potential collisions in the moving direction. If any potential collision is found then the move will not take place. This can help reduce collision tunnelling.\n\n## Class Variables\n\n * `public enum ControlOptions` - Valid control options\n   * `HeadsetAndControllers` - Track both headset and controllers for movement calculations.\n   * `ControllersOnly` - Track only the controllers for movement calculations.\n   * `HeadsetOnly` - Track only headset for movement caluclations.\n * `public enum DirectionalMethod` - Options for which method is used to determine direction while moving.\n   * `Gaze` - Will always move in the direction they are currently looking.\n   * `ControllerRotation` - Will move in the direction that the controllers are pointing (averaged).\n   * `DumbDecoupling` - Will move in the direction they were first looking when they engaged Move In Place.\n   * `SmartDecoupling` - Will move in the direction they are looking only if their headset point the same direction as their controllers.\n   * `EngageControllerRotationOnly` - Will move in the direction that the controller with the engage button pressed is pointing.\n   * `LeftControllerRotationOnly` - Will move in the direction that the left controller is pointing.\n   * `RightControllerRotationOnly` - Will move in the direction that the right controller is pointing.\n\n## Class Methods\n\n### SetControlOptions/1\n\n  > `public virtual void SetControlOptions(ControlOptions givenControlOptions)`\n\n * Parameters\n   * `ControlOptions givenControlOptions` - The control options to set the current control options to.\n * Returns\n   * _none_\n\nSet the control options and modify the trackables to match.\n\n### GetMovementDirection/0\n\n  > `public virtual Vector3 GetMovementDirection()`\n\n * Parameters\n   * _none_\n * Returns\n   * `Vector3` - Returns a Vector3 representing the current movement direction.\n\nThe GetMovementDirection method will return the direction the play area is currently moving in.\n\n### GetSpeed/0\n\n  > `public virtual float GetSpeed()`\n\n * Parameters\n   * _none_\n * Returns\n   * `float` - Returns a float representing the current movement speed.\n\nThe GetSpeed method will return the current speed the play area is moving at.\n\n## Example\n\n`VRTK/Examples/042_CameraRig_MoveInPlace` demonstrates how the user can move and traverse colliders by either swinging the controllers in a walking fashion or by running on the spot utilisng the head bob for movement.","excerpt":"","slug":"vrtk_moveinplace","type":"basic","title":"VRTK_MoveInPlace"}
## Overview Moves the SDK Camera Rig based on the motion of the headset and/or the controllers. Attempts to recreate the concept of physically walking on the spot to create scene movement. > This locomotion method is based on Immersive Movement, originally created by Highsight. Thanks to KJack (author of Arm Swinger) for additional work. **Optional Components:** * `VRTK_BodyPhysics` - A Body Physics script to help determine potential collisions in the moving direction and prevent collision tunnelling. **Script Usage:** * Place the `VRTK_MoveInPlace` script on any active scene GameObject. **Script Dependencies:** * The Controller Events script on the controller Script Alias to determine when the engage button is pressed. ## Inspector Parameters * **Left Controller:** If this is checked then the left controller engage button will be enabled to move the play area. * **Right Controller:** If this is checked then the right controller engage button will be enabled to move the play area. * **Engage Button:** The button to press to activate the movement. * **Control Options:** The device to determine the movement paramters from. * **Direction Method:** The method in which to determine the direction of forward movement. * **Speed Scale:** The speed in which to move the play area. * **Max Speed:** The maximun speed in game units. (If 0 or less, max speed is uncapped) * **Deceleration:** The speed in which the play area slows down to a complete stop when the engage button is released. This deceleration effect can ease any motion sickness that may be suffered. * **Falling Deceleration:** The speed in which the play area slows down to a complete stop when falling is occuring. * **Smart Decouple Threshold:** The degree threshold that all tracked objects (controllers, headset) must be within to change direction when using the Smart Decoupling Direction Method. * **Sensitivity:** The maximum amount of movement required to register in the virtual world. Decreasing this will increase acceleration, and vice versa. * **Body Physics:** An optional Body Physics script to check for potential collisions in the moving direction. If any potential collision is found then the move will not take place. This can help reduce collision tunnelling. ## Class Variables * `public enum ControlOptions` - Valid control options * `HeadsetAndControllers` - Track both headset and controllers for movement calculations. * `ControllersOnly` - Track only the controllers for movement calculations. * `HeadsetOnly` - Track only headset for movement caluclations. * `public enum DirectionalMethod` - Options for which method is used to determine direction while moving. * `Gaze` - Will always move in the direction they are currently looking. * `ControllerRotation` - Will move in the direction that the controllers are pointing (averaged). * `DumbDecoupling` - Will move in the direction they were first looking when they engaged Move In Place. * `SmartDecoupling` - Will move in the direction they are looking only if their headset point the same direction as their controllers. * `EngageControllerRotationOnly` - Will move in the direction that the controller with the engage button pressed is pointing. * `LeftControllerRotationOnly` - Will move in the direction that the left controller is pointing. * `RightControllerRotationOnly` - Will move in the direction that the right controller is pointing. ## Class Methods ### SetControlOptions/1 > `public virtual void SetControlOptions(ControlOptions givenControlOptions)` * Parameters * `ControlOptions givenControlOptions` - The control options to set the current control options to. * Returns * _none_ Set the control options and modify the trackables to match. ### GetMovementDirection/0 > `public virtual Vector3 GetMovementDirection()` * Parameters * _none_ * Returns * `Vector3` - Returns a Vector3 representing the current movement direction. The GetMovementDirection method will return the direction the play area is currently moving in. ### GetSpeed/0 > `public virtual float GetSpeed()` * Parameters * _none_ * Returns * `float` - Returns a float representing the current movement speed. The GetSpeed method will return the current speed the play area is moving at. ## Example `VRTK/Examples/042_CameraRig_MoveInPlace` demonstrates how the user can move and traverse colliders by either swinging the controllers in a walking fashion or by running on the spot utilisng the head bob for movement.