triangleHit
TypeScriptget triangleHit(): (CollisionCastHit_TriangleHit) | nullSwift declarationvar triangleHit: CollisionCastHit.TriangleHit? { get }Information the system provides when a ray touches or intersects a triangle mesh.
struct · iOS 13.0+ · SDK 27.1
struct CollisionCastHitA hit result of a collision cast. You get a collection of collision cast hits from either the ``Scene/raycast(origin:direction:length:query:mask:relativeTo:)`` method, or the ``Scene/convexCast(convexShape:fromPosition:fromOrientation:toPosition:toOrientation:query:mask:relativeTo:)`` method. Each hit indicates where the ray or the convex shape, starting at a given point and traveling in a given direction, hit a particular entity in the scene. The frame of reference for the position and normal of the hit depends on the reference entity parameter passed to the method that generated the hit. Pass `nil` as the reference to use world space.
get triangleHit(): (CollisionCastHit_TriangleHit) | nullSwift declarationvar triangleHit: CollisionCastHit.TriangleHit? { get }Information the system provides when a ray touches or intersects a triangle mesh.
get shapeIndex(): numberSwift declarationvar shapeIndex: Int { get }The index of the shape that was hit.
get entity(): EntitySwift declarationvar entity: Entity { get }The entity that was hit.
get normal(): SDKHandleSwift declarationvar normal: SIMD3<Float> { get }The normal of the hit. The frame of reference for this point depends on the reference entity used in the call to either the ``Scene/raycast(origin:direction:length:query:mask:relativeTo:)`` method or the ``Scene/convexCast(convexShape:fromPosition:fromOrientation:toPosition:toOrientation:query:mask:relativeTo:)`` method that generated the hit.
get distance(): numberSwift declarationvar distance: Float { get }The distance from the ray origin to the hit, or the convex shape travel distance.
get position(): SDKHandleSwift declarationvar position: SIMD3<Float> { get }The position of the hit. The frame of reference for this point depends on the reference entity used in the call to either the ``Scene/raycast(origin:direction:length:query:mask:relativeTo:)`` method or the ``Scene/convexCast(convexShape:fromPosition:fromOrientation:toPosition:toOrientation:query:mask:relativeTo:)`` method that generated the hit.
No declarations were skipped in this snapshot.