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

Method createShape

Engine/source/T3D/examples/renderShapeExample.cpp:184–212  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Object Rendering -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

182// Object Rendering
183//-----------------------------------------------------------------------------
184void RenderShapeExample::createShape()
185{
186 if ( getShape() == StringTable->EmptyString() )
187 return;
188
189 // If this is the same shape then no reason to update it
190 if ( mShapeInstance && getShape() == StringTable->insert(mShape.getPath().getFullPath().c_str()) )
191 return;
192
193 // Clean up our previous shape
194 if ( mShapeInstance )
195 SAFE_DELETE( mShapeInstance );
196
197 // Attempt to preload the Materials for this shape
198 if ( isClientObject() &&
199 !mShape->preloadMaterialList( mShape.getPath() ) &&
200 NetConnection::filesWereDownloaded() )
201 {
202 return;
203 }
204
205 // Update the bounding box
206 mObjBox = mShape->mBounds;
207 resetWorldBox();
208 setRenderTransform(mObjToWorld);
209
210 // Create the TSShapeInstance
211 mShapeInstance = new TSShapeInstance( mShape, isClientObject() );
212}
213
214void RenderShapeExample::prepRenderImage( SceneRenderState *state )
215{

Callers

nothing calls this directly

Calls 5

EmptyStringMethod · 0.80
preloadMaterialListMethod · 0.80
insertMethod · 0.45
c_strMethod · 0.45
getPathMethod · 0.45

Tested by

no test coverage detected