Jump to content
  • Advertisement
Sign in to follow this  
Woodchuck

D3DXPLANE operators

This topic is 5455 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I'm beginning in directx9, so i have many little questions :) Do the operator == use a tolerance value to perform the == test ? Idem for vector operator. I didn't found this information in the documention. If there is , say it to me :-D Thanks, Have a good day. Chuck3D

Share this post


Link to post
Share on other sites
Advertisement
The implementation of "operator ==" for D3DXPLANE and for D3DXVECTORn can be found in the d3dx9math.inl file in the Include folder of the DirectX SDK.

To answer your general question, no epsilon (tolerance) is used for the comparisons. I'm not entirely sure why not, but it's probably because different epsilons are applicable for different purposes; so if MS chose an arbitrary epsilon (FLT_EPSILON for example), that wouldn't be suitable for *some* people's purposes so some people wouldn't be happy with it.

If you need a tolerance, then either overload yourself or use a subtract operator and compare the fabs() of the result against your particular epsilon i.e.:
"if (fabsf(vectorA - vectorB) < FLT_EPSILON) EQUAL else NOTEQUAL".

Share this post


Link to post
Share on other sites
Yes ! I always need to have many epsilon to perform this, but i never be sure of me (bad method or idk) :-)

So, Thanks a lot.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!