pathCamera.cpp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640
  1. //-----------------------------------------------------------------------------
  2. // Copyright (c) 2012 GarageGames, LLC
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to
  6. // deal in the Software without restriction, including without limitation the
  7. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  8. // sell copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  20. // IN THE SOFTWARE.
  21. //-----------------------------------------------------------------------------
  22. #include "platform/platform.h"
  23. #include "math/mMath.h"
  24. #include "math/mathIO.h"
  25. #include "console/simBase.h"
  26. #include "console/console.h"
  27. #include "console/consoleTypes.h"
  28. #include "core/stream/bitStream.h"
  29. #include "core/dnet.h"
  30. #include "scene/pathManager.h"
  31. #include "app/game.h"
  32. #include "T3D/gameBase/gameConnection.h"
  33. #include "T3D/fx/cameraFXMgr.h"
  34. #include "console/engineAPI.h"
  35. #include "math/mTransform.h"
  36. #include "T3D/pathCamera.h"
  37. //----------------------------------------------------------------------------
  38. IMPLEMENT_CO_DATABLOCK_V1(PathCameraData);
  39. ConsoleDocClass( PathCameraData,
  40. "@brief General interface to control a PathCamera object from the script level.\n"
  41. "@see PathCamera\n"
  42. "@tsexample\n"
  43. "datablock PathCameraData(LoopingCam)\n"
  44. " {\n"
  45. " mode = \"\";\n"
  46. " };\n"
  47. "@endtsexample\n"
  48. "@ingroup PathCameras\n"
  49. "@ingroup Datablocks\n"
  50. );
  51. void PathCameraData::consoleInit()
  52. {
  53. }
  54. void PathCameraData::initPersistFields()
  55. {
  56. Parent::initPersistFields();
  57. }
  58. void PathCameraData::packData(BitStream* stream)
  59. {
  60. Parent::packData(stream);
  61. }
  62. void PathCameraData::unpackData(BitStream* stream)
  63. {
  64. Parent::unpackData(stream);
  65. }
  66. //----------------------------------------------------------------------------
  67. IMPLEMENT_CO_NETOBJECT_V1(PathCamera);
  68. ConsoleDocClass( PathCamera,
  69. "@brief A camera that moves along a path. The camera can then be made to travel along this path forwards or backwards.\n\n"
  70. "A camera's path is made up of knots, which define a position, rotation and speed for the camera. Traversal from one knot to "
  71. "another may be either linear or using a Catmull-Rom spline. If the knot is part of a spline, then it may be a normal knot "
  72. "or defined as a kink. Kinked knots are a hard transition on the spline rather than a smooth one. A knot may also be defined "
  73. "as a position only. In this case the knot is treated as a normal knot but is ignored when determining how to smoothly rotate "
  74. "the camera while it is travelling along the path (the algorithm moves on to the next knot in the path for determining rotation).\n\n"
  75. "The datablock field for a PathCamera is a previously created PathCameraData, which acts as the interface between the script and the engine "
  76. "for this PathCamera object.\n\n"
  77. "@see PathCameraData\n"
  78. "@tsexample\n"
  79. "%newPathCamera = new PathCamera()\n"
  80. "{\n"
  81. " dataBlock = LoopingCam;\n"
  82. " position = \"0 0 300 1 0 0 0\";\n"
  83. "};\n"
  84. "@endtsexample\n"
  85. "@ingroup PathCameras\n"
  86. );
  87. IMPLEMENT_CALLBACK( PathCamera, onNode, void, (S32 node), (node),
  88. "A script callback that indicates the path camera has arrived at a specific node in its path. Server side only.\n"
  89. "@param Node Unique ID assigned to this node.\n");
  90. PathCamera::PathCamera()
  91. {
  92. mNetFlags.clear(Ghostable);
  93. mTypeMask |= CameraObjectType;
  94. delta.time = 0;
  95. delta.timeVec = 0;
  96. mDataBlock = 0;
  97. mState = Forward;
  98. mNodeBase = 0;
  99. mNodeCount = 0;
  100. mPosition = 0;
  101. mTarget = 0;
  102. mTargetSet = false;
  103. MatrixF mat(1);
  104. mat.setPosition(Point3F(0,0,700));
  105. Parent::setTransform(mat);
  106. }
  107. PathCamera::~PathCamera()
  108. {
  109. }
  110. //----------------------------------------------------------------------------
  111. bool PathCamera::onAdd()
  112. {
  113. if(!Parent::onAdd())
  114. return false;
  115. // Initialize from the current transform.
  116. if (!mNodeCount) {
  117. QuatF rot(getTransform());
  118. Point3F pos = getPosition();
  119. mSpline.removeAll();
  120. mSpline.push_back(new CameraSpline::Knot(pos,rot,1,
  121. CameraSpline::Knot::NORMAL, CameraSpline::Knot::SPLINE));
  122. mNodeCount = 1;
  123. }
  124. //
  125. mObjBox.maxExtents = mObjScale;
  126. mObjBox.minExtents = mObjScale;
  127. mObjBox.minExtents.neg();
  128. resetWorldBox();
  129. if (mShapeInstance)
  130. {
  131. mNetFlags.set(Ghostable);
  132. setScopeAlways();
  133. }
  134. addToScene();
  135. return true;
  136. }
  137. void PathCamera::onRemove()
  138. {
  139. removeFromScene();
  140. Parent::onRemove();
  141. }
  142. bool PathCamera::onNewDataBlock( GameBaseData *dptr, bool reload )
  143. {
  144. mDataBlock = dynamic_cast< PathCameraData* >( dptr );
  145. if ( !mDataBlock || !Parent::onNewDataBlock( dptr, reload ) )
  146. return false;
  147. scriptOnNewDataBlock();
  148. return true;
  149. }
  150. //----------------------------------------------------------------------------
  151. void PathCamera::onEditorEnable()
  152. {
  153. mNetFlags.set(Ghostable);
  154. }
  155. void PathCamera::onEditorDisable()
  156. {
  157. mNetFlags.clear(Ghostable);
  158. }
  159. //----------------------------------------------------------------------------
  160. void PathCamera::initPersistFields()
  161. {
  162. Parent::initPersistFields();
  163. }
  164. void PathCamera::consoleInit()
  165. {
  166. }
  167. //----------------------------------------------------------------------------
  168. void PathCamera::processTick(const Move* move)
  169. {
  170. // client and server
  171. Parent::processTick(move);
  172. // Move to new time
  173. advancePosition(TickMs);
  174. // Set new position
  175. MatrixF mat;
  176. interpolateMat(mPosition,&mat);
  177. Parent::setTransform(mat);
  178. updateContainer();
  179. }
  180. void PathCamera::interpolateTick(F32 dt)
  181. {
  182. Parent::interpolateTick(dt);
  183. MatrixF mat;
  184. interpolateMat(delta.time + (delta.timeVec * dt),&mat);
  185. Parent::setRenderTransform(mat);
  186. }
  187. void PathCamera::interpolateMat(F32 pos,MatrixF* mat)
  188. {
  189. CameraSpline::Knot knot;
  190. mSpline.value(pos - mNodeBase,&knot);
  191. knot.mRotation.setMatrix(mat);
  192. mat->setPosition(knot.mPosition);
  193. }
  194. void PathCamera::advancePosition(S32 ms)
  195. {
  196. delta.timeVec = mPosition;
  197. // Advance according to current speed
  198. if (mState == Forward) {
  199. mPosition = mSpline.advanceTime(mPosition - mNodeBase,ms);
  200. if (mPosition > F32(mNodeCount - 1))
  201. mPosition = F32(mNodeCount - 1);
  202. mPosition += (F32)mNodeBase;
  203. if (mTargetSet && mPosition >= mTarget) {
  204. mTargetSet = false;
  205. mPosition = mTarget;
  206. mState = Stop;
  207. }
  208. }
  209. else
  210. if (mState == Backward) {
  211. mPosition = mSpline.advanceTime(mPosition - mNodeBase,-ms);
  212. if (mPosition < 0)
  213. mPosition = 0;
  214. mPosition += mNodeBase;
  215. if (mTargetSet && mPosition <= mTarget) {
  216. mTargetSet = false;
  217. mPosition = mTarget;
  218. mState = Stop;
  219. }
  220. }
  221. // Script callbacks
  222. if (int(mPosition) != int(delta.timeVec))
  223. onNode(int(mPosition));
  224. // Set frame interpolation
  225. delta.time = mPosition;
  226. delta.timeVec -= mPosition;
  227. }
  228. //----------------------------------------------------------------------------
  229. void PathCamera::getCameraTransform(F32* pos, MatrixF* mat)
  230. {
  231. // Overide the ShapeBase method to skip all the first/third person support.
  232. getRenderEyeTransform(mat);
  233. // Apply Camera FX.
  234. mat->mul( gCamFXMgr.getTrans() );
  235. }
  236. //----------------------------------------------------------------------------
  237. void PathCamera::setPosition(F32 pos)
  238. {
  239. mPosition = mClampF(pos, (F32)mNodeBase, (F32)(mNodeBase + mNodeCount - 1));
  240. MatrixF mat;
  241. interpolateMat(mPosition,&mat);
  242. Parent::setTransform(mat);
  243. setMaskBits(PositionMask);
  244. }
  245. void PathCamera::setTarget(F32 pos)
  246. {
  247. mTarget = pos;
  248. mTargetSet = true;
  249. if (mTarget > mPosition)
  250. mState = Forward;
  251. else
  252. if (mTarget < mPosition)
  253. mState = Backward;
  254. else {
  255. mTargetSet = false;
  256. mState = Stop;
  257. }
  258. setMaskBits(TargetMask | StateMask);
  259. }
  260. void PathCamera::setState(State s)
  261. {
  262. mState = s;
  263. setMaskBits(StateMask);
  264. }
  265. //-----------------------------------------------------------------------------
  266. void PathCamera::reset(F32 speed)
  267. {
  268. CameraSpline::Knot *knot = new CameraSpline::Knot;
  269. mSpline.value(mPosition - mNodeBase,knot);
  270. if (speed)
  271. knot->mSpeed = speed;
  272. mSpline.removeAll();
  273. mSpline.push_back(knot);
  274. mNodeBase = 0;
  275. mNodeCount = 1;
  276. mPosition = 0;
  277. mTargetSet = false;
  278. mState = Forward;
  279. setMaskBits(StateMask | PositionMask | WindowMask | TargetMask);
  280. }
  281. void PathCamera::pushBack(CameraSpline::Knot *knot)
  282. {
  283. // Make room at the end
  284. if (mNodeCount == NodeWindow) {
  285. delete mSpline.remove(mSpline.getKnot(0));
  286. mNodeBase++;
  287. }
  288. else
  289. mNodeCount++;
  290. // Fill in the new node
  291. mSpline.push_back(knot);
  292. setMaskBits(WindowMask);
  293. // Make sure the position doesn't fall off
  294. if (mPosition < mNodeBase) {
  295. mPosition = (F32)mNodeBase;
  296. setMaskBits(PositionMask);
  297. }
  298. }
  299. void PathCamera::pushFront(CameraSpline::Knot *knot)
  300. {
  301. // Make room at the front
  302. if (mNodeCount == NodeWindow)
  303. delete mSpline.remove(mSpline.getKnot(mNodeCount));
  304. else
  305. mNodeCount++;
  306. mNodeBase--;
  307. // Fill in the new node
  308. mSpline.push_front(knot);
  309. setMaskBits(WindowMask);
  310. // Make sure the position doesn't fall off
  311. if (mPosition > F32(mNodeBase + (NodeWindow - 1)))
  312. {
  313. mPosition = F32(mNodeBase + (NodeWindow - 1));
  314. setMaskBits(PositionMask);
  315. }
  316. }
  317. void PathCamera::popFront()
  318. {
  319. if (mNodeCount < 2)
  320. return;
  321. // Remove the first node. Node base and position are unaffected.
  322. mNodeCount--;
  323. delete mSpline.remove(mSpline.getKnot(0));
  324. if( mPosition > 0 )
  325. mPosition --;
  326. }
  327. //----------------------------------------------------------------------------
  328. void PathCamera::onNode(S32 node)
  329. {
  330. if (!isGhost())
  331. onNode_callback(node);
  332. }
  333. U32 PathCamera::packUpdate(NetConnection *con, U32 mask, BitStream *stream)
  334. {
  335. Parent::packUpdate(con,mask,stream);
  336. if (stream->writeFlag(mask & StateMask))
  337. stream->writeInt(mState,StateBits);
  338. if (stream->writeFlag(mask & PositionMask))
  339. stream->write(mPosition);
  340. if (stream->writeFlag(mask & TargetMask))
  341. if (stream->writeFlag(mTargetSet))
  342. stream->write(mTarget);
  343. if (stream->writeFlag(mask & WindowMask)) {
  344. stream->write(mNodeBase);
  345. stream->write(mNodeCount);
  346. for (S32 i = 0; i < mNodeCount; i++) {
  347. CameraSpline::Knot *knot = mSpline.getKnot(i);
  348. mathWrite(*stream, knot->mPosition);
  349. mathWrite(*stream, knot->mRotation);
  350. stream->write(knot->mSpeed);
  351. stream->writeInt(knot->mType, CameraSpline::Knot::NUM_TYPE_BITS);
  352. stream->writeInt(knot->mPath, CameraSpline::Knot::NUM_PATH_BITS);
  353. }
  354. }
  355. // The rest of the data is part of the control object packet update.
  356. // If we're controlled by this client, we don't need to send it.
  357. if(stream->writeFlag(getControllingClient() == con && !(mask & InitialUpdateMask)))
  358. return 0;
  359. return 0;
  360. }
  361. void PathCamera::unpackUpdate(NetConnection *con, BitStream *stream)
  362. {
  363. Parent::unpackUpdate(con,stream);
  364. // StateMask
  365. if (stream->readFlag())
  366. mState = stream->readInt(StateBits);
  367. // PositionMask
  368. if (stream->readFlag())
  369. {
  370. stream->read(&mPosition);
  371. delta.time = mPosition;
  372. delta.timeVec = 0;
  373. }
  374. // TargetMask
  375. if (stream->readFlag())
  376. {
  377. mTargetSet = stream->readFlag();
  378. if (mTargetSet)
  379. stream->read(&mTarget);
  380. }
  381. // WindowMask
  382. if (stream->readFlag())
  383. {
  384. mSpline.removeAll();
  385. stream->read(&mNodeBase);
  386. stream->read(&mNodeCount);
  387. for (S32 i = 0; i < mNodeCount; i++)
  388. {
  389. CameraSpline::Knot *knot = new CameraSpline::Knot();
  390. mathRead(*stream, &knot->mPosition);
  391. mathRead(*stream, &knot->mRotation);
  392. stream->read(&knot->mSpeed);
  393. knot->mType = (CameraSpline::Knot::Type)stream->readInt(CameraSpline::Knot::NUM_TYPE_BITS);
  394. knot->mPath = (CameraSpline::Knot::Path)stream->readInt(CameraSpline::Knot::NUM_PATH_BITS);
  395. mSpline.push_back(knot);
  396. }
  397. }
  398. // Controlled by the client?
  399. if (stream->readFlag())
  400. return;
  401. }
  402. //-----------------------------------------------------------------------------
  403. // Console access methods
  404. //-----------------------------------------------------------------------------
  405. DefineEngineMethod(PathCamera, setPosition, void, (F32 position),(0.0f), "Set the current position of the camera along the path.\n"
  406. "@param position Position along the path, from 0.0 (path start) - 1.0 (path end), to place the camera.\n"
  407. "@tsexample\n"
  408. "// Set the camera on a position along its path from 0.0 - 1.0.\n"
  409. "%position = \"0.35\";\n\n"
  410. "// Force the pathCamera to its new position along the path.\n"
  411. "%pathCamera.setPosition(%position);\n"
  412. "@endtsexample\n")
  413. {
  414. object->setPosition(position);
  415. }
  416. DefineEngineMethod(PathCamera, setTarget, void, (F32 position),(1.0f), "@brief Set the movement target for this camera along its path.\n\n"
  417. "The camera will attempt to move along the path to the given target in the direction provided "
  418. "by setState() (the default is forwards). Once the camera moves past this target it will come "
  419. "to a stop, and the target state will be cleared.\n"
  420. "@param position Target position, between 0.0 (path start) and 1.0 (path end), for the camera to move to along its path.\n"
  421. "@tsexample\n"
  422. "// Set the position target, between 0.0 (path start) and 1.0 (path end), for this camera to move to.\n"
  423. "%position = \"0.50\";\n\n"
  424. "// Inform the pathCamera of the new target position it will move to.\n"
  425. "%pathCamera.setTarget(%position);\n"
  426. "@endtsexample\n")
  427. {
  428. object->setTarget(position);
  429. }
  430. DefineEngineMethod(PathCamera, setState, void, (const char* newState),("forward"), "Set the movement state for this path camera.\n"
  431. "@param newState New movement state type for this camera. Forward, Backward or Stop.\n"
  432. "@tsexample\n"
  433. "// Set the state type (forward, backward, stop).\n"
  434. "// In this example, the camera will travel from the first node\n"
  435. "// to the last node (or target if given with setTarget())\n"
  436. "%state = \"forward\";\n\n"
  437. "// Inform the pathCamera to change its movement state to the defined value.\n"
  438. "%pathCamera.setState(%state);\n"
  439. "@endtsexample\n")
  440. {
  441. if (!dStricmp(newState,"forward"))
  442. object->setState(PathCamera::Forward);
  443. else
  444. if (!dStricmp(newState,"backward"))
  445. object->setState(PathCamera::Backward);
  446. else
  447. object->setState(PathCamera::Stop);
  448. }
  449. DefineEngineMethod(PathCamera, reset, void, (F32 speed),(1.0f), "@brief Clear the camera's path and set the camera's current transform as the start of the new path.\n\n"
  450. "What specifically occurs is a new knot is created from the camera's current transform. Then the current path "
  451. "is cleared and the new knot is pushed onto the path. Any previous target is cleared and the camera's movement "
  452. "state is set to Forward. The camera is now ready for a new path to be defined.\n"
  453. "@param speed Speed for the camera to move along its path after being reset.\n"
  454. "@tsexample\n"
  455. "//Determine the new movement speed of this camera. If not set, the speed will default to 1.0.\n"
  456. "%speed = \"0.50\";\n\n"
  457. "// Inform the path camera to start a new path at"
  458. "// the camera's current position, and set the new "
  459. "// path's speed value.\n"
  460. "%pathCamera.reset(%speed);\n"
  461. "@endtsexample\n")
  462. {
  463. object->reset(speed);
  464. }
  465. static CameraSpline::Knot::Type resolveKnotType(const char *arg)
  466. {
  467. if (dStricmp(arg, "Position Only") == 0)
  468. return CameraSpline::Knot::POSITION_ONLY;
  469. if (dStricmp(arg, "Kink") == 0)
  470. return CameraSpline::Knot::KINK;
  471. return CameraSpline::Knot::NORMAL;
  472. }
  473. static CameraSpline::Knot::Path resolveKnotPath(const char *arg)
  474. {
  475. if (!dStricmp(arg, "Linear"))
  476. return CameraSpline::Knot::LINEAR;
  477. return CameraSpline::Knot::SPLINE;
  478. }
  479. DefineEngineMethod(PathCamera, pushBack, void, (TransformF transform, F32 speed, const char* type, const char* path),
  480. (1.0f, "Normal", "Linear"),
  481. "@brief Adds a new knot to the back of a path camera's path.\n"
  482. "@param transform Transform for the new knot. In the form of \"x y z ax ay az aa\" such as returned by SceneObject::getTransform()\n"
  483. "@param speed Speed setting for this knot.\n"
  484. "@param type Knot type (Normal, Position Only, Kink).\n"
  485. "@param path %Path type (Linear, Spline).\n"
  486. "@tsexample\n"
  487. "// Transform vector for new knot. (Pos_X Pos_Y Pos_Z Rot_X Rot_Y Rot_Z Angle)\n"
  488. "%transform = \"15.0 5.0 5.0 1.4 1.0 0.2 1.0\"\n\n"
  489. "// Speed setting for knot.\n"
  490. "%speed = \"1.0\"\n\n"
  491. "// Knot type. (Normal, Position Only, Kink)\n"
  492. "%type = \"Normal\";\n\n"
  493. "// Path Type. (Linear, Spline)\n"
  494. "%path = \"Linear\";\n\n"
  495. "// Inform the path camera to add a new knot to the back of its path\n"
  496. "%pathCamera.pushBack(%transform,%speed,%type,%path);\n"
  497. "@endtsexample\n")
  498. {
  499. QuatF rot(transform.getOrientation());
  500. object->pushBack( new CameraSpline::Knot(transform.getPosition(), rot, speed, resolveKnotType(type), resolveKnotPath(path)) );
  501. }
  502. DefineEngineMethod(PathCamera, pushFront, void, (TransformF transform, F32 speed, const char* type, const char* path),
  503. (1.0f, "Normal", "Linear"),
  504. "@brief Adds a new knot to the front of a path camera's path.\n"
  505. "@param transform Transform for the new knot. In the form of \"x y z ax ay az aa\" such as returned by SceneObject::getTransform()\n"
  506. "@param speed Speed setting for this knot.\n"
  507. "@param type Knot type (Normal, Position Only, Kink).\n"
  508. "@param path %Path type (Linear, Spline).\n"
  509. "@tsexample\n"
  510. "// Transform vector for new knot. (Pos_X,Pos_Y,Pos_Z,Rot_X,Rot_Y,Rot_Z,Angle)\n"
  511. "%transform = \"15.0 5.0 5.0 1.4 1.0 0.2 1.0\"\n\n"
  512. "// Speed setting for knot.\n"
  513. "%speed = \"1.0\";\n\n"
  514. "// Knot type. (Normal, Position Only, Kink)\n"
  515. "%type = \"Normal\";\n\n"
  516. "// Path Type. (Linear, Spline)\n"
  517. "%path = \"Linear\";\n\n"
  518. "// Inform the path camera to add a new knot to the front of its path\n"
  519. "%pathCamera.pushFront(%transform, %speed, %type, %path);\n"
  520. "@endtsexample\n")
  521. {
  522. QuatF rot(transform.getOrientation());
  523. object->pushFront( new CameraSpline::Knot(transform.getPosition(), rot, speed, resolveKnotType(type), resolveKnotPath(path)) );
  524. }
  525. DefineEngineMethod(PathCamera, popFront, void, (),, "Removes the knot at the front of the camera's path.\n"
  526. "@tsexample\n"
  527. "// Remove the first knot in the camera's path.\n"
  528. "%pathCamera.popFront();\n"
  529. "@endtsexample\n")
  530. {
  531. object->popFront();
  532. }