OsApproxEquals
From OpenSimulator
(Difference between revisions)
(Created page with "{{osslfunc |threat_level=None |permissions=true |delay=0 |function_syntax= integer osApproxEquals(float a, float b)<br/> integer osApproxEquals(float a, float b, float...") |
|||
(16 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
{{osslfunc | {{osslfunc | ||
− | |||
|permissions=true | |permissions=true | ||
+ | |threat_level=ignored | ||
|delay=0 | |delay=0 | ||
|function_syntax= integer osApproxEquals(float a, float b)<br/> | |function_syntax= integer osApproxEquals(float a, float b)<br/> | ||
− | + | integer osApproxEquals(vector va, vector vb)<br/> | |
− | + | integer osApproxEquals(rotation ra, rotation rb)<br/> | |
− | + | integer osApproxEquals(float a, float b, float margin)<br/> | |
− | + | integer osApproxEquals(vector va, vector vb, float margin)<br/> | |
− | + | integer osApproxEquals(rotation ra, rotation rb, float margin) | |
− | |ossl_example= | + | |ossl_example=<source lang="lsl"> |
− | |description= | + | |
+ | ... | ||
+ | if(osApproxEquals(pos, otherpos, 0.2)) // on Xengine use if(osApproxEquals(pos, otherpos, 0.2) == 1) | ||
+ | llOwnerSay("Positions are almost equal"); | ||
+ | |||
+ | if(osApproxEquals(pos, otherpos)) // on Xengine use if(osApproxEquals(pos, otherpos) == 1) | ||
+ | llOwnerSay("Positions are closer than 0.000001 on x y and z"); | ||
+ | |||
+ | ... | ||
+ | </source> | ||
+ | |description=Returns 1 (true) if the quantities or all their components do not differ by the margin value, or 1e-6 (0.000001), if margin is not provided. Returns 0 (false) otherwise. | ||
|additional_info=Implemented November 20, 2018 | |additional_info=Implemented November 20, 2018 | ||
}} | }} |
Revision as of 15:34, 20 February 2019
integer osApproxEquals(float a, float b)
integer osApproxEquals(vector va, vector vb) | |
Returns 1 (true) if the quantities or all their components do not differ by the margin value, or 1e-6 (0.000001), if margin is not provided. Returns 0 (false) otherwise. | |
Threat Level | This function does not do a threat level check |
Permissions | Use of this function is always allowed by default |
Extra Delay | 0 seconds |
Example(s) | |
... if(osApproxEquals(pos, otherpos, 0.2)) // on Xengine use if(osApproxEquals(pos, otherpos, 0.2) == 1) llOwnerSay("Positions are almost equal"); if(osApproxEquals(pos, otherpos)) // on Xengine use if(osApproxEquals(pos, otherpos) == 1) llOwnerSay("Positions are closer than 0.000001 on x y and z"); ... | |
Notes | |
Implemented November 20, 2018 |