Difference between revisions of "KnobControl (Component)"
Jump to navigation
Jump to search
(Created page with "<languages></languages> <translate> <!--T:1--> {{stub}} {{Infobox Component |Image=KnobControlComponent.png |Name=Knob Control }} <!--T:2--> == Fields == {{Table ComponentFie...") |
(Description) |
||
Line 7: | Line 7: | ||
|Name=Knob Control | |Name=Knob Control | ||
}} | }} | ||
+ | |||
+ | '''KnobControl''' takes the local rotation of its slot around a specified axis and applies it proportionally to a floating point value. | ||
<!--T:2--> | <!--T:2--> | ||
== Fields == | == Fields == | ||
{{Table ComponentFields | {{Table ComponentFields | ||
− | |Target|IField`1|TypeString0=IField<float>| | + | |Target|IField`1|TypeString0=IField<float>|A field to drive with the knob's value. |
− | |Callback|WorldDelegate| | + | |Callback|WorldDelegate|A delegate that is called with the knob's value change. |
− | |RotationAxis|Float3| | + | |RotationAxis|Float3|The axis around which to measure the slot's local rotation. |
− | |Rate|Float| | + | |Rate|Float|The proportional effect of the knob, in values per full (360-degree) rotation. |
− | |Min|Float| | + | |Min|Float|The minimum value for the knob. |
− | |Max|Float| | + | |Max|Float|The maximum value for the knob. |
− | |_lastRotation|Float| | + | |_lastRotation|Float|(internal, read-only) Used in determining the rotational change. |
− | |_lastAxis|Float3| | + | |_lastAxis|Float3|(internal, read-only) Used if the RotationAxis changes. |
− | |_lastUser|User| | + | |_lastUser|User|(internal, read-only) The user who last rotated the slot. |
}} | }} | ||
<!--T:3--> | <!--T:3--> | ||
== Usage == | == 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''. | ||
+ | |||
+ | This component is most useful when coupled with a [[Joint (Component)|Joint]] to restrict the slot's rotation to be only around the rotation axis. | ||
<!--T:4--> | <!--T:4--> |
Revision as of 00:15, 10 January 2022
This article or section is a Stub. You can help the Neos 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
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<float> | A field to drive with the knob's value. |
Callback
|
WorldDelegate | 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.
This component is most useful when coupled with a Joint to restrict the slot's rotation to be only around the rotation axis.