Is there any kind of bit operation or arithmetical trick that would allow me to do something like
integerWhichCouldOnlyHaveAValueOfZeroOrOne == 0 ? otherIntegerWhichCouldOnlyHaveAValueOfZeroOrOne == 0 ? 0 : 1 : 2 without so many expensive conditionals?
integerWhichCouldOnlyHaveAValueOfZeroOrOne | otherIntegerWhichCouldOnlyHaveAValueOfZeroOrOne + integerWhichCouldOnlyHaveAValueOfZeroOrOne
If there is no possibility that
integerWhichCouldOnlyHaveAValueOfZeroOrOne == 1 and
otherIntegerWhichCouldOnlyHaveAValueOfZeroOrOne == 0, or if you don't care, then a simple addition would work.
If you're using it for wall segmentation, it should be fine just adding. The chances of the closer one being triggered but not the further is quite rare (although it can happen, I admit).
You do not have permission to edit this page, for the following reasons:
- The action you have requested is limited to users in the group: Users.
- You must confirm your email address before editing pages. Please set and validate your email address through your user preferences.
You can view and copy the source of this page.Sheldor (talk)
Hang on, is this two forward wall checks, or one forward and one reverse?
I was thinking two forward, where obviously the check which extends further will also be triggered in 99% of cases where the one that extends less is triggered.
If this is one forward, one reverse then I think they should actually be in different segments.