text
stringlengths 0
1.11k
|
|---|
// p0 is the cube's transform and p2 the left hand's index tip transform
|
// These are the two edges of the line connecting the cube to the left hand index tip
|
p0 = transform;
|
p2 = handIndexTipTransform;
|
// This is a somewhat random point between the cube and the index tip
|
// Need to reference as the point that "bends" the curve
|
p1 = sceneCamera.transform;
|
p1.position += sceneCamera.transform.forward * 0.8f;
|
// Draw the line that connects the cube to the user's left index tip and bend it at p1
|
DrawCurve(p0.position, p1.position, p2.position);
|
}
|
// If the user is not pinching
|
else
|
{
|
// Don't display the line at all
|
line.enabled = false;
|
}
|
}
|
}
|
void DrawCurve(Vector3 point_0, Vector3 point_1, Vector3 point_2)
|
/***********************************************************************************
|
# Helper function that draws a curve between point_0 and point_2, bending at point_1.
|
# Gradually draws a line as Quadratic Bézier Curve that consists of 200 segments.
|
#
|
# Bézier curve draws a path as function B(t), given three points P0, P1, and P2.
|
# B, P0, P1, P2 are all Vector3 and represent positions.
|
#
|
# B = (1 - t)^2 * P0 + 2 * (1-t) * t * P1 + t^2 * P2
|
#
|
# t is 0 <= t <= 1 representing size / portion of line when moving to the next segment.
|
# For example, if t = 0.5f, B(t) is halfway from point P0 to P2.
|
***********************************************************************************/
|
{
|
// Set the number of segments to 200
|
line.positionCount = 200;
|
Vector3 B = new Vector3(0, 0, 0);
|
float t = 0f;
|
// Draw segments
|
for (int i = 0; i < line.positionCount; i++)
|
{
|
// Move to next segment
|
t += 0.005f;
|
B = (1 - t) * (1 - t) * point_0 + 2 * (1 - t) * t * point_1 + t * t * point_2;
|
line.SetPosition(i, B);
|
}
|
}
|
void pinchCube()
|
// Places and rotates cube smoothly next to user's left hand
|
{
|
targetPosition = leftHand.transform.position - leftHand.transform.forward * 0.4f;
|
targetRotation = Quaternion.LookRotation(transform.position - leftHand.transform.position);
|
transform.position = Vector3.Lerp(transform.position, targetPosition, step);
|
transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, step);
|
}
|
}Use Wide Motion Mode
|
Unity
|
All-In-One VR
|
Quest
|
The platform for which this article is written (Unity) does not match your preferred platform (Nativa).
|
Haz clic aquí para ver la página del índice de la documentación para tu plataforma de preferencia.
|
Wide Motion Mode (WMM) allows you to track hands and display plausible hand poses even when the hands are outside the headset’s field of view, improving social presence and wide motion tracking. This is achieved by running Inside Out Body Tracking (IOBT) under the hood and using the estimated hand position when hand tracking is lost.
|
Benefits of WMM
|
Improved social and self presence by providing plausible hand poses even when your hands are outside your FOV.
|
More reliable wide motion interactions (arm swings, backpacks, throws, etc.)
|
Reduced gesture and interaction failures due to tracking loss when the user turns their head.
|
Arm swing based locomotion, where users use their arms to move around the game, such as Echo VR.
|
Known limitations
|
While the system will always provide a hand pose, it will not be accurate when hand tracking is lost- the system uses body tracking data for approximate position and last hand pose as the pose itself.
|
You may also see a slight regression in position accuracy due to smoothing when transitioning from body tracking based hand pose to hand tracking based hand pose as hand tracking is reestablished.
|
WMM can be less robust in extremely low light. In case of low light conditions, the system will revert to standard hand tracking.
|
Compatibility
|
Hardware compatibility
|
Supported devices: Quest 3 and all future devices.
|
Software compatibility
|
Unity 2021 LTS and above
|
Integration SDK version 62 and above
|
Feature compatibility
|
IOBT/ WMM will not run when passthrough and full body (FBS) are running along with FMM or Multimodal.
|
When using Inside Out Body Tracking, the hands pose exposed via MSDK already includes WMM like fused hands. If you plan to use MSDK and consume hands from ISDK/ hands API, turn on WMM to reduce hand pose mismatch between MSDK and hands API.
|
Setup
|
This feature will be integrated with the version of the Oculus Integration SDK for Unity provided to you. To enable WMM, either use the editor or the provided C# scripts. A simple WMM sample scene is in Scenes\OculusInternal\HandTrackingWideMotionMode. In the scene, you can use a simple UI to turn the feature on and off.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.