LoginSignup
1
0

More than 3 years have passed since last update.

Get Component Boundsについて

Posted at

Get Component Bounds

image.png

コンポーネントのバウンズの原点と最大位置を返す。
origineとBoxExtentがなにを返すのかぱっと分からなくなりがちなので検証

image.png

画像のように三つのスタティックメッシュを含んだBlueprintで検証
Cube >> 黄Cube
origine >> 赤Sphere
Extent >> 青Sphere

よく使用する感じのBP

image.png

Construction Scriptで位置を設定。
CubeからGet Component BoundsしてOrigineの位置とBoxExtentの位置を割り出す。

結果

Origine

Cubeの原点位置のワールド座標を返す。

Box Extent

Cubeの原点から相対的なバウンディングボックスの大きさを返す
ワールド座標ではなく、あくまで原点からの座標なので固定
位置を保持し続けたかったら画像のようにOrigineと足してあげればよい。

Sphere Radiusは試してないけど、たぶんComponentをBounding Sphereで覆った時の半径が返ってくるんじゃないかと思います。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0