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

Method CreateShapes

Engine/source/T3D/fx/fxShapeReplicator.cpp:193–426  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191//------------------------------------------------------------------------------
192
193void fxShapeReplicator::CreateShapes(void)
194{
195 F32 HypX, HypY;
196 F32 Angle;
197 U32 RelocationRetry;
198 Point3F ShapePosition;
199 Point3F ShapeStart;
200 Point3F ShapeEnd;
201 Point3F ShapeScale;
202 EulerF ShapeRotation;
203 QuatF QRotation;
204 bool CollisionResult;
205 RayInfo RayEvent;
206 TSShape* pShape;
207
208
209 // Don't create shapes if we are hiding replications.
210 if (mFieldData.mHideReplications) return;
211
212 // Cannot continue without shapes!
213 if (String::compare(mFieldData.mShapeFile, "") == 0) return;
214
215 // Check that we can position somewhere!
216 if (!( mFieldData.mAllowOnTerrain ||
217 mFieldData.mAllowStatics ||
218 mFieldData.mAllowOnWater))
219 {
220 // Problem ...
221 Con::warnf(ConsoleLogEntry::General, "[%s] - Could not place object, All alloweds are off!", getName());
222
223 // Return here.
224 return;
225 }
226
227 // Check Shapes.
228 AssertFatal(mCurrentShapeCount==0,"Shapes already present, this should not be possible!");
229
230 // Check that we have a shape...
231 if (!mFieldData.mShapeFile) return;
232
233 // Set Seed.
234 RandomGen.setSeed(mFieldData.mSeed);
235
236 // Set shape vector.
237 mReplicatedShapes.clear();
238
239 // Add shapes.
240 for (U32 idx = 0; idx < mFieldData.mShapeCount; idx++)
241 {
242 fxShapeReplicatedStatic* fxStatic;
243
244 // Create our static shape.
245 fxStatic = new fxShapeReplicatedStatic();
246
247 // Set the 'shapeName' field.
248 fxStatic->setField("shapeName", mFieldData.mShapeFile);
249
250 // Is this Replicator on the Server?

Callers

nothing calls this directly

Calls 15

compareFunction · 0.85
getPositionFunction · 0.85
mCosFunction · 0.85
mSinFunction · 0.85
mDegToRadFunction · 0.85
setFieldMethod · 0.80
touchNetFlagsMethod · 0.80
randFMethod · 0.80
getTypeMaskMethod · 0.80
setColumnMethod · 0.80
setLockedMethod · 0.80
warnfFunction · 0.50

Tested by

no test coverage detected