- Home /
What is Vector3.Exclude for?
I can't seem to find any documentation for "Vector3.Exclude()"
Is it the same as projecting one vector onto another... i.e.
public static Vector3 ProjectOntoPlane( Vector3 vec, Vector3 planeNormal )
{
return vec - Vector3.Dot(vec, planeNormal) * planeNormal;
}
In which case, can I lose this Util function? :)
Answer by Wolfram · Aug 16, 2010 at 02:58 PM
Google is your friend - try it ;-)
I found some reference on the russian unity3d site. The code shown there says "yes, it does exactly what you said, except a) the two parameters are reversed, b) the "planeNormal" (which can be any vector) doesn't have to be normalized."
Where did you find the info that there is a function called Vector3.Exclude() in the first place?
Intellisense picked it up when I hit "Vector3.". Was just curious. The project vector call is somewhat standard, but always seems to have a different name in different engines.
I swear I googled it! :). Not hard enough, I guess!
Whoa, that site has internal listings of the code. Very helpful clarification, but I'm guessing it's reverse engineered? Is it immoral to look there? :)
http://unity3d.ru/distribution/viewtopic.php?f=87&t=1834&st=0&sk=t&sd=a&hilit=string
"I swear I googled it! :). Not hard enough, I guess!" ok, I can believe that, because if you wrap your query in quotation marks, it will search for it as a single phrase, and it returned a single hit - to the site you posted. Uh, wait...now it's TWO hits...some iranian site joined it, referencing THIS page. $$anonymous$$ust be some bot...how weird is that? o_O
Answer by LyleE · Feb 05, 2015 at 07:11 PM
Hi Aubrey! Fancy seeing you here.
Here in the future-times of v4.6, Exclude is deprecated in favour of (the now documented) Vector3.ProjectOnPlane - Note that the order of the parameters is swapped.