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

Method preload

Engine/source/T3D/vehicles/flyingVehicle.cpp:133–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131}
132
133bool FlyingVehicleData::preload(bool server, String &errorStr)
134{
135 if (!Parent::preload(server, errorStr))
136 return false;
137
138 TSShapeInstance* si = new TSShapeInstance(mShape, false);
139
140 // Resolve objects transmitted from server
141 if (!server) {
142 for (S32 i = 0; i < MaxSounds; i++)
143 {
144 if (mFlyingSounds[i])
145 {
146 _setFlyingSounds(getFlyingSounds(i), i);
147 }
148 }
149 for (S32 j = 0; j < MaxJetEmitters; j++)
150 if (jetEmitter[j])
151 Sim::findObject(SimObjectId((uintptr_t)jetEmitter[j]),jetEmitter[j]);
152 }
153
154 // Extract collision planes from shape collision detail level
155 if (collisionDetails[0] != -1)
156 {
157 MatrixF imat(1);
158 PlaneExtractorPolyList polyList;
159 polyList.mPlaneList = &rigidBody.mPlaneList;
160 polyList.setTransform(&imat, Point3F(1,1,1));
161 si->animate(collisionDetails[0]);
162 si->buildPolyList(&polyList,collisionDetails[0]);
163 }
164
165 // Resolve jet nodes
166 for (S32 j = 0; j < MaxJetNodes; j++)
167 jetNode[j] = mShape->findNode(sJetNode[j]);
168
169 //
170 maxSpeed = maneuveringForce / minDrag;
171
172 delete si;
173 return true;
174}
175
176void FlyingVehicleData::initPersistFields()
177{

Callers

nothing calls this directly

Calls 6

findObjectFunction · 0.50
Point3FClass · 0.50
setTransformMethod · 0.45
animateMethod · 0.45
buildPolyListMethod · 0.45
findNodeMethod · 0.45

Tested by

no test coverage detected