What ways can I optimize a vector magnitude check?

Started by
10 comments, last by Geri 5 years, 11 months ago

you probably should avoid calculating things like this when its not so necessary. maybe you should grab the neck of this issue in the code where you are actually moving these objects, bruteforce methods are rarely performance friendly. if you just do it for security (so they dont accelerate into oblivion as you said) you can just check the directions one by one, you dont need to do complex calculations on them (you probably dont even need to do all of the check for all object in every frame - half of the objects in first frame, second half in the next frame, or so). in 99% of the cases you must do the scientifically incorrect but simplier approach to actually have a decent and usable code. aniway, dont try to tackle issues like this from muscle.

This topic is closed to new replies.

Advertisement