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

Method renderTimeMap

Engine/source/T3D/cameraSpline.cpp:198–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196//-----------------------------------------------------------------------------
197
198void CameraSpline::renderTimeMap()
199{
200 buildTimeMap();
201
202 gBuilding = true;
203
204 // Build vertex buffer
205 GFXVertexBufferHandle<GFXVertexPCT> vb;
206 vb.set(GFX, mTimeMap.size(), GFXBufferTypeVolatile);
207 void *ptr = vb.lock();
208 if(!ptr) return;
209
210 MRandomLCG random(1376312589 * (uintptr_t)this);
211 S32 index = 0;
212 for(Vector<TimeMap>::iterator itr=mTimeMap.begin(); itr != mTimeMap.end(); itr++)
213 {
214 Knot a;
215 value(itr->mTime, &a, true);
216
217 S32 cr = random.randI(0,255);
218 S32 cg = random.randI(0,255);
219 S32 cb = random.randI(0,255);
220 vb[index].color.set(cr, cg, cb);
221 vb[index].point.set(a.mPosition.x, a.mPosition.y, a.mPosition.z);
222 index++;
223 }
224
225 gBuilding = false;
226
227 vb.unlock();
228
229 // Render the buffer
230 GFX->pushWorldMatrix();
231 GFX->setupGenericShaders();
232 GFX->setVertexBuffer(vb);
233 GFX->drawPrimitive(GFXLineStrip,0,index);
234 GFX->popWorldMatrix();
235}
236
237
238//-----------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 12

pushWorldMatrixMethod · 0.80
setVertexBufferMethod · 0.80
popWorldMatrixMethod · 0.80
randIMethod · 0.60
setMethod · 0.45
sizeMethod · 0.45
lockMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
unlockMethod · 0.45
setupGenericShadersMethod · 0.45
drawPrimitiveMethod · 0.45

Tested by

no test coverage detected