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

Method processTick

Engine/source/forest/forestWindMgr.cpp:98–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98void ForestWindMgr::processTick()
99{
100 const F32 timeDelta = 0.032f;
101
102 if ( mEmitters.empty() )
103 return;
104
105 PROFILE_SCOPE(ForestWindMgr_AdvanceTime);
106
107 // Advance all ForestWinds.
108 {
109 PROFILE_SCOPE(ForestWindMgr_AdvanceTime_ForestWind_ProcessTick);
110
111 ForestWindEmitterList::iterator iter = mEmitters.begin();
112 for ( ; iter != mEmitters.end(); iter++ )
113 {
114 if ( (*iter)->getWind() &&
115 (*iter)->isEnabled() )
116 {
117 (*iter)->updateMountPosition();
118
119 ForestWind *wind = (*iter)->getWind();
120 if ( wind )
121 wind->processTick();
122 }
123 }
124 }
125
126 // Assign the new global wind value used by the particle system.
127 {
128 ForestWindEmitter *pWindEmitter = getGlobalWind();
129 if ( pWindEmitter == NULL )
130 ParticleEmitter::setWindVelocity( Point3F::Zero );
131 else
132 {
133 ForestWind *pWind = pWindEmitter->getWind();
134 ParticleEmitter::setWindVelocity( pWind->getDirection() * pWind->getStrength() );
135 }
136 }
137
138 // Get the game connection and camera object
139 // in order to retrieve the camera position.
140 GameConnection *conn = GameConnection::getConnectionToServer();
141 if ( !conn )
142 return;
143
144 GameBase *cam = conn->getCameraObject();
145 if ( !cam )
146 return;
147
148 const Point3F &camPos = cam->getPosition();
149
150
151
152 // Gather TreePlacementInfo for trees near the camera.
153 {
154 PROFILE_SCOPE( ForestWindMgr_AdvanceTime_GatherTreePlacementInfo );
155

Callers

nothing calls this directly

Calls 15

getWindMethod · 0.80
updateMountPositionMethod · 0.80
getCameraObjectMethod · 0.80
swapFunction · 0.50
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
isEnabledMethod · 0.45
getDirectionMethod · 0.45
getStrengthMethod · 0.45
getPositionMethod · 0.45
triggerMethod · 0.45

Tested by

no test coverage detected