| 140 | |
| 141 | |
| 142 | static btScalar |
| 143 | convertToFloat |
| 144 | ( |
| 145 | const byte_t * p, |
| 146 | PHY_ScalarType type |
| 147 | ) |
| 148 | { |
| 149 | btAssert(p); |
| 150 | |
| 151 | switch (type) { |
| 152 | case PHY_FLOAT: |
| 153 | { |
| 154 | btScalar * pf = (btScalar *)p; |
| 155 | return *pf; |
| 156 | } |
| 157 | |
| 158 | case PHY_UCHAR: |
| 159 | { |
| 160 | unsigned char * pu = (unsigned char *)p; |
| 161 | return ((*pu) * s_gridHeightScale); |
| 162 | } |
| 163 | |
| 164 | case PHY_SHORT: |
| 165 | { |
| 166 | short * ps = (short *)p; |
| 167 | return ((*ps) * s_gridHeightScale); |
| 168 | } |
| 169 | |
| 170 | default: |
| 171 | btAssert(!"bad type"); |
| 172 | } |
| 173 | |
| 174 | return 0; |
| 175 | } |
| 176 | |
| 177 | |
| 178 |
no outgoing calls
no test coverage detected