You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

797 lines
51 KiB

4 years ago
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>LTSpline</title>
  6. <link rel="stylesheet" href="http://yui.yahooapis.com/3.8.0pr2/build/cssgrids/cssgrids-min.css">
  7. <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
  8. <link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
  9. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
  10. <script>
  11. (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  12. (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  13. m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  14. })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  15. ga('create', 'UA-23694672-1', 'dentedpixel.com');
  16. ga('send', 'pageview');
  17. </script>
  18. <script src="../assets/js/leantween.js"></script>
  19. <link rel="shortcut icon" type="image/png" href="../assets/favicon.png">
  20. <script src="http://yui.yahooapis.com/combo?3.8.0pr2/build/yui/yui-min.js"></script>
  21. </head>
  22. <body class="yui3-skin-sam">
  23. <div id="doc">
  24. <div id="hd" class="yui3-g header">
  25. <div class="yui3-u-3-4">
  26. <h1><a href="http://dentedpixel.com/developer-diary/leantween-speed-comparison-to-itween/"><img src="http://s3.amazonaws.com/dentedpixel.com/LeanTween/leantween-logo.png" title=""></a></h1> <div style="position:absolute; left:146px; top:90px;">- Developed by <a href="http://www.dentedpixel.com">Dented Pixel</a></div>
  27. </div>
  28. <div class="yui3-u-1-4 version">
  29. <em style="margin-top:2px">API Docs for: LeanTween 2.46</em><br>
  30. <table id="support">
  31. <tr>
  32. <td>
  33. <h3 style="margin:7px 0 3px 0; width: 200px;">Support LeanTween!</h3>
  34. <!--<a href="http://www.amazon.com/?tag=carbcutt-20&camp=1&creative=4365&linkCode=ez&ref-refURL=" target="_blank">Click this link</a> before your<br>next Amazon shopping spree!<br>
  35. -->
  36. </td>
  37. <td><!--
  38. <a href="http://www.amazon.com/?tag=carbcutt-20&camp=1&creative=4365&linkCode=ez&ref-refURL=" target="_blank"><img src="http://dentedpixel.com/LeanTweenDocumentation/assets/img/amz.gif" width="148" height="40" title="shop amazon" /></a>-->
  39. <form action="https://www.paypal.com/cgi-bin/webscr" method="post" style="margin-top:5px;">
  40. <!--<div style="margin:2px 0px 6px 24px; float:left;">or </div>-->
  41. <input type="hidden" name="cmd" value="_s-xclick">
  42. <input type="hidden" name="hosted_button_id" value="YJPUT3RAK5VL8">
  43. <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
  44. <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
  45. </form>
  46. </td>
  47. </tr>
  48. </table>
  49. </div>
  50. <h4 style="position:absolute; top:80px; right:7px; width:500px; letter-spacing:normal; word-spacing:normal; font-size:9pt; text-align:right; font-style: italic;">Maintaining and adding new features takes time, your support is appreciated.</h4>
  51. </div>
  52. <div id="bd" class="yui3-g">
  53. <div class="yui3-u-1-4">
  54. <div id="docs-sidebar" class="sidebar apidocs">
  55. <div id="api-list">
  56. <h2 class="off-left">APIs</h2>
  57. <div id="api-tabview" class="tabview">
  58. <ul class="tabs">
  59. <li><a href="#api-classes">Classes</a></li>
  60. <li><a href="#api-modules">Modules</a></li>
  61. </ul>
  62. <div id="api-tabview-filter">
  63. <input type="search" id="api-filter" placeholder="Type to filter APIs">
  64. </div>
  65. <div id="api-tabview-panel">
  66. <ul id="api-classes" class="apis classes">
  67. <li><a href="../classes/LeanAudio.html">LeanAudio</a></li>
  68. <li><a href="../classes/LeanAudioOptions.html">LeanAudioOptions</a></li>
  69. <li><a href="../classes/LeanTween.html">LeanTween</a></li>
  70. <li><a href="../classes/LeanTweenType.html">LeanTweenType</a></li>
  71. <li><a href="../classes/LTBezierPath.html">LTBezierPath</a></li>
  72. <li><a href="../classes/LTDescr.html">LTDescr</a></li>
  73. <li><a href="../classes/LTEvent.html">LTEvent</a></li>
  74. <li><a href="../classes/LTRect.html">LTRect</a></li>
  75. <li><a href="../classes/LTSeq.html">LTSeq</a></li>
  76. <li><a href="../classes/LTSpline.html">LTSpline</a></li>
  77. </ul>
  78. <ul id="api-modules" class="apis modules">
  79. </ul>
  80. </div>
  81. </div>
  82. </div>
  83. <div id="advertising">
  84. <h2>More From<br><a href="http://www.dentedpixel.com">Dented Pixel</a></h2><br>
  85. <a href="https://www.assetstore.unity3d.com/en/#!/content/9455" target="_blank"><img src="http://dentedpixel.com/assets/LTEditor-doc-icon.jpg" width="175" height="175" /><br>Create tweens with: Visual Editor. Sculpt complex spline paths.</a>
  86. <br>
  87. <a href="https://itunes.apple.com/us/app/monkeyshines/id530998075?mt=8" target="_blank"><img src="http://a1.mzstatic.com/us/r30/Purple3/v4/d4/2b/ce/d42bce69-b3d3-d7f8-88e9-caa92664b5b1/icon350x350.jpeg" width="175" height="175" /><br>RIN - A swinging good time!</a>
  88. <br>
  89. <a href="https://itunes.apple.com/us/app/princess-piano/id445283531?mt=8" target="_blank"><img src="http://a3.mzstatic.com/us/r1000/096/Purple/v4/8c/1e/05/8c1e0590-db82-1d72-2956-2b6470f37ed0/mza_4230031260893485317.175x175-75.jpg" width="175" height="175" /><br>Princess Piano - Learn musical notation<br>in this melodious adventure!</a>
  90. </div>
  91. </div>
  92. </div>
  93. <div class="yui3-u-3-4">
  94. <div id="api-options">
  95. Show:
  96. <label for="api-show-inherited">
  97. <input type="checkbox" id="api-show-inherited" checked>
  98. Inherited
  99. </label>
  100. <label for="api-show-protected">
  101. <input type="checkbox" id="api-show-protected">
  102. Protected
  103. </label>
  104. <label for="api-show-private">
  105. <input type="checkbox" id="api-show-private">
  106. Private
  107. </label>
  108. <label for="api-show-deprecated">
  109. <input type="checkbox" id="api-show-deprecated">
  110. Deprecated
  111. </label>
  112. </div>
  113. <div class="apidocs">
  114. <div id="docs-main">
  115. <div class="content">
  116. <h1>LTSpline Class</h1>
  117. <div class="box meta">
  118. <div class="foundat">
  119. Defined in: <a href="../files/LeanTween.cs.html#l2774"><code>LeanTween.cs:2774</code></a>
  120. </div>
  121. </div>
  122. <div class="box intro">
  123. <p>Animate along a set of points that need to be in the format: controlPoint, point1, point2.... pointLast, endControlPoint <summary>Move a GameObject to a certain location</summary></p>
  124. </div>
  125. <div class="constructor">
  126. <h2>Constructor</h2>
  127. <div id="method_LTSpline" class="method item">
  128. <h3 class="name"><code>LTSpline</code></h3>
  129. <div class="args">
  130. <span class="paren">(</span><ul class="args-list inline commas">
  131. <li class="arg">
  132. <code>pts</code>
  133. </li>
  134. </ul><span class="paren">)</span>
  135. </div>
  136. <div class="meta">
  137. <p>
  138. Defined in
  139. <a href="../files/LeanTween.cs.html#l2774"><code>LeanTween.cs:2774</code></a>
  140. </p>
  141. </div>
  142. <div class="description">
  143. </div>
  144. <div class="params">
  145. <h4>Parameters:</h4>
  146. <ul class="params-list">
  147. <li class="param">
  148. <code class="param-name">pts</code>
  149. <span class="type">Vector3 Array</span>
  150. <div class="param-description">
  151. <p>A set of points that define the points the path will pass through (starting with starting control point, and ending with a control point)<br />
  152. <i><strong>Note:</strong> The first and last item just define the angle of the end points, they are not actually used in the spline path itself. If you do not care about the angle you can jus set the first two items and last two items as the same value.</i></p>
  153. </div>
  154. </li>
  155. </ul>
  156. </div>
  157. <div class="example">
  158. <h4>Example:</h4>
  159. <div class="example-content">
  160. <p>LTSpline ltSpline = new LTSpline( new Vector3[] { new Vector3(0f,0f,0f),new Vector3(0f,0f,0f), new Vector3(0f,0.5f,0f), new Vector3(1f,1f,0f), new Vector3(1f,1f,0f)} );<br /><br />
  161. LeanTween.moveSpline(lt, ltSpline.vec3, 4.0f).setOrientToPath(true).setDelay(1f).setEase(LeanTweenType.easeInOutQuad); // animate <br />
  162. Vector3 pt = ltSpline.point( 0.6f ); // retrieve a point along the path</p>
  163. </div>
  164. </div>
  165. </div>
  166. </div>
  167. <div id="classdocs" class="tabview">
  168. <ul class="api-class-tabs">
  169. <li class="api-class-tab index"><a href="#index">Index</a></li>
  170. <li class="api-class-tab methods"><a href="#methods">Methods</a></li>
  171. <li class="api-class-tab properties"><a href="#properties">Properties</a></li>
  172. </ul>
  173. <div>
  174. <div id="index" class="api-class-tabpanel index">
  175. <h2 class="off-left">Item Index</h2>
  176. <div class="index-section methods">
  177. <h3>Methods</h3>
  178. <ul class="index-list methods">
  179. <li class="index-item method">
  180. <a href="#method_place">place</a>
  181. </li>
  182. <li class="index-item method">
  183. <a href="#method_place">place</a>
  184. </li>
  185. <li class="index-item method">
  186. <a href="#method_placeLocal">placeLocal</a>
  187. </li>
  188. <li class="index-item method">
  189. <a href="#method_placeLocal">placeLocal</a>
  190. </li>
  191. <li class="index-item method">
  192. <a href="#method_point">point</a>
  193. </li>
  194. <li class="index-item method">
  195. <a href="#method_ratioAtPoint">ratioAtPoint</a>
  196. </li>
  197. </ul>
  198. </div>
  199. <div class="index-section properties">
  200. <h3>Properties</h3>
  201. <ul class="index-list properties">
  202. <li class="index-item property">
  203. <a href="#property_distance distance of the spline (in unity units)">distance distance of the spline (in unity units)</a>
  204. </li>
  205. </ul>
  206. </div>
  207. </div>
  208. <div id="methods" class="api-class-tabpanel">
  209. <h2 class="off-left">Methods</h2>
  210. <div id="method_place" class="method item">
  211. <h3 class="name"><code>place</code></h3>
  212. <div class="args">
  213. <span class="paren">(</span><ul class="args-list inline commas">
  214. <li class="arg">
  215. <code>transform:Transform</code>
  216. </li>
  217. <li class="arg">
  218. <code>ratio:float</code>
  219. </li>
  220. </ul><span class="paren">)</span>
  221. </div>
  222. <div class="meta">
  223. <p>
  224. Defined in
  225. <a href="../files/LeanTween.cs.html#l2992"><code>LeanTween.cs:2992</code></a>
  226. </p>
  227. </div>
  228. <div class="description">
  229. <p>Place an object along a certain point on the path (facing the direction perpendicular to the path) <summary>Move a GameObject to a certain location</summary></p>
  230. </div>
  231. <div class="params">
  232. <h4>Parameters:</h4>
  233. <ul class="params-list">
  234. <li class="param">
  235. <code class="param-name">transform:Transform</code>
  236. <span class="type">Transform</span>
  237. <div class="param-description">
  238. <p>the transform of the object you wish to place along the path</p>
  239. </div>
  240. </li>
  241. <li class="param">
  242. <code class="param-name">ratio:float</code>
  243. <span class="type">Float</span>
  244. <div class="param-description">
  245. <p>ratio of the point along the path you wish to receive (0-1)</p>
  246. </div>
  247. </li>
  248. </ul>
  249. </div>
  250. <div class="example">
  251. <h4>Example:</h4>
  252. <div class="example-content">
  253. <p>ltPath.place( transform, 0.6f );</p>
  254. </div>
  255. </div>
  256. </div>
  257. <div id="method_place" class="method item">
  258. <h3 class="name"><code>place</code></h3>
  259. <div class="args">
  260. <span class="paren">(</span><ul class="args-list inline commas">
  261. <li class="arg">
  262. <code>transform:Transform</code>
  263. </li>
  264. <li class="arg">
  265. <code>ratio:float</code>
  266. </li>
  267. <li class="arg">
  268. <code>rotation:Vector3</code>
  269. </li>
  270. </ul><span class="paren">)</span>
  271. </div>
  272. <div class="meta">
  273. <p>
  274. Defined in
  275. <a href="../files/LeanTween.cs.html#l3005"><code>LeanTween.cs:3005</code></a>
  276. </p>
  277. </div>
  278. <div class="description">
  279. <p>Place an object along a certain point on the path, with it facing a certain direction perpendicular to the path <summary>Move a GameObject to a certain location</summary></p>
  280. </div>
  281. <div class="params">
  282. <h4>Parameters:</h4>
  283. <ul class="params-list">
  284. <li class="param">
  285. <code class="param-name">transform:Transform</code>
  286. <span class="type">Transform</span>
  287. <div class="param-description">
  288. <p>the transform of the object you wish to place along the path</p>
  289. </div>
  290. </li>
  291. <li class="param">
  292. <code class="param-name">ratio:float</code>
  293. <span class="type">Float</span>
  294. <div class="param-description">
  295. <p>ratio of the point along the path you wish to receive (0-1)</p>
  296. </div>
  297. </li>
  298. <li class="param">
  299. <code class="param-name">rotation:Vector3</code>
  300. <span class="type">Vector3</span>
  301. <div class="param-description">
  302. <p>the direction in which to place the transform ex: Vector3.up</p>
  303. </div>
  304. </li>
  305. </ul>
  306. </div>
  307. <div class="example">
  308. <h4>Example:</h4>
  309. <div class="example-content">
  310. <p>ltPath.place( transform, 0.6f, Vector3.left );</p>
  311. </div>
  312. </div>
  313. </div>
  314. <div id="method_placeLocal" class="method item">
  315. <h3 class="name"><code>placeLocal</code></h3>
  316. <div class="args">
  317. <span class="paren">(</span><ul class="args-list inline commas">
  318. <li class="arg">
  319. <code>transform:Transform</code>
  320. </li>
  321. <li class="arg">
  322. <code>ratio:float</code>
  323. </li>
  324. </ul><span class="paren">)</span>
  325. </div>
  326. <div class="meta">
  327. <p>
  328. Defined in
  329. <a href="../files/LeanTween.cs.html#l3024"><code>LeanTween.cs:3024</code></a>
  330. </p>
  331. </div>
  332. <div class="description">
  333. <p>Place an object along a certain point on the path (facing the direction perpendicular to the path) - Local Space, not world-space <summary>Move a GameObject to a certain location</summary></p>
  334. </div>
  335. <div class="params">
  336. <h4>Parameters:</h4>
  337. <ul class="params-list">
  338. <li class="param">
  339. <code class="param-name">transform:Transform</code>
  340. <span class="type">Transform</span>
  341. <div class="param-description">
  342. <p>the transform of the object you wish to place along the path</p>
  343. </div>
  344. </li>
  345. <li class="param">
  346. <code class="param-name">ratio:float</code>
  347. <span class="type">Float</span>
  348. <div class="param-description">
  349. <p>ratio of the point along the path you wish to receive (0-1)</p>
  350. </div>
  351. </li>
  352. </ul>
  353. </div>
  354. <div class="example">
  355. <h4>Example:</h4>
  356. <div class="example-content">
  357. <p>ltPath.placeLocal( transform, 0.6f );</p>
  358. </div>
  359. </div>
  360. </div>
  361. <div id="method_placeLocal" class="method item">
  362. <h3 class="name"><code>placeLocal</code></h3>
  363. <div class="args">
  364. <span class="paren">(</span><ul class="args-list inline commas">
  365. <li class="arg">
  366. <code>transform:Transform</code>
  367. </li>
  368. <li class="arg">
  369. <code>ratio:float</code>
  370. </li>
  371. <li class="arg">
  372. <code>rotation:Vector3</code>
  373. </li>
  374. </ul><span class="paren">)</span>
  375. </div>
  376. <div class="meta">
  377. <p>
  378. Defined in
  379. <a href="../files/LeanTween.cs.html#l3037"><code>LeanTween.cs:3037</code></a>
  380. </p>
  381. </div>
  382. <div class="description">
  383. <p>Place an object along a certain point on the path, with it facing a certain direction perpendicular to the path - Local Space, not world-space <summary>Move a GameObject to a certain location</summary></p>
  384. </div>
  385. <div class="params">
  386. <h4>Parameters:</h4>
  387. <ul class="params-list">
  388. <li class="param">
  389. <code class="param-name">transform:Transform</code>
  390. <span class="type">Transform</span>
  391. <div class="param-description">
  392. <p>the transform of the object you wish to place along the path</p>
  393. </div>
  394. </li>
  395. <li class="param">
  396. <code class="param-name">ratio:float</code>
  397. <span class="type">Float</span>
  398. <div class="param-description">
  399. <p>ratio of the point along the path you wish to receive (0-1)</p>
  400. </div>
  401. </li>
  402. <li class="param">
  403. <code class="param-name">rotation:Vector3</code>
  404. <span class="type">Vector3</span>
  405. <div class="param-description">
  406. <p>the direction in which to place the transform ex: Vector3.up</p>
  407. </div>
  408. </li>
  409. </ul>
  410. </div>
  411. <div class="example">
  412. <h4>Example:</h4>
  413. <div class="example-content">
  414. <p>ltPath.placeLocal( transform, 0.6f, Vector3.left );</p>
  415. </div>
  416. </div>
  417. </div>
  418. <div id="method_point" class="method item">
  419. <h3 class="name"><code>point</code></h3>
  420. <div class="args">
  421. <span class="paren">(</span><ul class="args-list inline commas">
  422. <li class="arg">
  423. <code>ratio:float</code>
  424. </li>
  425. </ul><span class="paren">)</span>
  426. </div>
  427. <span class="returns-inline">
  428. <span class="type">Vector3</span>
  429. </span>
  430. <div class="meta">
  431. <p>
  432. Defined in
  433. <a href="../files/LeanTween.cs.html#l2951"><code>LeanTween.cs:2951</code></a>
  434. </p>
  435. </div>
  436. <div class="description">
  437. <p>Retrieve a point along a path <summary>Move a GameObject to a certain location</summary></p>
  438. </div>
  439. <div class="params">
  440. <h4>Parameters:</h4>
  441. <ul class="params-list">
  442. <li class="param">
  443. <code class="param-name">ratio:float</code>
  444. <span class="type">Float</span>
  445. <div class="param-description">
  446. <p>ratio of the point along the path you wish to receive (0-1)</p>
  447. </div>
  448. </li>
  449. </ul>
  450. </div>
  451. <div class="returns">
  452. <h4>Returns:</h4>
  453. <div class="returns-description">
  454. <span class="type">Vector3</span>:
  455. <p>Vector3 position of the point along the path</p>
  456. </div>
  457. </div>
  458. <div class="example">
  459. <h4>Example:</h4>
  460. <div class="example-content">
  461. <p>transform.position = ltSpline.point( 0.6f );</p>
  462. </div>
  463. </div>
  464. </div>
  465. <div id="method_ratioAtPoint" class="method item">
  466. <h3 class="name"><code>ratioAtPoint</code></h3>
  467. <div class="args">
  468. <span class="paren">(</span><ul class="args-list inline commas">
  469. <li class="arg">
  470. <code>point:Vector3</code>
  471. </li>
  472. </ul><span class="paren">)</span>
  473. </div>
  474. <span class="returns-inline">
  475. <span class="type">Float</span>
  476. </span>
  477. <div class="meta">
  478. <p>
  479. Defined in
  480. <a href="../files/LeanTween.cs.html#l2927"><code>LeanTween.cs:2927</code></a>
  481. </p>
  482. </div>
  483. <div class="description">
  484. <p>Retrieve a point along a path <summary>Move a GameObject to a certain location</summary></p>
  485. </div>
  486. <div class="params">
  487. <h4>Parameters:</h4>
  488. <ul class="params-list">
  489. <li class="param">
  490. <code class="param-name">point:Vector3</code>
  491. <span class="type">Vector3</span>
  492. <div class="param-description">
  493. <p>given a current location it makes the best approximiation of where it is along the path ratio-wise (0-1)</p>
  494. </div>
  495. </li>
  496. </ul>
  497. </div>
  498. <div class="returns">
  499. <h4>Returns:</h4>
  500. <div class="returns-description">
  501. <span class="type">Float</span>:
  502. <p>float of ratio along the path</p>
  503. </div>
  504. </div>
  505. <div class="example">
  506. <h4>Example:</h4>
  507. <div class="example-content">
  508. <p>ratioIter = ltSpline.ratioAtPoint( transform.position );</p>
  509. </div>
  510. </div>
  511. </div>
  512. </div>
  513. <div id="properties" class="api-class-tabpanel">
  514. <h2 class="off-left">Properties</h2>
  515. <div id="property_distance distance of the spline (in unity units)" class="property item">
  516. <h3 class="name"><code>distance distance of the spline (in unity units)</code></h3>
  517. <span class="type">Float</span>
  518. <div class="meta">
  519. <p>
  520. Defined in
  521. <a href="../files/LeanTween.cs.html#l2790"><code>LeanTween.cs:2790</code></a>
  522. </p>
  523. </div>
  524. <div class="description">
  525. </div>
  526. </div>
  527. </div>
  528. </div>
  529. </div>
  530. </div>
  531. </div>
  532. </div>
  533. </div>
  534. </div>
  535. </div>
  536. <script src="../assets/vendor/prettify/prettify-min.js"></script>
  537. <script>prettyPrint();</script>
  538. <script src="../assets/js/yui-prettify.js"></script>
  539. <script src="../assets/../api.js"></script>
  540. <script src="../assets/js/api-filter.js"></script>
  541. <script src="../assets/js/api-list.js"></script>
  542. <script src="../assets/js/api-search.js"></script>
  543. <script src="../assets/js/apidocs.js"></script>
  544. </body>
  545. </html>