---------------------------------------------------------------------------- Find height ----------------------------------------------------------------------------
| 1192 | // Find height |
| 1193 | //---------------------------------------------------------------------------- |
| 1194 | F32 LightningBolt::findHeight( Point3F &point, SceneManager *sceneManager ) |
| 1195 | { |
| 1196 | const Vector< SceneObject* > terrains = sceneManager->getContainer()->getTerrains(); |
| 1197 | for( Vector< SceneObject* >::const_iterator iter = terrains.begin(); iter != terrains.end(); ++ iter ) |
| 1198 | { |
| 1199 | TerrainBlock* terrain = dynamic_cast< TerrainBlock* >( *iter ); |
| 1200 | if( !terrain ) |
| 1201 | continue; |
| 1202 | |
| 1203 | Point3F terrPt = point; |
| 1204 | terrain->getWorldTransform().mulP(terrPt); |
| 1205 | |
| 1206 | F32 h; |
| 1207 | if( terrain->getHeight( Point2F( terrPt.x, terrPt.y ), &h ) ) |
| 1208 | return h; |
| 1209 | } |
| 1210 | |
| 1211 | return 0.f; |
| 1212 | } |
| 1213 | |
| 1214 | |
| 1215 | //---------------------------------------------------------------------------- |
no test coverage detected