CustomTrackingSpace
: Transform |
This transform allows you to override the default tracking space.
Signature
Transform CustomTrackingSpace |
IsSupported
: bool
[Get] |
Checks if the environment raycast is supported.
Signature
bool IsSupported |
CheckBox
(
center
, halfExtents
, orientation
)
|
Checks whether the given box overlaps with the environment.
Signature
bool CheckBox(Vector3 center, Vector3 halfExtents, Quaternion orientation) Parameters center: Vector3
Center of the box.
halfExtents: Vector3
Half the size of the box in each dimension.
orientation: Quaternion
Rotation of the box.
Returns bool
Returns 'true' if the box overlaps with the environment.
|
PlaceBox
(
ray
, boxSize
, upwards
, hit
)
|
Tries to place the box on the flat and free surface.
First, this method aligns the box with the flat surface: box.forward is aligned with the surface normal, box.up is aligned with upwards . Then it checks if the box can fit the environment by checking collisions.
Signature
bool PlaceBox(Ray ray, Vector3 boxSize, Vector3 upwards, out EnvironmentRaycastHit hit) Parameters ray: Ray
The desired direction of placement. The common use case is to construct this ray with:
new Ray(controllerTransform.position, controllerTransform.forward) boxSize: Vector3
Size of the box in local-space coordinates. Width is aligned with the local x-axis, height is aligned with the local y-axis, length is aligned with the local z-axis.'x' and 'y' components should be greater than EnvironmentDepthManagerRaycastExtensions.MinXYSize to correctly determine the surface normal. 'z' component can be zero for flat objects. upwards: Vector3
The local y-axis of the box is aligned with upwards vector before checking for collisions with the environment.
hit: out EnvironmentRaycastHit
Contains the placement result. Example of how to apply the pose to the object:
transform.SetPositionAndRotation(hit.point, Quaternion.LookRotation(hit.normal, upwards)); Returns bool
'true' only if the surface is flat, free of clutter and big enough to fit the dimensions of the box.
|
Raycast
(
ray
, hit
, maxDistance
)
|
Casts a ray against the environment.
Returns 'true' if the cast is successful.
Signature
bool Raycast(Ray ray, out EnvironmentRaycastHit hit, float maxDistance=100f) Parameters ray: Ray
The starting point and direction of the ray.
maxDistance: float
The max distance the ray should check for collisions.
Returns bool
'true' if EnvironmentRaycastHit.status is EnvironmentRaycastHitStatus.Hit.
|