動画の概要
MayaのBifrostを利用してレイキャストをやってみました。
ShrinkWrapのようなデフォーマーをBifrostで作っています。
コリジョン側を作る(レイの照射先)

レイの照射方向の配列(Vector3)を作る

array_sizeでは、入力メッシュの位置情報をインプットに入れることでサイズを取得しています。
get_raycast_locations

・geometry
照射先のジオメトリを入れます。
・positions
照射元のジオメトリの位置情報を入れます。
・directions
照射元の位置から、どの方向に対してレイを打つか指定できます。
今回は、真下に向かって打つような設定をしました。
location_scope

デバッグとして利用することができます。
これを使うことで、レイがどのように判定されているか視覚化することができます。
入力はget_laycast_locationsと同じです。
sample_property

get_laycast_locationsで得られたlocationsの中に入っている情報を取得することができます。
propertyに『point_position』を指定すると、
locationsに入っている位置情報を取得することができます。
コメント