position.vwf.yaml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. # Copyright 2012 United States Government, as represented by the Secretary of Defense, Under
  2. # Secretary of Defense (Personnel & Readiness).
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
  5. # in compliance with the License. You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software distributed under the License
  10. # is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
  11. # or implied. See the License for the specific language governing permissions and limitations under
  12. # the License.
  13. ## `control.position.vwf` defines a key value for a control.
  14. ##
  15. ## @name control.position.vwf
  16. ## @namespace
  17. ##
  18. ## Key value for a control.
  19. ##
  20. ## Builds on animation.
  21. ##
  22. ## Time cross-references animation.
  23. ##
  24. ## Value specifies control value for this position. Node's name is name for that value/position/time.
  25. ##
  26. ## Attraction is stabiliby for this position. Think of time as a cursor at or between positions.
  27. ##
  28. ## - Is attracted to some positions, valleys, detents
  29. ##
  30. ## - Is repelled from some positions, hills, springs
  31. ##
  32. ## - Is neutral with other positions, free range
  33. ---
  34. properties:
  35. ## This position's location on the animation timeline. Valid values are in the range from `0` to
  36. ## the animation's duration.
  37. ##
  38. ## Positions that don't provide `time` will be automatically distributed along the range between
  39. ## the siblings that do. If none of a control's positions provide `time`, then the positions will
  40. ## be distributed evenly throughout the animation--in the range [`0`, *duration*].
  41. ##
  42. ## @name control.position.vwf#animationTime
  43. ## @property
  44. animationTime:
  45. ## The control's value at this position. The control will report this value, along with the
  46. ## position's name, when it reaches this position.
  47. ##
  48. ## Values for intermediate positions and for positions that don't define `value` will be
  49. ## interpolated from adjacent positions that do. If none of a control's positions define `value`,
  50. ## then the control will use the position's `time`.
  51. ##
  52. ## @name control.position.vwf#controlValue
  53. ## @property
  54. controlValue:
  55. ## The attraction or repulsion between the time cursor and this position. "detent" indicates
  56. ## attraction, "spring" indicates repulsion, and "netural" is neither. The values `1`, `-1` and `0`
  57. ## may be used to mean `detent`, `spring` and `neutral`, respectively.
  58. ##
  59. ## Attracting positions define a detent--a location that the control will tend to snap to.
  60. ## Repelling positions define a spring-loaded location--one that the control will avoid except
  61. ## when held there.
  62. ##
  63. ## @name control.position.vwf#controlType
  64. ## @property
  65. # TODO: held by how?
  66. controlType:
  67. set: |
  68. switch(value) {
  69. case "detent":
  70. case 1:
  71. this.controlType = 1;
  72. break;
  73. case "spring":
  74. case -1:
  75. this.controlType = -1;
  76. break;
  77. case "neutral":
  78. case 0:
  79. this.controlType = 0;
  80. break;
  81. }
  82. value: 0
  83. ## animation positions and control positions are not necessarily coincident, although they typically are
  84. ## animation data may be missing from control positions if no transform is necessary
  85. ## control data may be missing from animation positions if value/time == 1, attraction does not change
  86. ##
  87. ## The sequence of the control key value. Key values will be sorted on the sequence to keep the order correct,
  88. ## because Ruby 1.8.7 doesn't preserve child order in component objects.
  89. ##
  90. ## @name control.position.vwf#sequence
  91. ## @property
  92. sequence: 0