API reference
API reference
Select your platform
No SDKs available
No versions available

ICandidateComparer Interface

Defines a comparison mechanism for prioritizing interactors based on their candidate properties within an InteractorGroup.
This interface enables custom sorting logic for determining which interactor should take precedence when multiple interactors are competing for interaction with the same target.
This interface is crucial for:
  • Implementing distance-based priority systems for interactors
  • Creating custom sorting logic for interaction candidates
  • Managing complex multi-interactor scenarios
For implementation examples, see Oculus.Interaction.CandidatePositionComparer.

Member Functions

Compares two candidate objects to determine their relative priority.
The implementation should be consistent with the standard comparison contract:
  • If Compare(x,y) returns negative, then Compare(y,x) should return positive
  • If Compare(x,y) returns zero, then Compare(y,x) should return zero
  • If Compare(x,y) returns positive, then Compare(y,x) should return negative
Parameters
a
The first candidate object to compare
b
The second candidate object to compare
Returns
A negative value if a should be prioritized over b, zero if they have equal priority, or a positive value if b should be prioritized over a
Did you find this page helpful?
Thumbs up icon
Thumbs down icon