Changeset 492 for trunk/VUT/GtpVisibilityPreprocessor/src/Pvs.h
- Timestamp:
- 01/03/06 23:33:45 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/Pvs.h
r485 r492 60 60 */ 61 61 PvsData<T> *Find(T sample); 62 63 bool GetSampleContribution(T sample, float &contribution); 62 64 63 65 /** Adds sample to PVS. … … 71 73 */ 72 74 int AddSample(T sample); 73 75 74 76 /** Adds one pvs to another one. 75 77 @returns new pvs size … … 157 159 158 160 template <typename T> 159 int Pvs<T>::AddSample(T sample) 160 { 161 float dummy; 162 return AddSample(sample, dummy) ? 1 : 0; 163 } 164 165 template <typename T> 166 bool Pvs<T>::AddSample(T sample, float &contribution) 161 int 162 Pvs<T>::AddSample(T sample) 163 { 164 PvsData<T> *data = Find(sample); 165 166 if (data) { 167 return ++data->mVisibleSamples; 168 } 169 else { 170 mEntries[sample] = PvsData<T>(1); 171 return 1; 172 } 173 } 174 175 template <typename T> 176 bool 177 Pvs<T>::AddSample(T sample, float &contribution) 167 178 { 168 179 PvsData<T> *data = Find(sample); … … 181 192 182 193 template <typename T> 194 bool 195 Pvs<T>::GetSampleContribution(T sample, float &contribution) 196 { 197 PvsData<T> *data = Find(sample); 198 199 if (data) { 200 contribution = 1.0f/(data->mVisibleSamples + 1); 201 return false; 202 } 203 else { 204 contribution = 1.0f; 205 return true; 206 } 207 } 208 209 template <typename T> 183 210 bool Pvs<T>::RemoveSample(T sample, const int visibleSamples) 184 211 {
Note: See TracChangeset
for help on using the changeset viewer.