The '''BoundingBoxDriver''' component is commonly used in Basic text objects to size the collider based on the text. This takes any [[Type:IBounded|IBounded]] and turns its Bounding box data into its local space center point and local space size. This is useful for auto generating the size and center of a [[Component:BoxCollider]] around a procedural mesh.
<!--T:2-->
<!--T:2-->
== Fields ==
== Fields ==
{{Table ComponentFields
{{Table ComponentFields
|BoundedSource|IBounded|
|BoundedSource|{{RootFieldType|RelayRef`1|[[Type:IBounded|IBounded]]}}|TypeAdv0=true| The object to get Bounding box data from.
|Size|IField`1|TypeString1=IField<float3>|
|Size|{{RootFieldType|FieldDrive`1|[[Type:Float3|Float3]]}}|TypeAdv1=true| The field to drive with the local space size of the bounding box of <code>BoundedSource</code>.
|Center|IField`1|TypeString2=IField<float3>|
|Center|{{RootFieldType|FieldDrive`1|[[Type:Float3|Float3]]}}|TypeAdv2=true|The field to drive with the local space center of the bounding box of <code>BoundedSource</code>.
|Padding|Float3|
|Padding|Float3| how much to add to the output of <code>Size</code>
|Scale|Float3|
|Scale|Float3| how much to multiply the output of <code>Size</code>
}}
}}
<!--T:3-->
<!--T:3-->
== Usage ==
== Usage ==
Attach to a slot and provide <code>BoundedSource</code>. The output fields are best used to drive a [[Component:BoxCollider]].
Bounding Box Driver component as seen in the Scene Inspector
The BoundingBoxDriver component is commonly used in Basic text objects to size the collider based on the text. This takes any IBounded and turns its Bounding box data into its local space center point and local space size. This is useful for auto generating the size and center of a Component:BoxCollider around a procedural mesh.