Component:Scaler: Difference between revisions

From Resonite Wiki
Automated: update Fields, Categories
add infi
 
Line 2: Line 2:
<translate>
<translate>
<!--T:1-->
<!--T:1-->
{{stub}}
{{Infobox Component
{{Infobox Component
|Image=ScalerComponent.png
|Image=ScalerComponent.png
|Name=Scaler
|Name=Scaler
}}
}}
The '''Scaler''' component scales a target scale based on the distance of the slot this component is on from ""Point"" = (<code>ScaleOffset</code> in <code>ScaleSource</code>'s transform space) with the distance of both points calculated in <code>ScaleSpace</code>.
If the slots are all under root, the <code>scaleTarget</code> is targeting the scale of this slot, <code>ScaleSource</code> is set to root, <code>ScaleMode</code> is set to 'FullIndependent', <code>ScaleOffest</code> is set to (0,0,0), <code>ScaleMultiplier</code> is set to (1,1,1), and the slot this component is on is an unmodified default cube, the edge of at least one part of the cube on this slot will match perfectly to Root.


<!--T:2-->
<!--T:2-->
== Fields ==
== Fields ==
{{Table ComponentFields
{{Table ComponentFields
|ScaleOffset|Float3|
|ScaleOffset|Float3| The offset of point '''A''' to <code>ScaleSource</code>.
|ScaleMultiplier|Float3|
|ScaleMultiplier|Float3| How much to multiply the strength of the distance from '''A''' to '''B''' after conversion has on scale.
|ScaleSource|Slot|
|ScaleSource|Slot| The source space of point '''A'''.
|ScaleMode|'''[[#Mode|Mode]]'''|TypeAdv3=true|
|ScaleMode|'''[[#Mode|Mode]]'''|TypeAdv3=true| How to restrict the distance calculations for scaling certain axies.
|ScaleSpace|{{RootFieldType|RootSpace}}|TypeAdv4=true|
|ScaleSpace|{{RootFieldType|RootSpace}}|TypeAdv4=true| The space to convert '''A''' and '''B''' to for distance measurement.
|scaleTarget|{{RootFieldType|FieldDrive`1|[[Type:Float3|Float3]]}}|TypeAdv5=true|
|scaleTarget|{{RootFieldType|FieldDrive`1|[[Type:Float3|Float3]]}}|TypeAdv5=True| The field to drive to the distance from '''A''' to '''B''' after conversion to space <code>ScaleSpace</code> and applying <code>ScaleMode</code> restrictions, and then muliplying by 2 * <code>ScaleMultiplier</code>.
}}
 
== Mode ==
{{Table EnumValues
|FullUniform|0| The distance calculation from point '''A''' to '''B''' should be equal on all axies.
|XYUniform|1| The distance calculation from point '''A''' to '''B''' should be done between the XY plane and applied to X and Y axis equally before calculating Z distance separately.
|YZUniform|2| The distance calculation from point '''A''' to '''B''' should be done between the YZ plane and applied to Y and Z axis equally before calculating X distance separately.
|XZUniform|3| The distance calculation from point '''A''' to '''B''' should be done between the XZ plane and applied to X and Z axis equally before calculating Y distance separately.
|FullIndependent|4| The distance calculation from point '''A''' to '''B''' should be done separately for each axis.
}}
}}


<!--T:3-->
<!--T:3-->
== Usage ==
== Usage ==
Attach to a slot and fill the fields to start using this component.


<!--T:4-->
<!--T:4-->
== Examples ==
== Examples ==
{{stub}}


<!--T:5-->
<!--T:5-->
== Related Components ==
== See Also ==
</translate>
</translate>
[[Category:ComponentStubs]]
[[Category:Components{{#translation:}}|Scaler]]
[[Category:Components{{#translation:}}|Scaler]]
[[Category:Components With Nested Enums{{#translation:}}|Scaler]]
[[Category:Components With Nested Enums{{#translation:}}|Scaler]]
[[Category:Components:Transform:Drivers{{#translation:}}|Scaler]]
[[Category:Components:Transform:Drivers{{#translation:}}|Scaler]]

Latest revision as of 18:09, 2 February 2025

Component image 
Scaler component as seen in the Scene Inspector

The Scaler component scales a target scale based on the distance of the slot this component is on from ""Point"" = (ScaleOffset in ScaleSource's transform space) with the distance of both points calculated in ScaleSpace.

If the slots are all under root, the scaleTarget is targeting the scale of this slot, ScaleSource is set to root, ScaleMode is set to 'FullIndependent', ScaleOffest is set to (0,0,0), ScaleMultiplier is set to (1,1,1), and the slot this component is on is an unmodified default cube, the edge of at least one part of the cube on this slot will match perfectly to Root.

Fields

Fields
Name Type Description
persistent Bool Determines whether or not this item will be saved to the server.
UpdateOrder Int Controls the order in which this component is updated.
Enabled Bool Controls whether or not this component is enabled. Some components stop their functionality when this field is disabled, but some don't.
ScaleOffset Float3 The offset of point A to ScaleSource.
ScaleMultiplier Float3 How much to multiply the strength of the distance from A to B after conversion has on scale.
ScaleSource Slot The source space of point A.
ScaleMode Mode How to restrict the distance calculations for scaling certain axies.
ScaleSpace direct RootSpace The space to convert A and B to for distance measurement.
scaleTarget [[Type:field drive of Float3|field drive of Float3]] The field to drive to the distance from A to B after conversion to space ScaleSpace and applying ScaleMode restrictions, and then muliplying by 2 * ScaleMultiplier.

Mode

Values
Name Value Description
FullUniform 0 The distance calculation from point A to B should be equal on all axies.
XYUniform 1 The distance calculation from point A to B should be done between the XY plane and applied to X and Y axis equally before calculating Z distance separately.
YZUniform 2 The distance calculation from point A to B should be done between the YZ plane and applied to Y and Z axis equally before calculating X distance separately.
XZUniform 3 The distance calculation from point A to B should be done between the XZ plane and applied to X and Z axis equally before calculating Y distance separately.
FullIndependent 4 The distance calculation from point A to B should be done separately for each axis.

Usage

Attach to a slot and fill the fields to start using this component.

Examples

This article or section is a Stub. You can help the Resonite Wiki by expanding it.


See Also