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

Method onAdd

Engine/source/T3D/pathShape.cpp:97–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95//----------------------------------------------------------------------------
96
97bool PathShape::onAdd()
98{
99 if(!Parent::onAdd() && !mDataBlock)
100 return false;
101
102 mTypeMask |= PathShapeObjectType | StaticShapeObjectType;
103 // Initialize from the current transform.
104 if (!mNodeCount) {
105 QuatF rot(getTransform());
106 Point3F pos = getPosition();
107 mSpline.removeAll();
108 mSpline.push_back(new CameraSpline::Knot(pos,rot,1,
109 CameraSpline::Knot::NORMAL, CameraSpline::Knot::SPLINE));
110 mNodeCount = 1;
111 }
112
113 if (isServerObject()) scriptOnAdd();
114 return true;
115
116}
117
118void PathShape::onRemove()
119{

Callers

nothing calls this directly

Calls 3

getPositionFunction · 0.85
removeAllMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected