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

Method getLocalWindTrees

Engine/source/forest/forest.cpp:274–303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

272}
273
274void Forest::getLocalWindTrees( const Point3F &camPos, F32 radius, Vector<TreePlacementInfo> *placementInfo )
275{
276 PROFILE_SCOPE( Forest_getLocalWindTrees );
277
278 Vector<ForestItem> items;
279 items.reserve( placementInfo->capacity() );
280 mData->getItems( camPos, radius, &items );
281
282 TreePlacementInfo treeInfo;
283 dMemset( &treeInfo, 0, sizeof ( TreePlacementInfo ) );
284
285 // Reserve some space in the output.
286 placementInfo->reserve( items.size() );
287
288 // Build an info struct for each returned item.
289 Vector<ForestItem>::const_iterator iter = items.begin();
290 for ( ; iter != items.end(); iter++ )
291 {
292 // Skip over any zero wind elements here and
293 // just keep them out of the final list.
294 treeInfo.dataBlock = iter->getData();
295 if ( treeInfo.dataBlock->mWindScale < 0.001f )
296 continue;
297
298 treeInfo.pos = iter->getPosition();
299 treeInfo.scale = iter->getScale();
300 treeInfo.itemKey = iter->getKey();
301 placementInfo->push_back( treeInfo );
302 }
303}
304
305void Forest::applyRadialImpulse( const Point3F &origin, F32 radius, F32 magnitude )
306{

Callers

nothing calls this directly

Calls 11

dMemsetFunction · 0.50
reserveMethod · 0.45
capacityMethod · 0.45
getItemsMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
getDataMethod · 0.45
getPositionMethod · 0.45
getScaleMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected