| 715 | |
| 716 | template< S32 NUM_DIMENSIONS, class Object > |
| 717 | void ScopeTracker< NUM_DIMENSIONS, Object >::_setScope( Object object ) |
| 718 | { |
| 719 | // If there's no reference object, all objects are out of scope. |
| 720 | |
| 721 | if( !mReferenceObject || object == mReferenceObject ) |
| 722 | { |
| 723 | Deref( object ).clearScopeMask(); |
| 724 | return; |
| 725 | } |
| 726 | |
| 727 | const bool wasInScope = Deref( object ).isInScope(); |
| 728 | |
| 729 | // Set the scoping state on each axis. |
| 730 | |
| 731 | for( U32 n = 0; n < NUM_DIMENSIONS; ++ n ) |
| 732 | { |
| 733 | const F32 referencePos = Deref( mReferenceObject ).getMinTrackingNode( n )->getPosition(); |
| 734 | const F32 objectMin = Deref( object ).getMinTrackingNode( n )->getPosition(); |
| 735 | const F32 objectMax = Deref( object ).getMaxTrackingNode( n )->getPosition(); |
| 736 | |
| 737 | bool isInScope = referencePos >= objectMin |
| 738 | && referencePos <= objectMax; |
| 739 | |
| 740 | Deref( object ).setInScope( n, isInScope ); |
| 741 | } |
| 742 | |
| 743 | // Scope in/out if the scoping state has changed. |
| 744 | |
| 745 | if( Deref( object ).isInScope() ) |
| 746 | { |
| 747 | if( !wasInScope ) |
| 748 | _onScopeIn( object ); |
| 749 | } |
| 750 | else |
| 751 | { |
| 752 | if( wasInScope ) |
| 753 | _onScopeOut( object ); |
| 754 | } |
| 755 | } |
| 756 | |
| 757 | //----------------------------------------------------------------------------- |
| 758 |
nothing calls this directly
no test coverage detected