Height Adjustable Teleporter (VRTK_HeightAdjustTeleport)可调节高度的传送器(VRTK_HeightAdjustTeleport)
The height adjust teleporter extends the basic teleporter and allows for the y position of the [CameraRig] to be altered based on whether the teleport location is on top of another object.
高度调整传送器继承自基础传送器,它允许根据传送位置是否在其他对象顶部来让[CameraRig]改变y位置。
Like the basic teleporter the Height Adjust Teleport script is attached to the [CameraRig] prefab and requires a World Pointer to be available.
· Blink Transition Speed: The fade blink speed on teleport.
· Distance Blink Delay: A range between 0 and 32 that determines how long the blink transition will stay blacked out depending on the distance being teleported. A value of 0 will not delay the teleport blink effect over any distance, a value of 32 will delay the teleport blink fade in even when the distance teleported is very close to the original position. This can be used to simulate time taking longer to pass the further a user teleports. A value of 16 provides a decent basis to simulate this to the user.
· Headset Position Compensation: If this is checked then the teleported location will be the position of the headset within the play area. If it is unchecked then the teleported location will always be the centre of the play area even if the headset position is not in the centre of the play area.
· Ignore Target With Tag Or Class: A string that specifies an object Tag or the name of a Script attached to an obejct and notifies the teleporter that the destination is to be ignored so the user cannot teleport to that location. It also ensure the pointer colour is set to the miss colour.
· Play Space Falling: Checks if the player steps off an object into a part of their play area that is not on the object then they are automatically teleported down to the nearest floor.
· Blink Transition Speed(眨眼淡入淡出速度):可以在基础传送脚本中改变眨眼渐变速度来提供一个自定义的传送体验。速度设置为0意味着没有渐变眨眼特效呈现。渐变通过 SteamVR Unity 插件脚本里的SteamVR_Fade.cs脚本实现。
· Distance Blink Delay(距离眨眼延时): 范围从0到32,这个值决定了基于被传送距离的眨眼过渡保持黑屏的时长。值为0时,任何传送距离都不会延长传送的眨眼过渡,值为32时,就算距离初始点很近的被传送距离都会延长传送的眨眼过渡。这可以被用来模拟用户传送更远的距离花费更长时间。值为16对用户来说就刚好。
· Headset Position Compensation(头盔位置补偿): 如果勾选,传送坐标将会式游玩区内头盔的位置。如果没有勾选,传送坐标将总是游玩区中间的位置,就算头盔位置不在游玩区中间也式如此。
· Ignore Target With Tag Or Class(忽略带有标签或脚本的目标): 一个指定对象标签或者对象上添加的脚本名字的字符串,通知传送器这种目标点应该被忽略,所以用户就不能传送到这些位置上。同时也确保指针颜色被设为丢失目标点颜色。
· Play Space Falling(游玩区坠落):检查是否玩家是否走出对象,即所在游玩区的位置不在对象上,然后就会自动传送到最近的地面上。
The Play Space Falling option also works in the opposite way that if the player's headset is above an object then the player is teleported automatically on top of that object, which is useful for simulating climbing stairs without needing to use the pointer beam location. If this option is turned off then the player can hover in mid air at the same y position of the object they are standing on.
反过来说Play Space Falling 选项是在玩家头盔在一个对象上方时会自动传送到一个对象的顶部,这一点在模拟爬梯子时很有用,不需要使用指针光束定位。如果这个选项关闭,玩家就能在他们所站在的对象的同样y高度的空中行走(也就是有一部分游玩区在对象外部)。
An example of the VRTK_HeightAdjustTeleport script can be viewed in the sceneSteamVR_Unity_Toolkit/Examples/007_CameraRig_HeightAdjustTeleport. The scene has a collection of varying height objects that the player can either walk up and down or use the laser pointer to climb on top of them.
VRTK_HeightAdjustTeleport 脚本的例子参见SteamVR_Unity_Toolkit/Examples/007_CameraRig_HeightAdjustTeleport场景。场景有许多不同高度对象,玩家可在来回走或者使用激光束爬到它们顶部。
Another example can be viewed in the scene SteamVR_Unity_Toolkit/Examples/010_CameraRig_TerrainTeleporting which shows how the teleportation of a player can also traverse terrain colliders.
Another example can be viewed in the scene SteamVR_Unity_Toolkit/Examples/020_CameraRig_MeshTeleporting which shows how the teleportation of a player can also traverse mesh colliders.
另一个例子参见SteamVR_Unity_Toolkit/Examples/010_CameraRig_TerrainTeleporting场景,展示了玩家也能够在地形碰撞器上传送。还有个例子在 SteamVR_Unity_Toolkit/Examples/020_CameraRig_MeshTeleporting场景中,显示玩家在网格碰撞器上传送。
Fading On Headset Collision (VRTK_HeadsetCollisionFade)头盔碰撞淡出(VRTK_HeadsetCollisionFade)
The purpose of the Headset Collision Fade is to detect when the user's VR headset collides with another game object and fades the screen to a solid colour. This is to deal with a player putting their head into a game object and seeing the inside of the object clipping, which is an undesired effect.
头盔碰撞淡出的目的是为了检测用户的VR头盔何时碰撞到其他游戏对象并淡出屏幕到一个单色。这是为了处理玩家把头放进一个游戏对象里看到对象内部的裁剪,这不是我们所期望的。
The reasoning behind this is if the player puts their head where it shouldn't be, then fading to a colour (e.g. black) will make the player realise they've done something wrong and they'll probably naturally step backwards.
之所以这么做,是因为如果玩家把头放到不该放的地方就会淡出到一个颜色(如黑色),这就让玩家意识到他们做错了什么,然后可能自然的就会后退。
If the headset is colliding then the teleport action is also disabled to prevent cheating by clipping through walls.
如果头盔正在碰撞,那么传送行为就被禁用来防止穿插穿墙的作弊。
If using Unity 5.3 or older then the Headset Collision Fade script is attached to the Camera (head) object within the[CameraRig] prefab.
使用Unity 5.3及之前版本,头盔碰撞淡出脚本添加到[CameraRig] 预制的Camera(head)对象上。
If using Unity 5.4 or newer then the Headset Collision Fade script is attached to the Camera (eye) object within the[CameraRig]->Camera (head) prefab.
使用Unity 5.4及之后版本,头盔碰撞淡出脚本添加到[CameraRig] 预制下的Camera (head)里的Camera(eye)对象上。
The following script parameters are available:
可用脚本参数如下:
· Blink Transition Speed: The fade blink speed on collision.
· Fade Color: The colour to fade the headset to on collision.
· Blink Transition Speed(眨眼淡入淡出速度):碰撞时淡入淡出速度。
· Fade Color(淡出颜色):头盔碰撞时淡出颜色。
The following events are emitted:
发出事件如下:
· HeadsetCollisionDetect: Emitted when the user's headset collides with another game object.
· HeadsetCollisionEnded: Emitted when the user's headset stops colliding with a game object.
· HeadsetCollisionDetect: 当用户头盔碰到其他游戏对象时发出。
· HeadsetCollisionEnded:当用户头盔停止碰撞游戏对象时发出。
The event payload that is emitted contains:
发出事件的有效载体内容包括:
· collider: The Collider of the game object the headset has collided with.
· currentTransform: The current Transform of the object that the Headset Collision Fade script is attached to (Camera).
· collider: 头盔所碰撞的游戏对象的碰撞器。
· currentTransform: 当前头盔碰撞淡入淡出脚本所添加到的对象(相机)的Transform。
An example of the VRTK_HeadsetCollisionFade script can be viewed in the sceneSteamVR_Unity_Toolkit/Examples/011_Camera_HeadSetCollisionFading. The scene has collidable walls around the play area and if the player puts their head into any of the walls then the headset will fade to black.
VRTK_HeadsetCollisionFade 脚本例子参见SteamVR_Unity_Toolkit/Examples/011_Camera_HeadSetCollisionFading场景。场景在游玩区周围有可碰撞的墙壁,如果玩家把头放进墙壁,头盔就将渐变成黑色。
Player Presence (VRTK_PlayerPresence)玩家呈现(VRTK_PlayerPresence)
The concept that the VR user has a physical in game presence which is accomplished by adding a collider and a rigidbody at the position the user is standing within their play area. This physical collider and rigidbody will prevent the user from ever being able to walk through walls or intersect other collidable objects. The height of the collider is determined by the height the user has the headset at, so if the user crouches then the collider shrinks with them, meaning it's possible to crouch and crawl under low ceilings.
VR用户在游戏呈现中有身体这一概念,它通过在用户站立在游玩区中的位置添加碰撞和刚体来实现。身体的碰撞和刚体将防止用户能狗穿过墙壁或者和其他可碰撞对象穿插。碰撞体的高度由用户头盔所在高度决定,如果用户下蹲,碰撞体同样收缩,这意味着可能在低的空间去下蹲和爬行通过。
The following script parameters are available:
可用脚本参数如下:
· Headset Y Offset: The box collider which is created for the user is set at a height from the user's headset position. If the collider is required to be lower to allow for room between the play area collider and the headset then this offset value will shorten the height of the generated box collider.
· Ignore Grabbed Collisions: If this is checked then any items that are grabbed with the controller will not collide with the box collider and rigid body on the play area. This is very useful if the user is required to grab and wield objects because if the collider was active they would bounce off the play area collider.
· Headset Y Offset(头盔y偏移):为用户创建的盒型碰撞体的高度由用户头盔位置设置。如果需要碰撞体小一点来让游玩区和头盔之间留有空间的话,这个值将降低生成的盒型碰撞体的高度。
· Ignore Grabbed Collisions(忽略抓取碰撞):如果勾选,任何被控制器抓取的物品都不会和游玩区的盒碰撞体及刚体发生碰撞。这在用户需要抓取和挥动对象时是很有用的,因为如果碰撞体激活,这些抓取的东西就会被游玩区的碰撞体弹开。
An example of the VRTK_PlayerPresence script can be viewed in the sceneSteamVR_Unity_Toolkit/Examples/017_CameraRig_TouchpadWalking. The scene has a collection of walls and slopes that can be traversed by the user with the touchpad but the user cannot pass through the objects as they are collidable and the rigidbody physics won't allow the intersection to occur.
VRTK_PlayerPresence 脚本例子可参见SteamVR_Unity_Toolkit/Examples/017_CameraRig_TouchpadWalking场景。场景有很多墙体和斜坡,用户可以用触摸板来四处行走,但是不能穿过这些对象,因为它们是可碰撞的并且刚体物理将不允许发生穿叉。
Touchpad Movement (VRTK_TouchpadWalking)触摸板移动 (VRTK_TouchpadWalking)
The ability to move the play area around the game world by sliding a finger over the touchpad is achieved using this script. The Touchpad Walking script is applied to the [CameraRig] prefab and adds a rigidbody and a box collider to the user's position to prevent them from walking through other collidable game objects.
通过手指在触摸板上滑动来实现用这个脚本让游玩区在游戏世界中能够移动。TouchpadWalking脚本用在[CameraRig]预制上,并且在用户位置添加一个刚体和盒型碰撞来防止他们穿过其他带碰撞的游戏对象。
If the Headset Collision Fade script has been applied to the Camera prefab, then if a user attempts to collide with an object then their position is reset to the last good known position. This can happen if the user is moving through a section where they need to crouch and then they stand up and collide with the ceiling. Rather than allow a user to do this and cause collision resolution issues it is better to just move them back to a valid location. This does break immersion but the user is doing something that isn't natural.
如果Headset Collision Fade脚本已经被添加到相机预制上,如果用户试着和一个对象发生碰撞,那么他的位置就会被重置为最近的正常的位置。这可能发生在用户穿过需要躬身的区域中途站了起来和顶部发生了碰撞。与其允许用户这样做而引起碰撞问题,倒不如直接移动回到一个正常的位置。这确实破坏了沉浸感,但用户正在做的事情也是不自然的。
The following script parameters are available:
可用脚本参数如下:
· Left Controller: If this is checked then the left controller touchpad will be enabled to move the play area. It can also be toggled at runtime.
· Right Controller: If this is checked then the right controller touchpad will be enabled to move the play area. It can also be toggled at runtime.
· Max Walk Speed: The maximum speed the play area will be moved when the touchpad is being touched at the extremes of the axis. If a lower part of the touchpad axis is touched (nearer the centre) then the walk speed is slower.
· Deceleration: The speed in which the play area slows down to a complete stop when the user is no longer touching the touchpad. This deceleration effect can ease any motion sickness that may be suffered.
· Left Controller:如果勾选,左控制器的触摸板就能移动游玩区。在运行时可以被切换。
· Right Controller:如果勾选,右控制器的触摸板就能移动游玩区。在运行时可以被切换。
· Max Walk Speed:当触摸板被触摸到轴的极限时游玩区所能达到的最大移动速度。触摸板距离中心越近的位置被触摸,移动速度就越慢。
· Deceleration(减速度):当用户不再触摸到触摸板时游玩区从减速到完全停止的速度。这种减速度效果可以减缓可能遭受的移动恶心。
An example of the VRTK_TouchpadWalking script can be viewed in the sceneSteamVR_Unity_Toolkit/Examples/017_CameraRig_TouchpadWalking. The scene has a collection of walls and slopes that can be traversed by the user with the touchpad. There is also an area that can only be traversed if the user is crouching. Standing up in this crouched area will cause the user to appear back at their last good known position.
VRTK_TouchpadWalking 脚本的例子参见SteamVR_Unity_Toolkit/Examples/017_CameraRig_TouchpadWalking场景。场景中有很多墙壁和梯子,用户可以用触摸板来移动。还有个区域只有用户蹲下才能穿过。在俯身区域挺起身体将导致用户闪回他们最近的正常位置。
VRTK_RoomExtender(游玩区空间扩展)
This script allows the playArea to move with the player. The CameraRig is only moved when at the edge of a defined circle. Aims to create a virtually bigger play area. I have added a demo scene to test the script (028_CameraRig_RoomExtender).
这个脚本允许游玩区跟随玩家移动。CameraRig 只在达到定义的圈的边缘才会移动。目的是为了创造一个虚拟的更大的游玩区。测试这个脚本的demo场景为028_CameraRig_RoomExtender。
To use this add this script to the CameraRig.
把脚本添加到CameraRig来使用。
The following script parameters are available:
可用脚本参数如下:
· Additional Movement Multiplier: This is the factor by which movement at the edge of the circle is amplified. 0 is no movement of the CameraRig. Higher values simulate a bigger play area but may be to uncomfortable.
· Head Zone Radius: This is the size of the circle in which the playArea is not moved and everything is normal. If it is to low it becomes uncomfortable when crouching.
· Debug Transform: This transform visualises the circle around the player where the CameraRig is not moved. In the demo scene this is a cylinder at floor level. Remember to turn of collisions.
· Additional Movement Multiplier(额外移动乘数): 圈边缘的移动放大因数。0就是不移动CameraRig。值越高模拟的游玩区域就越大,但是也可能就越不令人舒适。
· Head Zone Radius(头部空间半径):游玩区不会发生移动的圆圈尺寸,一切都正常的。如果值太低,在蹲下时就会感到不舒服。
· Debug Transform(调试Transform): 这个transform让玩家周围的CameraRig不移动圆圈显示出来。在demo场景里就是一个在地板上的柱体。记得关闭碰撞。