Anonymous
Not logged in
Talk
Contributions
Create account
Log in
DivaDocs
Search
Editing
Expression Components and Instructions
(section)
From DivaDocs
Namespaces
Page
Discussion
More
More
Page actions
Read
Edit
Edit source
History
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Instructions == Instructions are the math portion of expressions. The following operations are allowed: === Number === n [value] The '''n''' instruction pushes a number to the stack, for example: = 6 n 1 sets the X Scale of the bone to 1 === Variable === v [variable] The '''v''' instruction gets a variable, then pushes it to the stack. The variable can either be:<blockquote>[Component].[Bone] (eg, 4.j_kao_wj, 2.kl_mune_b_wj, 6.j_ude_l_wj) or the '''t''' instruction (time elapsed) </blockquote>For example: = 1 v 4.j_kao_wj This would set the Y position of the bone to the Y rotation of j_kao_wj, or: = 2 v t This would set the Z position of the bone to the value of time elapsed === Function === f [function] The '''f''' instruction gets the value on the stack, applies the function, then pushes the value. The function used can be: {| class="wikitable" |+ |neg |Negate the value |- |sin |[[wikipedia:Sine_and_cosine|Sine]] function (in degrees) |- |cos |[[wikipedia:Sine_and_cosine|Cosine]] function (in degrees) |- |tan |[[wikipedia:Trigonometric_functions#tangent|Tangent]] function (in degrees) |- |abs |[[wikipedia:Absolute_value|Absolute Value]] function |- |sqrt |[[wikipedia:Square_root|Square Root]] |- |av |Multiplies value by 0.1 |- |floor |Outputs the [[wikipedia:Floor_and_ceiling_functions|floor]] (lowest integer) of a value |- |ceil |Outputs the [[wikipedia:Floor_and_ceiling_functions|ceiling]] (highest integer) of a value |- |round |[[wikipedia:Rounding|Rounds]]<nowiki/>the value |- |asin |[[wikipedia:Inverse_trigonometric_functions|Inverse Sine]] function |- |acos |[[wikipedia:Inverse_trigonometric_functions|Inverse Cosine]] function |- |atan |[[wikipedia:Inverse_trigonometric_functions|Inverse Tangent]] function |- |log |[[wikipedia:Logarithm|Logarithm]] function |- |exp |[[wikipedia:Exponentiation|Exponentation]] function |- |rand_0_1 |Unimplemented, makes value 0. (It is meant to randomly generate between 0 and 1) |} Function info from Skyth For example: = 0 v 1 f av would set the X position of the bone to 0.1 (since the 1 is multiplied by 0.1) === Secondary Functions === g [function] The '''g''' instruction gets two values from the stack, applies the function provided, then pushes the result. The function used can be: {| class="wikitable" |+ | + |Adds the values |- | - |Subtracts X from Y |- |* |Multiplies the values |- |/ |Divides X by Y |- |% |Takes a portion of X by Y |- |== |Outputs 1 if values are equal, else 0 |- |> |Outputs 1 if X is greater, else 0 |- |>= |Outputs 1 if X is greater or equal, else 0 |- |< |Outputs 1 if X is lesser, else 0 |- |<= |Outputs 1 if X is lesser or equal, else 0 |- |!= |Outputs 1 if values are not equal, else 0 |- |&& |Outputs 1 if both values are 1, else 0 |- |<nowiki>||</nowiki> |Outputs 1 if one value is 1, else 0 |- |min |Outputs the lowest value |- |max |Outputs the highest value |- |fmod |Divides X by Y, and outputs the remainder |- |pow |X to the power of Y |} <nowiki>*</nowiki>Function info from Skyth For example: = 6 n 1 n 3 g + would set the X scale of the bone to 4 (since it adds 3 and 1) === Ternary Functions === h [function] The '''h''' instruction gets three values from the stack, applies the function provided, then pushes the result. The function used can be: {| class="wikitable" |+ | cond |Returns second value if first is non-zero, otherwise third value is returned |- | rand |Unimplemented, acts as cond |} <nowiki>*</nowiki>Function info from Korenkonder For example: = 6 n 2 n 1 n 0 h cond would set the X scale of the bone to 2 (since the third value is 2 and the first value is 0)
Summary:
Please note that all contributions to DivaDocs are considered to be released under the Creative Commons Attribution-ShareAlike (see
DivaDocs:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Wiki tools
Wiki tools
Page tools
Page tools
User page tools
More
What links here
Related changes
Page information
Page logs