Pick a prop. camera has been positioned such that a ray pick at screen-coordinates p hits points with x-y coordinates xy. data tuple contents: (expected_result,block#,cell#,point#)
(p,xy,data)
| 170 | print(text) |
| 171 | |
| 172 | def cellPick(p,xy,data): |
| 173 | """ |
| 174 | Pick a prop. camera has been positioned such that a ray pick at |
| 175 | screen-coordinates p hits points with x-y coordinates xy. |
| 176 | data tuple contents: (expected_result,block#,cell#,point#) |
| 177 | """ |
| 178 | errors=0 |
| 179 | what='cell pick at {0}'.format(xy) |
| 180 | result=cellPicker.Pick(p[0],p[1],0,r)==1 |
| 181 | errors += compareExpectedAndActual( '{0} result'.format(what), |
| 182 | expectedResult(data), |
| 183 | result ) |
| 184 | |
| 185 | errors += compareExpectedAndActual( '{0} flat block index'.format(what), |
| 186 | expectedBlockId(data), |
| 187 | cellPicker.GetFlatBlockIndex()) |
| 188 | |
| 189 | errors += compareExpectedAndActual( '{0} cell id'.format(what), |
| 190 | expectedCellId(data), |
| 191 | cellPicker.GetCellId()) |
| 192 | |
| 193 | if errors and debug: |
| 194 | reportPickResult(what,result>0, |
| 195 | block=cellPicker.GetFlatBlockIndex(), |
| 196 | cell=cellPicker.GetCellId(), |
| 197 | point=cellPicker.GetPointId()) |
| 198 | return errors |
| 199 | |
| 200 | |
| 201 | def pick(xy,cellPickData): |
no test coverage detected