Difference between revisions of "Raycaster (LogiX node)/ja"
(Created page with "<code>MaxDistance</code>はレイキャストの最大長を制御します。レイキャストの実際の長さは、この入力と入力された<code>Root</code>スロ...") |
(Created page with "<code>HitTriggers</code>は、コライダー<code>Type</code>フィールドが<code>Trigger</code>または<code>HapticTrigger</code>として設定されているコライ...") |
||
Line 30: | Line 30: | ||
− | + | <code>HitTriggers</code>は、コライダー<code>Type</code>フィールドが<code>Trigger</code>または<code>HapticTrigger</code>として設定されているコライダーコンポーネントのみを有効なヒットターゲットとしてみなすかを決定するものです。デフォルトはfalseです。 | |
Revision as of 08:09, 15 February 2022
Raycaster | ||
---|---|---|
Inputs | ||
Float3 | Origin | |
Float3 | Direction | |
Float | MaxDistance | |
Bool | HitTriggers | |
Bool | UsersOnly | |
Slot | Root | |
Outputs | ||
Bool | HasHit | |
ICollider | HitCollider | |
Float | HitDistance | |
Float3 | HitPoint | |
Float3 | HitNormal | |
Int | HitTriangleIndex |
Raycasterノードは、フレームごとに更新される入力プロパティでレイキャストを生成します。現在ヒットしているターゲットコライダーに関する詳細(存在する場合)を、出力から得ることができます。
== 使用方法
入力
Origin
は、レイがキャストされるポイントを定義します。この値は、入力された Root
スロットの ローカル座標空間からの相対値として扱われます。デフォルトは [0;0;0] です。
Direction
は、レイがキャストされる方向ベクトルを定義します。この値は入力されたRoot
スロットのローカル座標空間からの相対値として扱われます。この入力は、デフォルトが[0;0;0]であるため、値を設定することが必要です。
MaxDistance
はレイキャストの最大長を制御します。レイキャストの実際の長さは、この入力と入力されたRoot
スロットのグローバルスケールの両方によって影響されます。デフォルト値は非常に大きい (~3.4×1038) ので、これを設定することが推奨されます。
HitTriggers
は、コライダーType
フィールドがTrigger
またはHapticTrigger
として設定されているコライダーコンポーネントのみを有効なヒットターゲットとしてみなすかを決定するものです。デフォルトはfalseです。
The UsersOnly
determines whether colliders which do not have an active user are considered valid hit targets. Defaults to false, in which case all colliders are considered valid hit targets (depending on other factors). However, if set to true, only colliders with an active user (i.e. are parented under a user's slot hierarchy) are considered valid hit targets.
The Root
input defines the slot relative to whose local coordinate space the Origin
, Direction
, and MaxDistance
are calcluated.
Outputs
The HasHit
input outputs whether the raycast has a valid hit target currently.
The HitCollider
output provides the first valid target collider hit along the path of the raycast. Default is null.
The HitDistance
output provides the global distance between the raycast origin and the HitPoint
. Default is 0.
The HitPoint
output provides the global coordinates of the point where raycast first intersects with the HitCollider
. Default is [0;0;0].
The HitNormal
output provides the normal vector for the intersection of the raycast and the HitCollider
.
The HitTriangleIndex
outputs the index of the mesh triangle which was hit in the case that the HitCollider
is a MeshCollider (Component).
Notes
Colliders will generally be valid hit targets for raycasts unless their Type
enum field is set to Trigger
, HapticTrigger
, or HapticSampler
, though see details for the HitTriggers
input. Colliders will not be valid targets if the IgnoreRaycasts
bool is set to true on the collider component.