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

Method onAdd

Engine/source/T3D/pathCamera.cpp:139–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137//----------------------------------------------------------------------------
138
139bool PathCamera::onAdd()
140{
141 if(!Parent::onAdd())
142 return false;
143
144 // Initialize from the current transform.
145 if (!mNodeCount) {
146 QuatF rot(getTransform());
147 Point3F pos = getPosition();
148 mSpline.removeAll();
149 mSpline.push_back(new CameraSpline::Knot(pos,rot,1,
150 CameraSpline::Knot::NORMAL, CameraSpline::Knot::SPLINE));
151 mNodeCount = 1;
152 }
153
154 //
155 mObjBox.maxExtents = mObjScale;
156 mObjBox.minExtents = mObjScale;
157 mObjBox.minExtents.neg();
158 resetWorldBox();
159
160 if (mShapeInstance)
161 {
162 mNetFlags.set(Ghostable);
163 setScopeAlways();
164 }
165
166 addToScene();
167
168 return true;
169}
170
171void PathCamera::onRemove()
172{

Callers

nothing calls this directly

Calls 5

getPositionFunction · 0.85
removeAllMethod · 0.45
push_backMethod · 0.45
negMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected