m ProbablePrime moved page KnobControl (Component) to Component:KnobControl: Creating component Namespace |
Automated: update Fields |
||
Line 13: | Line 13: | ||
== Fields == | == Fields == | ||
{{Table ComponentFields | {{Table ComponentFields | ||
|Target|IField`1| | |Target|'''[[Type:IField`1|IField`1]]<[[Type:Float|Float]]>'''|TypeAdv0=true|A field to set with the knob's value. | ||
|Callback| | |Callback|{{RootFieldType|SyncDelegate`1|[[Type:Action`1|Action`1]]<[[Type:Float|Float]]>}}|TypeAdv1=true|A delegate that is called with the knob's value change. | ||
|RotationAxis|Float3|The axis around which to measure the slot's local rotation. | |RotationAxis|Float3|The axis around which to measure the slot's local rotation. | ||
|Rate|Float|The proportional effect of the knob, in values per full (360-degree) rotation. | |Rate|Float|The proportional effect of the knob, in values per full (360-degree) rotation. |
Revision as of 21:34, 3 March 2024
This article or section is a Stub. You can help the Resonite Wiki by expanding it.
KnobControl takes the local rotation of its slot around a specified axis and applies it proportionally to a floating point value.
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. |
Target
|
IField`1<Float> | A field to set with the knob's value. |
Callback
|
Action`1<Float> | A delegate that is called with the knob's value change. |
RotationAxis
|
Float3 | The axis around which to measure the slot's local rotation. |
Rate
|
Float | The proportional effect of the knob, in values per full (360-degree) rotation. |
Min
|
Float | The minimum value for the knob. |
Max
|
Float | The maximum value for the knob. |
_lastRotation
|
Float | (internal, read-only) Used in determining the rotational change. |
_lastAxis
|
Float3 | (internal, read-only) Used if the RotationAxis changes. |
_lastUser
|
User | (internal, read-only) The user who last rotated the slot. |
Usage
As the local rotation of this component's slot changes, the knob's value is updated according to how much it has rotated about the RotationAxis. The amount the value changes is determined by the change in rotation (measured in fractions of a full rotation, so for example a change of one degree would be 1/360), multiplied by the Rate.
Note that the value field is not driven. This means it is synced to all users, and can be written to at any time.
This component is most useful when coupled with a Joint to restrict the slot's rotation to be only around the rotation axis.