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.

721 lines
46 KiB

4 years ago
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>LTBezierPath</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>LTBezierPath Class</h1>
  117. <div class="box meta">
  118. <div class="foundat">
  119. Defined in: <a href="../files/LeanTween.cs.html#l2592"><code>LeanTween.cs:2592</code></a>
  120. </div>
  121. </div>
  122. <div class="box intro">
  123. <p>Manually animate along a bezier path with this class</p>
  124. </div>
  125. <div class="constructor">
  126. <h2>Constructor</h2>
  127. <div id="method_LTBezierPath" class="method item">
  128. <h3 class="name"><code>LTBezierPath</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#l2592"><code>LeanTween.cs:2592</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 one or many bezier paths (the paths should be passed in multiples of 4, which correspond to each individual bezier curve)<br />
  152. It goes in the order: <strong>startPoint</strong>,endControl,startControl,<strong>endPoint</strong> - <strong>Note:</strong> the control for the end and start are reversed! This is just a <em>quirk</em> of the API.<br />
  153. <img src="http://dentedpixel.com/assets/LTBezierExplanation.gif" width="413" height="196" style="margin-top:10px" /></p>
  154. </div>
  155. </li>
  156. </ul>
  157. </div>
  158. <div class="example">
  159. <h4>Example:</h4>
  160. <div class="example-content">
  161. <p>LTBezierPath ltPath = new LTBezierPath( new Vector3[] { new Vector3(0f,0f,0f),new Vector3(1f,0f,0f), new Vector3(1f,0f,0f), new Vector3(1f,1f,0f)} );<br /><br />
  162. LeanTween.move(lt, ltPath.vec3, 4.0f).setOrientToPath(true).setDelay(1f).setEase(LeanTweenType.easeInOutQuad); // animate <br />
  163. Vector3 pt = ltPath.point( 0.6f ); // retrieve a point along the path</p>
  164. </div>
  165. </div>
  166. </div>
  167. </div>
  168. <div id="classdocs" class="tabview">
  169. <ul class="api-class-tabs">
  170. <li class="api-class-tab index"><a href="#index">Index</a></li>
  171. <li class="api-class-tab methods"><a href="#methods">Methods</a></li>
  172. <li class="api-class-tab properties"><a href="#properties">Properties</a></li>
  173. </ul>
  174. <div>
  175. <div id="index" class="api-class-tabpanel index">
  176. <h2 class="off-left">Item Index</h2>
  177. <div class="index-section methods">
  178. <h3>Methods</h3>
  179. <ul class="index-list methods">
  180. <li class="index-item method">
  181. <a href="#method_place">place</a>
  182. </li>
  183. <li class="index-item method">
  184. <a href="#method_place">place</a>
  185. </li>
  186. <li class="index-item method">
  187. <a href="#method_placeLocal">placeLocal</a>
  188. </li>
  189. <li class="index-item method">
  190. <a href="#method_placeLocal">placeLocal</a>
  191. </li>
  192. <li class="index-item method">
  193. <a href="#method_point">point</a>
  194. </li>
  195. </ul>
  196. </div>
  197. <div class="index-section properties">
  198. <h3>Properties</h3>
  199. <ul class="index-list properties">
  200. <li class="index-item property">
  201. <a href="#property_distance distance of the path (in unity units)">distance distance of the path (in unity units)</a>
  202. </li>
  203. </ul>
  204. </div>
  205. </div>
  206. <div id="methods" class="api-class-tabpanel">
  207. <h2 class="off-left">Methods</h2>
  208. <div id="method_place" class="method item">
  209. <h3 class="name"><code>place</code></h3>
  210. <div class="args">
  211. <span class="paren">(</span><ul class="args-list inline commas">
  212. <li class="arg">
  213. <code>transform:Transform</code>
  214. </li>
  215. <li class="arg">
  216. <code>ratio:float</code>
  217. </li>
  218. </ul><span class="paren">)</span>
  219. </div>
  220. <div class="meta">
  221. <p>
  222. Defined in
  223. <a href="../files/LeanTween.cs.html#l2691"><code>LeanTween.cs:2691</code></a>
  224. </p>
  225. </div>
  226. <div class="description">
  227. <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>
  228. </div>
  229. <div class="params">
  230. <h4>Parameters:</h4>
  231. <ul class="params-list">
  232. <li class="param">
  233. <code class="param-name">transform:Transform</code>
  234. <span class="type">Transform</span>
  235. <div class="param-description">
  236. <p>the transform of the object you wish to place along the path</p>
  237. </div>
  238. </li>
  239. <li class="param">
  240. <code class="param-name">ratio:float</code>
  241. <span class="type">Float</span>
  242. <div class="param-description">
  243. <p>ratio of the point along the path you wish to receive (0-1)</p>
  244. </div>
  245. </li>
  246. </ul>
  247. </div>
  248. <div class="example">
  249. <h4>Example:</h4>
  250. <div class="example-content">
  251. <p>ltPath.place( transform, 0.6f );</p>
  252. </div>
  253. </div>
  254. </div>
  255. <div id="method_place" class="method item">
  256. <h3 class="name"><code>place</code></h3>
  257. <div class="args">
  258. <span class="paren">(</span><ul class="args-list inline commas">
  259. <li class="arg">
  260. <code>transform:Transform</code>
  261. </li>
  262. <li class="arg">
  263. <code>ratio:float</code>
  264. </li>
  265. <li class="arg">
  266. <code>rotation:Vector3</code>
  267. </li>
  268. </ul><span class="paren">)</span>
  269. </div>
  270. <div class="meta">
  271. <p>
  272. Defined in
  273. <a href="../files/LeanTween.cs.html#l2705"><code>LeanTween.cs:2705</code></a>
  274. </p>
  275. </div>
  276. <div class="description">
  277. <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>
  278. </div>
  279. <div class="params">
  280. <h4>Parameters:</h4>
  281. <ul class="params-list">
  282. <li class="param">
  283. <code class="param-name">transform:Transform</code>
  284. <span class="type">Transform</span>
  285. <div class="param-description">
  286. <p>the transform of the object you wish to place along the path</p>
  287. </div>
  288. </li>
  289. <li class="param">
  290. <code class="param-name">ratio:float</code>
  291. <span class="type">Float</span>
  292. <div class="param-description">
  293. <p>ratio of the point along the path you wish to receive (0-1)</p>
  294. </div>
  295. </li>
  296. <li class="param">
  297. <code class="param-name">rotation:Vector3</code>
  298. <span class="type">Vector3</span>
  299. <div class="param-description">
  300. <p>the direction in which to place the transform ex: Vector3.up</p>
  301. </div>
  302. </li>
  303. </ul>
  304. </div>
  305. <div class="example">
  306. <h4>Example:</h4>
  307. <div class="example-content">
  308. <p>ltPath.place( transform, 0.6f, Vector3.left );</p>
  309. </div>
  310. </div>
  311. </div>
  312. <div id="method_placeLocal" class="method item">
  313. <h3 class="name"><code>placeLocal</code></h3>
  314. <div class="args">
  315. <span class="paren">(</span><ul class="args-list inline commas">
  316. <li class="arg">
  317. <code>transform:Transform</code>
  318. </li>
  319. <li class="arg">
  320. <code>ratio:float</code>
  321. </li>
  322. </ul><span class="paren">)</span>
  323. </div>
  324. <div class="meta">
  325. <p>
  326. Defined in
  327. <a href="../files/LeanTween.cs.html#l2723"><code>LeanTween.cs:2723</code></a>
  328. </p>
  329. </div>
  330. <div class="description">
  331. <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>
  332. </div>
  333. <div class="params">
  334. <h4>Parameters:</h4>
  335. <ul class="params-list">
  336. <li class="param">
  337. <code class="param-name">transform:Transform</code>
  338. <span class="type">Transform</span>
  339. <div class="param-description">
  340. <p>the transform of the object you wish to place along the path</p>
  341. </div>
  342. </li>
  343. <li class="param">
  344. <code class="param-name">ratio:float</code>
  345. <span class="type">Float</span>
  346. <div class="param-description">
  347. <p>ratio of the point along the path you wish to receive (0-1)</p>
  348. </div>
  349. </li>
  350. </ul>
  351. </div>
  352. <div class="example">
  353. <h4>Example:</h4>
  354. <div class="example-content">
  355. <p>ltPath.placeLocal( transform, 0.6f );</p>
  356. </div>
  357. </div>
  358. </div>
  359. <div id="method_placeLocal" class="method item">
  360. <h3 class="name"><code>placeLocal</code></h3>
  361. <div class="args">
  362. <span class="paren">(</span><ul class="args-list inline commas">
  363. <li class="arg">
  364. <code>transform:Transform</code>
  365. </li>
  366. <li class="arg">
  367. <code>ratio:float</code>
  368. </li>
  369. <li class="arg">
  370. <code>rotation:Vector3</code>
  371. </li>
  372. </ul><span class="paren">)</span>
  373. </div>
  374. <div class="meta">
  375. <p>
  376. Defined in
  377. <a href="../files/LeanTween.cs.html#l2736"><code>LeanTween.cs:2736</code></a>
  378. </p>
  379. </div>
  380. <div class="description">
  381. <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>
  382. </div>
  383. <div class="params">
  384. <h4>Parameters:</h4>
  385. <ul class="params-list">
  386. <li class="param">
  387. <code class="param-name">transform:Transform</code>
  388. <span class="type">Transform</span>
  389. <div class="param-description">
  390. <p>the transform of the object you wish to place along the path</p>
  391. </div>
  392. </li>
  393. <li class="param">
  394. <code class="param-name">ratio:float</code>
  395. <span class="type">Float</span>
  396. <div class="param-description">
  397. <p>ratio of the point along the path you wish to receive (0-1)</p>
  398. </div>
  399. </li>
  400. <li class="param">
  401. <code class="param-name">rotation:Vector3</code>
  402. <span class="type">Vector3</span>
  403. <div class="param-description">
  404. <p>the direction in which to place the transform ex: Vector3.up</p>
  405. </div>
  406. </li>
  407. </ul>
  408. </div>
  409. <div class="example">
  410. <h4>Example:</h4>
  411. <div class="example-content">
  412. <p>ltPath.placeLocal( transform, 0.6f, Vector3.left );</p>
  413. </div>
  414. </div>
  415. </div>
  416. <div id="method_point" class="method item">
  417. <h3 class="name"><code>point</code></h3>
  418. <div class="args">
  419. <span class="paren">(</span><ul class="args-list inline commas">
  420. <li class="arg">
  421. <code>ratio:float</code>
  422. </li>
  423. </ul><span class="paren">)</span>
  424. </div>
  425. <span class="returns-inline">
  426. <span class="type">Vector3</span>
  427. </span>
  428. <div class="meta">
  429. <p>
  430. Defined in
  431. <a href="../files/LeanTween.cs.html#l2652"><code>LeanTween.cs:2652</code></a>
  432. </p>
  433. </div>
  434. <div class="description">
  435. <p>Retrieve a point along a path <summary>Move a GameObject to a certain location</summary></p>
  436. </div>
  437. <div class="params">
  438. <h4>Parameters:</h4>
  439. <ul class="params-list">
  440. <li class="param">
  441. <code class="param-name">ratio:float</code>
  442. <span class="type">Float</span>
  443. <div class="param-description">
  444. <p>ratio of the point along the path you wish to receive (0-1)</p>
  445. </div>
  446. </li>
  447. </ul>
  448. </div>
  449. <div class="returns">
  450. <h4>Returns:</h4>
  451. <div class="returns-description">
  452. <span class="type">Vector3</span>:
  453. <p>Vector3 position of the point along the path</p>
  454. </div>
  455. </div>
  456. <div class="example">
  457. <h4>Example:</h4>
  458. <div class="example-content">
  459. <p>transform.position = ltPath.point( 0.6f );</p>
  460. </div>
  461. </div>
  462. </div>
  463. </div>
  464. <div id="properties" class="api-class-tabpanel">
  465. <h2 class="off-left">Properties</h2>
  466. <div id="property_distance distance of the path (in unity units)" class="property item">
  467. <h3 class="name"><code>distance distance of the path (in unity units)</code></h3>
  468. <span class="type">Float</span>
  469. <div class="meta">
  470. <p>
  471. Defined in
  472. <a href="../files/LeanTween.cs.html#l2643"><code>LeanTween.cs:2643</code></a>
  473. </p>
  474. </div>
  475. <div class="description">
  476. </div>
  477. </div>
  478. </div>
  479. </div>
  480. </div>
  481. </div>
  482. </div>
  483. </div>
  484. </div>
  485. </div>
  486. </div>
  487. <script src="../assets/vendor/prettify/prettify-min.js"></script>
  488. <script>prettyPrint();</script>
  489. <script src="../assets/js/yui-prettify.js"></script>
  490. <script src="../assets/../api.js"></script>
  491. <script src="../assets/js/api-filter.js"></script>
  492. <script src="../assets/js/api-list.js"></script>
  493. <script src="../assets/js/api-search.js"></script>
  494. <script src="../assets/js/apidocs.js"></script>
  495. </body>
  496. </html>