MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / findHeight

Method findHeight

Engine/source/T3D/fx/lightning.cpp:1194–1212  ·  view source on GitHub ↗

---------------------------------------------------------------------------- Find height ----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1192// Find height
1193//----------------------------------------------------------------------------
1194F32 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//----------------------------------------------------------------------------

Callers 1

processEventMethod · 0.80

Calls 7

mulPMethod · 0.80
Point2FClass · 0.50
getContainerMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
getWorldTransformMethod · 0.45
getHeightMethod · 0.45

Tested by

no test coverage detected