≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
Value calculation problem
Posted by:
(you are not logged in)
Enter the missing letter in: "?nternational"
(you are not logged in)
Text:
[quote][b][/b] wrote: I guess, you can try to log the t1 and t2 values in case rawX is NaN, so you can catch the input which causes the error. It actually throws NaN even if you have something like 1.00000001, which you can get if you have any other floating point operation with your t1 and t2 props before. So if it doesn't affect you in any way and you just don't want the error message to appear you can use a clamp function to force the input between -1 and 1. I don't recommend this, but it's something that I would do:) [code]function clamp(number, min, max) { return Math.max(min, Math.min(number, max)); } clamp(t1.x * t2.x + t1.y * t2.y + t1.z * t2.z, -1, 1);[/code][/quote]
Possible Codes
Feature
Code
Link
[url] www.example.com [/url]
Bold
[b]bold text[/b]
Image
[img]http://www.example.com/image.jpg[/img]
Quote
[quote]quoted text[/quote]
Code
[code]source code[/code]
Emoticons
Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact