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.

995 lines
65 KiB

  1. {$IF DEFINED(__VECTOR_HELPER_INTERFACE)}
  2. {$IFDEF __HELPER}
  3. type __HELPER = type helper for __VEC
  4. public
  5. {$IF __SIZE = 2}
  6. class function Create(const x, y: __IMPL.TBaseType): __IMPL.TVector2; static; inline;
  7. {$ELSEIF __SIZE = 3}
  8. class function Create(const x, y, z: __IMPL.TBaseType): __IMPL.TVector3; static; inline;
  9. {$ELSEIF __SIZE = 4}
  10. class function Create(const x, y, z, w: __IMPL.TBaseType): __IMPL.TVector4; static; inline;
  11. {$ELSE}
  12. {$ERROR only vectors of size 2, 3 or 4 are supported}
  13. {$ENDIF}
  14. function ToString(const aRound: Integer = -3): String; inline;
  15. class function FromString(const s: String): __VEC; static; inline;
  16. class function TryFromString(const s: String; out v: __VEC): Boolean; static; inline;
  17. class function Zero: __VEC; static; inline;
  18. {$IF __SIZE = 2}
  19. function x: __IMPL.TBaseType; inline;
  20. function y: __IMPL.TBaseType; inline;
  21. function yx: __IMPL.TVector2; inline;
  22. {$ENDIF}
  23. {$IF __SIZE = 3}
  24. function x: __IMPL.TBaseType; inline;
  25. function y: __IMPL.TBaseType; inline;
  26. function z: __IMPL.TBaseType; inline;
  27. function xx: __IMPL.TVector2; inline;
  28. function xy: __IMPL.TVector2; inline;
  29. function xz: __IMPL.TVector2; inline;
  30. function yx: __IMPL.TVector2; inline;
  31. function yy: __IMPL.TVector2; inline;
  32. function yz: __IMPL.TVector2; inline;
  33. function zx: __IMPL.TVector2; inline;
  34. function zy: __IMPL.TVector2; inline;
  35. function zz: __IMPL.TVector2; inline;
  36. function xxx: __IMPL.TVector3; inline;
  37. function xxy: __IMPL.TVector3; inline;
  38. function xxz: __IMPL.TVector3; inline;
  39. function xyx: __IMPL.TVector3; inline;
  40. function xyy: __IMPL.TVector3; inline;
  41. function xyz: __IMPL.TVector3; inline;
  42. function xzx: __IMPL.TVector3; inline;
  43. function xzy: __IMPL.TVector3; inline;
  44. function xzz: __IMPL.TVector3; inline;
  45. function yxx: __IMPL.TVector3; inline;
  46. function yxy: __IMPL.TVector3; inline;
  47. function yxz: __IMPL.TVector3; inline;
  48. function yyx: __IMPL.TVector3; inline;
  49. function yyy: __IMPL.TVector3; inline;
  50. function yyz: __IMPL.TVector3; inline;
  51. function yzx: __IMPL.TVector3; inline;
  52. function yzy: __IMPL.TVector3; inline;
  53. function yzz: __IMPL.TVector3; inline;
  54. function zxx: __IMPL.TVector3; inline;
  55. function zxy: __IMPL.TVector3; inline;
  56. function zxz: __IMPL.TVector3; inline;
  57. function zyx: __IMPL.TVector3; inline;
  58. function zyy: __IMPL.TVector3; inline;
  59. function zyz: __IMPL.TVector3; inline;
  60. function zzx: __IMPL.TVector3; inline;
  61. function zzy: __IMPL.TVector3; inline;
  62. function zzz: __IMPL.TVector3; inline;
  63. {$ENDIF}
  64. {$IF __SIZE = 4}
  65. function x: __IMPL.TBaseType; inline;
  66. function y: __IMPL.TBaseType; inline;
  67. function z: __IMPL.TBaseType; inline;
  68. function w: __IMPL.TBaseType; inline;
  69. function xx: __IMPL.TVector2; inline;
  70. function xy: __IMPL.TVector2; inline;
  71. function xz: __IMPL.TVector2; inline;
  72. function xw: __IMPL.TVector2; inline;
  73. function yx: __IMPL.TVector2; inline;
  74. function yy: __IMPL.TVector2; inline;
  75. function yz: __IMPL.TVector2; inline;
  76. function yw: __IMPL.TVector2; inline;
  77. function zx: __IMPL.TVector2; inline;
  78. function zy: __IMPL.TVector2; inline;
  79. function zz: __IMPL.TVector2; inline;
  80. function zw: __IMPL.TVector2; inline;
  81. function wx: __IMPL.TVector2; inline;
  82. function wy: __IMPL.TVector2; inline;
  83. function wz: __IMPL.TVector2; inline;
  84. function ww: __IMPL.TVector2; inline;
  85. function xxx: __IMPL.TVector3; inline;
  86. function xxy: __IMPL.TVector3; inline;
  87. function xxz: __IMPL.TVector3; inline;
  88. function xxw: __IMPL.TVector3; inline;
  89. function xyx: __IMPL.TVector3; inline;
  90. function xyy: __IMPL.TVector3; inline;
  91. function xyz: __IMPL.TVector3; inline;
  92. function xyw: __IMPL.TVector3; inline;
  93. function xzx: __IMPL.TVector3; inline;
  94. function xzy: __IMPL.TVector3; inline;
  95. function xzz: __IMPL.TVector3; inline;
  96. function xzw: __IMPL.TVector3; inline;
  97. function xwx: __IMPL.TVector3; inline;
  98. function xwy: __IMPL.TVector3; inline;
  99. function xwz: __IMPL.TVector3; inline;
  100. function xww: __IMPL.TVector3; inline;
  101. function yxx: __IMPL.TVector3; inline;
  102. function yxy: __IMPL.TVector3; inline;
  103. function yxz: __IMPL.TVector3; inline;
  104. function yxw: __IMPL.TVector3; inline;
  105. function yyx: __IMPL.TVector3; inline;
  106. function yyy: __IMPL.TVector3; inline;
  107. function yyz: __IMPL.TVector3; inline;
  108. function yyw: __IMPL.TVector3; inline;
  109. function yzx: __IMPL.TVector3; inline;
  110. function yzy: __IMPL.TVector3; inline;
  111. function yzz: __IMPL.TVector3; inline;
  112. function yzw: __IMPL.TVector3; inline;
  113. function ywx: __IMPL.TVector3; inline;
  114. function ywy: __IMPL.TVector3; inline;
  115. function ywz: __IMPL.TVector3; inline;
  116. function yww: __IMPL.TVector3; inline;
  117. function zxx: __IMPL.TVector3; inline;
  118. function zxy: __IMPL.TVector3; inline;
  119. function zxz: __IMPL.TVector3; inline;
  120. function zxw: __IMPL.TVector3; inline;
  121. function zyx: __IMPL.TVector3; inline;
  122. function zyy: __IMPL.TVector3; inline;
  123. function zyz: __IMPL.TVector3; inline;
  124. function zyw: __IMPL.TVector3; inline;
  125. function zzx: __IMPL.TVector3; inline;
  126. function zzy: __IMPL.TVector3; inline;
  127. function zzz: __IMPL.TVector3; inline;
  128. function zzw: __IMPL.TVector3; inline;
  129. function zwx: __IMPL.TVector3; inline;
  130. function zwy: __IMPL.TVector3; inline;
  131. function zwz: __IMPL.TVector3; inline;
  132. function zww: __IMPL.TVector3; inline;
  133. function wxx: __IMPL.TVector3; inline;
  134. function wxy: __IMPL.TVector3; inline;
  135. function wxz: __IMPL.TVector3; inline;
  136. function wxw: __IMPL.TVector3; inline;
  137. function wyx: __IMPL.TVector3; inline;
  138. function wyy: __IMPL.TVector3; inline;
  139. function wyz: __IMPL.TVector3; inline;
  140. function wyw: __IMPL.TVector3; inline;
  141. function wzx: __IMPL.TVector3; inline;
  142. function wzy: __IMPL.TVector3; inline;
  143. function wzz: __IMPL.TVector3; inline;
  144. function wzw: __IMPL.TVector3; inline;
  145. function wwx: __IMPL.TVector3; inline;
  146. function wwy: __IMPL.TVector3; inline;
  147. function wwz: __IMPL.TVector3; inline;
  148. function www: __IMPL.TVector3; inline;
  149. function xxxx: __IMPL.TVector4; inline;
  150. function xxxy: __IMPL.TVector4; inline;
  151. function xxxz: __IMPL.TVector4; inline;
  152. function xxxw: __IMPL.TVector4; inline;
  153. function xxyx: __IMPL.TVector4; inline;
  154. function xxyy: __IMPL.TVector4; inline;
  155. function xxyz: __IMPL.TVector4; inline;
  156. function xxyw: __IMPL.TVector4; inline;
  157. function xxzx: __IMPL.TVector4; inline;
  158. function xxzy: __IMPL.TVector4; inline;
  159. function xxzz: __IMPL.TVector4; inline;
  160. function xxzw: __IMPL.TVector4; inline;
  161. function xxwx: __IMPL.TVector4; inline;
  162. function xxwy: __IMPL.TVector4; inline;
  163. function xxwz: __IMPL.TVector4; inline;
  164. function xxww: __IMPL.TVector4; inline;
  165. function xyxx: __IMPL.TVector4; inline;
  166. function xyxy: __IMPL.TVector4; inline;
  167. function xyxz: __IMPL.TVector4; inline;
  168. function xyxw: __IMPL.TVector4; inline;
  169. function xyyx: __IMPL.TVector4; inline;
  170. function xyyy: __IMPL.TVector4; inline;
  171. function xyyz: __IMPL.TVector4; inline;
  172. function xyyw: __IMPL.TVector4; inline;
  173. function xyzx: __IMPL.TVector4; inline;
  174. function xyzy: __IMPL.TVector4; inline;
  175. function xyzz: __IMPL.TVector4; inline;
  176. function xyzw: __IMPL.TVector4; inline;
  177. function xywx: __IMPL.TVector4; inline;
  178. function xywy: __IMPL.TVector4; inline;
  179. function xywz: __IMPL.TVector4; inline;
  180. function xyww: __IMPL.TVector4; inline;
  181. function xzxx: __IMPL.TVector4; inline;
  182. function xzxy: __IMPL.TVector4; inline;
  183. function xzxz: __IMPL.TVector4; inline;
  184. function xzxw: __IMPL.TVector4; inline;
  185. function xzyx: __IMPL.TVector4; inline;
  186. function xzyy: __IMPL.TVector4; inline;
  187. function xzyz: __IMPL.TVector4; inline;
  188. function xzyw: __IMPL.TVector4; inline;
  189. function xzzx: __IMPL.TVector4; inline;
  190. function xzzy: __IMPL.TVector4; inline;
  191. function xzzz: __IMPL.TVector4; inline;
  192. function xzzw: __IMPL.TVector4; inline;
  193. function xzwx: __IMPL.TVector4; inline;
  194. function xzwy: __IMPL.TVector4; inline;
  195. function xzwz: __IMPL.TVector4; inline;
  196. function xzww: __IMPL.TVector4; inline;
  197. function xwxx: __IMPL.TVector4; inline;
  198. function xwxy: __IMPL.TVector4; inline;
  199. function xwxz: __IMPL.TVector4; inline;
  200. function xwxw: __IMPL.TVector4; inline;
  201. function xwyx: __IMPL.TVector4; inline;
  202. function xwyy: __IMPL.TVector4; inline;
  203. function xwyz: __IMPL.TVector4; inline;
  204. function xwyw: __IMPL.TVector4; inline;
  205. function xwzx: __IMPL.TVector4; inline;
  206. function xwzy: __IMPL.TVector4; inline;
  207. function xwzz: __IMPL.TVector4; inline;
  208. function xwzw: __IMPL.TVector4; inline;
  209. function xwwx: __IMPL.TVector4; inline;
  210. function xwwy: __IMPL.TVector4; inline;
  211. function xwwz: __IMPL.TVector4; inline;
  212. function xwww: __IMPL.TVector4; inline;
  213. function yxxx: __IMPL.TVector4; inline;
  214. function yxxy: __IMPL.TVector4; inline;
  215. function yxxz: __IMPL.TVector4; inline;
  216. function yxxw: __IMPL.TVector4; inline;
  217. function yxyx: __IMPL.TVector4; inline;
  218. function yxyy: __IMPL.TVector4; inline;
  219. function yxyz: __IMPL.TVector4; inline;
  220. function yxyw: __IMPL.TVector4; inline;
  221. function yxzx: __IMPL.TVector4; inline;
  222. function yxzy: __IMPL.TVector4; inline;
  223. function yxzz: __IMPL.TVector4; inline;
  224. function yxzw: __IMPL.TVector4; inline;
  225. function yxwx: __IMPL.TVector4; inline;
  226. function yxwy: __IMPL.TVector4; inline;
  227. function yxwz: __IMPL.TVector4; inline;
  228. function yxww: __IMPL.TVector4; inline;
  229. function yyxx: __IMPL.TVector4; inline;
  230. function yyxy: __IMPL.TVector4; inline;
  231. function yyxz: __IMPL.TVector4; inline;
  232. function yyxw: __IMPL.TVector4; inline;
  233. function yyyx: __IMPL.TVector4; inline;
  234. function yyyy: __IMPL.TVector4; inline;
  235. function yyyz: __IMPL.TVector4; inline;
  236. function yyyw: __IMPL.TVector4; inline;
  237. function yyzx: __IMPL.TVector4; inline;
  238. function yyzy: __IMPL.TVector4; inline;
  239. function yyzz: __IMPL.TVector4; inline;
  240. function yyzw: __IMPL.TVector4; inline;
  241. function yywx: __IMPL.TVector4; inline;
  242. function yywy: __IMPL.TVector4; inline;
  243. function yywz: __IMPL.TVector4; inline;
  244. function yyww: __IMPL.TVector4; inline;
  245. function yzxx: __IMPL.TVector4; inline;
  246. function yzxy: __IMPL.TVector4; inline;
  247. function yzxz: __IMPL.TVector4; inline;
  248. function yzxw: __IMPL.TVector4; inline;
  249. function yzyx: __IMPL.TVector4; inline;
  250. function yzyy: __IMPL.TVector4; inline;
  251. function yzyz: __IMPL.TVector4; inline;
  252. function yzyw: __IMPL.TVector4; inline;
  253. function yzzx: __IMPL.TVector4; inline;
  254. function yzzy: __IMPL.TVector4; inline;
  255. function yzzz: __IMPL.TVector4; inline;
  256. function yzzw: __IMPL.TVector4; inline;
  257. function yzwx: __IMPL.TVector4; inline;
  258. function yzwy: __IMPL.TVector4; inline;
  259. function yzwz: __IMPL.TVector4; inline;
  260. function yzww: __IMPL.TVector4; inline;
  261. function ywxx: __IMPL.TVector4; inline;
  262. function ywxy: __IMPL.TVector4; inline;
  263. function ywxz: __IMPL.TVector4; inline;
  264. function ywxw: __IMPL.TVector4; inline;
  265. function ywyx: __IMPL.TVector4; inline;
  266. function ywyy: __IMPL.TVector4; inline;
  267. function ywyz: __IMPL.TVector4; inline;
  268. function ywyw: __IMPL.TVector4; inline;
  269. function ywzx: __IMPL.TVector4; inline;
  270. function ywzy: __IMPL.TVector4; inline;
  271. function ywzz: __IMPL.TVector4; inline;
  272. function ywzw: __IMPL.TVector4; inline;
  273. function ywwx: __IMPL.TVector4; inline;
  274. function ywwy: __IMPL.TVector4; inline;
  275. function ywwz: __IMPL.TVector4; inline;
  276. function ywww: __IMPL.TVector4; inline;
  277. function zxxx: __IMPL.TVector4; inline;
  278. function zxxy: __IMPL.TVector4; inline;
  279. function zxxz: __IMPL.TVector4; inline;
  280. function zxxw: __IMPL.TVector4; inline;
  281. function zxyx: __IMPL.TVector4; inline;
  282. function zxyy: __IMPL.TVector4; inline;
  283. function zxyz: __IMPL.TVector4; inline;
  284. function zxyw: __IMPL.TVector4; inline;
  285. function zxzx: __IMPL.TVector4; inline;
  286. function zxzy: __IMPL.TVector4; inline;
  287. function zxzz: __IMPL.TVector4; inline;
  288. function zxzw: __IMPL.TVector4; inline;
  289. function zxwx: __IMPL.TVector4; inline;
  290. function zxwy: __IMPL.TVector4; inline;
  291. function zxwz: __IMPL.TVector4; inline;
  292. function zxww: __IMPL.TVector4; inline;
  293. function zyxx: __IMPL.TVector4; inline;
  294. function zyxy: __IMPL.TVector4; inline;
  295. function zyxz: __IMPL.TVector4; inline;
  296. function zyxw: __IMPL.TVector4; inline;
  297. function zyyx: __IMPL.TVector4; inline;
  298. function zyyy: __IMPL.TVector4; inline;
  299. function zyyz: __IMPL.TVector4; inline;
  300. function zyyw: __IMPL.TVector4; inline;
  301. function zyzx: __IMPL.TVector4; inline;
  302. function zyzy: __IMPL.TVector4; inline;
  303. function zyzz: __IMPL.TVector4; inline;
  304. function zyzw: __IMPL.TVector4; inline;
  305. function zywx: __IMPL.TVector4; inline;
  306. function zywy: __IMPL.TVector4; inline;
  307. function zywz: __IMPL.TVector4; inline;
  308. function zyww: __IMPL.TVector4; inline;
  309. function zzxx: __IMPL.TVector4; inline;
  310. function zzxy: __IMPL.TVector4; inline;
  311. function zzxz: __IMPL.TVector4; inline;
  312. function zzxw: __IMPL.TVector4; inline;
  313. function zzyx: __IMPL.TVector4; inline;
  314. function zzyy: __IMPL.TVector4; inline;
  315. function zzyz: __IMPL.TVector4; inline;
  316. function zzyw: __IMPL.TVector4; inline;
  317. function zzzx: __IMPL.TVector4; inline;
  318. function zzzy: __IMPL.TVector4; inline;
  319. function zzzz: __IMPL.TVector4; inline;
  320. function zzzw: __IMPL.TVector4; inline;
  321. function zzwx: __IMPL.TVector4; inline;
  322. function zzwy: __IMPL.TVector4; inline;
  323. function zzwz: __IMPL.TVector4; inline;
  324. function zzww: __IMPL.TVector4; inline;
  325. function zwxx: __IMPL.TVector4; inline;
  326. function zwxy: __IMPL.TVector4; inline;
  327. function zwxz: __IMPL.TVector4; inline;
  328. function zwxw: __IMPL.TVector4; inline;
  329. function zwyx: __IMPL.TVector4; inline;
  330. function zwyy: __IMPL.TVector4; inline;
  331. function zwyz: __IMPL.TVector4; inline;
  332. function zwyw: __IMPL.TVector4; inline;
  333. function zwzx: __IMPL.TVector4; inline;
  334. function zwzy: __IMPL.TVector4; inline;
  335. function zwzz: __IMPL.TVector4; inline;
  336. function zwzw: __IMPL.TVector4; inline;
  337. function zwwx: __IMPL.TVector4; inline;
  338. function zwwy: __IMPL.TVector4; inline;
  339. function zwwz: __IMPL.TVector4; inline;
  340. function zwww: __IMPL.TVector4; inline;
  341. function wxxx: __IMPL.TVector4; inline;
  342. function wxxy: __IMPL.TVector4; inline;
  343. function wxxz: __IMPL.TVector4; inline;
  344. function wxxw: __IMPL.TVector4; inline;
  345. function wxyx: __IMPL.TVector4; inline;
  346. function wxyy: __IMPL.TVector4; inline;
  347. function wxyz: __IMPL.TVector4; inline;
  348. function wxyw: __IMPL.TVector4; inline;
  349. function wxzx: __IMPL.TVector4; inline;
  350. function wxzy: __IMPL.TVector4; inline;
  351. function wxzz: __IMPL.TVector4; inline;
  352. function wxzw: __IMPL.TVector4; inline;
  353. function wxwx: __IMPL.TVector4; inline;
  354. function wxwy: __IMPL.TVector4; inline;
  355. function wxwz: __IMPL.TVector4; inline;
  356. function wxww: __IMPL.TVector4; inline;
  357. function wyxx: __IMPL.TVector4; inline;
  358. function wyxy: __IMPL.TVector4; inline;
  359. function wyxz: __IMPL.TVector4; inline;
  360. function wyxw: __IMPL.TVector4; inline;
  361. function wyyx: __IMPL.TVector4; inline;
  362. function wyyy: __IMPL.TVector4; inline;
  363. function wyyz: __IMPL.TVector4; inline;
  364. function wyyw: __IMPL.TVector4; inline;
  365. function wyzx: __IMPL.TVector4; inline;
  366. function wyzy: __IMPL.TVector4; inline;
  367. function wyzz: __IMPL.TVector4; inline;
  368. function wyzw: __IMPL.TVector4; inline;
  369. function wywx: __IMPL.TVector4; inline;
  370. function wywy: __IMPL.TVector4; inline;
  371. function wywz: __IMPL.TVector4; inline;
  372. function wyww: __IMPL.TVector4; inline;
  373. function wzxx: __IMPL.TVector4; inline;
  374. function wzxy: __IMPL.TVector4; inline;
  375. function wzxz: __IMPL.TVector4; inline;
  376. function wzxw: __IMPL.TVector4; inline;
  377. function wzyx: __IMPL.TVector4; inline;
  378. function wzyy: __IMPL.TVector4; inline;
  379. function wzyz: __IMPL.TVector4; inline;
  380. function wzyw: __IMPL.TVector4; inline;
  381. function wzzx: __IMPL.TVector4; inline;
  382. function wzzy: __IMPL.TVector4; inline;
  383. function wzzz: __IMPL.TVector4; inline;
  384. function wzzw: __IMPL.TVector4; inline;
  385. function wzwx: __IMPL.TVector4; inline;
  386. function wzwy: __IMPL.TVector4; inline;
  387. function wzwz: __IMPL.TVector4; inline;
  388. function wzww: __IMPL.TVector4; inline;
  389. function wwxx: __IMPL.TVector4; inline;
  390. function wwxy: __IMPL.TVector4; inline;
  391. function wwxz: __IMPL.TVector4; inline;
  392. function wwxw: __IMPL.TVector4; inline;
  393. function wwyx: __IMPL.TVector4; inline;
  394. function wwyy: __IMPL.TVector4; inline;
  395. function wwyz: __IMPL.TVector4; inline;
  396. function wwyw: __IMPL.TVector4; inline;
  397. function wwzx: __IMPL.TVector4; inline;
  398. function wwzy: __IMPL.TVector4; inline;
  399. function wwzz: __IMPL.TVector4; inline;
  400. function wwzw: __IMPL.TVector4; inline;
  401. function wwwx: __IMPL.TVector4; inline;
  402. function wwwy: __IMPL.TVector4; inline;
  403. function wwwz: __IMPL.TVector4; inline;
  404. function wwww: __IMPL.TVector4; inline;
  405. {$ENDIF}
  406. end;
  407. operator = (const v1, v2: __VEC): Boolean; inline;
  408. {$IFDEF __HELPER_I}
  409. type __HELPER_I = type helper(__HELPER) for __VEC
  410. public
  411. function Length: Double; inline;
  412. {$IF __SIZE <> 4}
  413. function Add(const v: __VEC): __VEC; inline;
  414. function Subtract(const v: __VEC): __VEC; inline;
  415. {$ENDIF}
  416. function Multiply(const v: __IMPL.TBaseType): __VEC; inline;
  417. end;
  418. {$IF __SIZE <> 4}
  419. operator + (const v1, v2: __VEC): __VEC; inline;
  420. operator - (const v1, v2: __VEC): __VEC; inline;
  421. {$ENDIF}
  422. {$IFDEF __HELPER_F}
  423. type __HELPER_F = type helper(__HELPER_I) for __VEC
  424. public
  425. function Normalize: __VEC; inline;
  426. function Divide(const v: __IMPL.TBaseType): __VEC; inline;
  427. function Dot(const v: __VEC): __IMPL.TBaseType; inline;
  428. {$IF __SIZE <> 4}
  429. function Angle(const v: __VEC): Double; inline;
  430. {$ENDIF}
  431. {$IF __SIZE = 2}
  432. function Angle2(const v: __VEC): Double; inline;
  433. {$ENDIF}
  434. function Clamp(const min, max: __VEC): __VEC; inline;
  435. function Clamp(const min, max: __IMPL.TBaseType): __VEC; inline;
  436. end;
  437. operator * (const v: __VEC; const s: __IMPL.TBaseType): __VEC;
  438. operator * (const s: __IMPL.TBaseType; const v: __VEC): __VEC;
  439. operator * (const v1, v2: __VEC): __IMPL.TBaseType;
  440. {$ENDIF}
  441. {$ENDIF}
  442. {$ENDIF}
  443. {$ELSEIF DEFINED (__VECTOR_HELPER_IMPL)}
  444. {$IFDEF __HELPER}
  445. {$IF __SIZE = 2}
  446. class function __HELPER.Create(const x, y: __IMPL.TBaseType): __VEC;
  447. begin
  448. result := __IMPL.Vector2(x, y);
  449. end;
  450. {$ELSEIF __SIZE = 3}
  451. class function __HELPER.Create(const x, y, z: __IMPL.TBaseType): __VEC;
  452. begin
  453. result := __IMPL.Vector3(x, y, z);
  454. end;
  455. {$ELSEIF __SIZE = 4}
  456. class function __HELPER.Create(const x, y, z, w: __IMPL.TBaseType): __VEC;
  457. begin
  458. result := __IMPL.Vector4(x, y, z, w);
  459. end;
  460. {$ENDIF}
  461. function __HELPER.ToString(const aRound: Integer): String;
  462. begin
  463. result := __IMPL.ToString(self, aRound);
  464. end;
  465. class function __HELPER.FromString(const s: String): __VEC;
  466. begin
  467. if not __IMPL.TryFromString(s, result) then
  468. result := Zero;
  469. end;
  470. class function __HELPER.TryFromString(const s: String; out v: __VEC): Boolean;
  471. begin
  472. result := __IMPl.TryFromString(s, v);
  473. end;
  474. class function __HELPER.Zero: __VEC;
  475. begin
  476. FillByte(result{%H-}[0], Length(result) * SizeOf(result[0]), 0);
  477. end;
  478. {$IF __SIZE = 2}
  479. function __HELPER.x: __IMPL.TBaseType; begin result := self[0]; end;
  480. function __HELPER.y: __IMPL.TBaseType; begin result := self[1]; end;
  481. function __HELPER.yx: __IMPL.TVector2; begin result := __IMPL.Vector2(self[1], self[0]); end;
  482. {$ENDIF}
  483. {$IF __SIZE = 3}
  484. function __HELPER.x: __IMPL.TBaseType; begin result := self[0]; end;
  485. function __HELPER.y: __IMPL.TBaseType; begin result := self[1]; end;
  486. function __HELPER.z: __IMPL.TBaseType; begin result := self[2]; end;
  487. function __HELPER.xx: __IMPL.TVector2; begin result := __IMPL.Vector2(self[0], self[0]); end;
  488. function __HELPER.xy: __IMPL.TVector2; begin result := __IMPL.Vector2(self[0], self[1]); end;
  489. function __HELPER.xz: __IMPL.TVector2; begin result := __IMPL.Vector2(self[0], self[2]); end;
  490. function __HELPER.yx: __IMPL.TVector2; begin result := __IMPL.Vector2(self[1], self[0]); end;
  491. function __HELPER.yy: __IMPL.TVector2; begin result := __IMPL.Vector2(self[1], self[1]); end;
  492. function __HELPER.yz: __IMPL.TVector2; begin result := __IMPL.Vector2(self[1], self[2]); end;
  493. function __HELPER.zx: __IMPL.TVector2; begin result := __IMPL.Vector2(self[2], self[0]); end;
  494. function __HELPER.zy: __IMPL.TVector2; begin result := __IMPL.Vector2(self[2], self[1]); end;
  495. function __HELPER.zz: __IMPL.TVector2; begin result := __IMPL.Vector2(self[2], self[2]); end;
  496. function __HELPER.xxx: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[0], self[0]); end;
  497. function __HELPER.xxy: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[0], self[1]); end;
  498. function __HELPER.xxz: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[0], self[2]); end;
  499. function __HELPER.xyx: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[0], self[0]); end;
  500. function __HELPER.xyy: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[0], self[1]); end;
  501. function __HELPER.xyz: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[0], self[2]); end;
  502. function __HELPER.xzx: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[0], self[0]); end;
  503. function __HELPER.xzy: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[0], self[1]); end;
  504. function __HELPER.xzz: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[0], self[1]); end;
  505. function __HELPER.yxx: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[1], self[0]); end;
  506. function __HELPER.yxy: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[1], self[1]); end;
  507. function __HELPER.yxz: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[1], self[2]); end;
  508. function __HELPER.yyx: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[1], self[0]); end;
  509. function __HELPER.yyy: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[1], self[1]); end;
  510. function __HELPER.yyz: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[1], self[2]); end;
  511. function __HELPER.yzx: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[1], self[0]); end;
  512. function __HELPER.yzy: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[1], self[1]); end;
  513. function __HELPER.yzz: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[1], self[2]); end;
  514. function __HELPER.zxx: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[2], self[0]); end;
  515. function __HELPER.zxy: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[2], self[1]); end;
  516. function __HELPER.zxz: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[2], self[2]); end;
  517. function __HELPER.zyx: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[2], self[0]); end;
  518. function __HELPER.zyy: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[2], self[1]); end;
  519. function __HELPER.zyz: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[2], self[2]); end;
  520. function __HELPER.zzx: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[2], self[0]); end;
  521. function __HELPER.zzy: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[2], self[1]); end;
  522. function __HELPER.zzz: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[2], self[2]); end;
  523. {$ENDIF}
  524. {$IF __SIZE = 4}
  525. function __Helper.x: __IMPL.TBaseType; begin result := self[0]; end;
  526. function __Helper.y: __IMPL.TBaseType; begin result := self[1]; end;
  527. function __Helper.z: __IMPL.TBaseType; begin result := self[2]; end;
  528. function __Helper.w: __IMPL.TBaseType; begin result := self[3]; end;
  529. function __Helper.xx: __IMPL.TVector2; begin result := __IMPL.Vector2(self[0], self[0]); end;
  530. function __Helper.xy: __IMPL.TVector2; begin result := __IMPL.Vector2(self[0], self[1]); end;
  531. function __Helper.xz: __IMPL.TVector2; begin result := __IMPL.Vector2(self[0], self[2]); end;
  532. function __Helper.xw: __IMPL.TVector2; begin result := __IMPL.Vector2(self[0], self[3]); end;
  533. function __Helper.yx: __IMPL.TVector2; begin result := __IMPL.Vector2(self[1], self[0]); end;
  534. function __Helper.yy: __IMPL.TVector2; begin result := __IMPL.Vector2(self[1], self[1]); end;
  535. function __Helper.yz: __IMPL.TVector2; begin result := __IMPL.Vector2(self[1], self[2]); end;
  536. function __Helper.yw: __IMPL.TVector2; begin result := __IMPL.Vector2(self[1], self[3]); end;
  537. function __Helper.zx: __IMPL.TVector2; begin result := __IMPL.Vector2(self[2], self[0]); end;
  538. function __Helper.zy: __IMPL.TVector2; begin result := __IMPL.Vector2(self[2], self[1]); end;
  539. function __Helper.zz: __IMPL.TVector2; begin result := __IMPL.Vector2(self[2], self[2]); end;
  540. function __Helper.zw: __IMPL.TVector2; begin result := __IMPL.Vector2(self[2], self[3]); end;
  541. function __Helper.wx: __IMPL.TVector2; begin result := __IMPL.Vector2(self[3], self[0]); end;
  542. function __Helper.wy: __IMPL.TVector2; begin result := __IMPL.Vector2(self[3], self[1]); end;
  543. function __Helper.wz: __IMPL.TVector2; begin result := __IMPL.Vector2(self[3], self[2]); end;
  544. function __Helper.ww: __IMPL.TVector2; begin result := __IMPL.Vector2(self[3], self[3]); end;
  545. function __Helper.xxx: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[0], self[0]); end;
  546. function __Helper.xxy: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[0], self[1]); end;
  547. function __Helper.xxz: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[0], self[2]); end;
  548. function __Helper.xxw: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[0], self[3]); end;
  549. function __Helper.xyx: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[1], self[0]); end;
  550. function __Helper.xyy: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[1], self[1]); end;
  551. function __Helper.xyz: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[1], self[2]); end;
  552. function __Helper.xyw: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[1], self[3]); end;
  553. function __Helper.xzx: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[2], self[0]); end;
  554. function __Helper.xzy: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[2], self[1]); end;
  555. function __Helper.xzz: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[2], self[2]); end;
  556. function __Helper.xzw: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[2], self[3]); end;
  557. function __Helper.xwx: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[3], self[0]); end;
  558. function __Helper.xwy: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[3], self[1]); end;
  559. function __Helper.xwz: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[3], self[2]); end;
  560. function __Helper.xww: __IMPL.TVector3; begin result := __IMPL.Vector3(self[0], self[3], self[3]); end;
  561. function __Helper.yxx: __IMPL.TVector3; begin result := __IMPL.Vector3(self[1], self[0], self[0]); end;
  562. function __Helper.yxy: __IMPL.TVector3; begin result := __IMPL.Vector3(self[1], self[0], self[1]); end;
  563. function __Helper.yxz: __IMPL.TVector3; begin result := __IMPL.Vector3(self[1], self[0], self[2]); end;
  564. function __Helper.yxw: __IMPL.TVector3; begin result := __IMPL.Vector3(self[1], self[0], self[3]); end;
  565. function __Helper.yyx: __IMPL.TVector3; begin result := __IMPL.Vector3(self[1], self[1], self[0]); end;
  566. function __Helper.yyy: __IMPL.TVector3; begin result := __IMPL.Vector3(self[1], self[1], self[1]); end;
  567. function __Helper.yyz: __IMPL.TVector3; begin result := __IMPL.Vector3(self[1], self[1], self[2]); end;
  568. function __Helper.yyw: __IMPL.TVector3; begin result := __IMPL.Vector3(self[1], self[1], self[3]); end;
  569. function __Helper.yzx: __IMPL.TVector3; begin result := __IMPL.Vector3(self[1], self[2], self[0]); end;
  570. function __Helper.yzy: __IMPL.TVector3; begin result := __IMPL.Vector3(self[1], self[2], self[1]); end;
  571. function __Helper.yzz: __IMPL.TVector3; begin result := __IMPL.Vector3(self[1], self[2], self[2]); end;
  572. function __Helper.yzw: __IMPL.TVector3; begin result := __IMPL.Vector3(self[1], self[2], self[3]); end;
  573. function __Helper.ywx: __IMPL.TVector3; begin result := __IMPL.Vector3(self[1], self[3], self[0]); end;
  574. function __Helper.ywy: __IMPL.TVector3; begin result := __IMPL.Vector3(self[1], self[3], self[1]); end;
  575. function __Helper.ywz: __IMPL.TVector3; begin result := __IMPL.Vector3(self[1], self[3], self[2]); end;
  576. function __Helper.yww: __IMPL.TVector3; begin result := __IMPL.Vector3(self[1], self[3], self[3]); end;
  577. function __Helper.zxx: __IMPL.TVector3; begin result := __IMPL.Vector3(self[2], self[0], self[0]); end;
  578. function __Helper.zxy: __IMPL.TVector3; begin result := __IMPL.Vector3(self[2], self[0], self[1]); end;
  579. function __Helper.zxz: __IMPL.TVector3; begin result := __IMPL.Vector3(self[2], self[0], self[2]); end;
  580. function __Helper.zxw: __IMPL.TVector3; begin result := __IMPL.Vector3(self[2], self[0], self[3]); end;
  581. function __Helper.zyx: __IMPL.TVector3; begin result := __IMPL.Vector3(self[2], self[1], self[0]); end;
  582. function __Helper.zyy: __IMPL.TVector3; begin result := __IMPL.Vector3(self[2], self[1], self[1]); end;
  583. function __Helper.zyz: __IMPL.TVector3; begin result := __IMPL.Vector3(self[2], self[1], self[2]); end;
  584. function __Helper.zyw: __IMPL.TVector3; begin result := __IMPL.Vector3(self[2], self[1], self[3]); end;
  585. function __Helper.zzx: __IMPL.TVector3; begin result := __IMPL.Vector3(self[2], self[2], self[0]); end;
  586. function __Helper.zzy: __IMPL.TVector3; begin result := __IMPL.Vector3(self[2], self[2], self[1]); end;
  587. function __Helper.zzz: __IMPL.TVector3; begin result := __IMPL.Vector3(self[2], self[2], self[2]); end;
  588. function __Helper.zzw: __IMPL.TVector3; begin result := __IMPL.Vector3(self[2], self[2], self[3]); end;
  589. function __Helper.zwx: __IMPL.TVector3; begin result := __IMPL.Vector3(self[2], self[3], self[0]); end;
  590. function __Helper.zwy: __IMPL.TVector3; begin result := __IMPL.Vector3(self[2], self[3], self[1]); end;
  591. function __Helper.zwz: __IMPL.TVector3; begin result := __IMPL.Vector3(self[2], self[3], self[2]); end;
  592. function __Helper.zww: __IMPL.TVector3; begin result := __IMPL.Vector3(self[2], self[3], self[3]); end;
  593. function __Helper.wxx: __IMPL.TVector3; begin result := __IMPL.Vector3(self[3], self[0], self[0]); end;
  594. function __Helper.wxy: __IMPL.TVector3; begin result := __IMPL.Vector3(self[3], self[0], self[1]); end;
  595. function __Helper.wxz: __IMPL.TVector3; begin result := __IMPL.Vector3(self[3], self[0], self[2]); end;
  596. function __Helper.wxw: __IMPL.TVector3; begin result := __IMPL.Vector3(self[3], self[0], self[3]); end;
  597. function __Helper.wyx: __IMPL.TVector3; begin result := __IMPL.Vector3(self[3], self[1], self[0]); end;
  598. function __Helper.wyy: __IMPL.TVector3; begin result := __IMPL.Vector3(self[3], self[1], self[1]); end;
  599. function __Helper.wyz: __IMPL.TVector3; begin result := __IMPL.Vector3(self[3], self[1], self[2]); end;
  600. function __Helper.wyw: __IMPL.TVector3; begin result := __IMPL.Vector3(self[3], self[1], self[3]); end;
  601. function __Helper.wzx: __IMPL.TVector3; begin result := __IMPL.Vector3(self[3], self[2], self[0]); end;
  602. function __Helper.wzy: __IMPL.TVector3; begin result := __IMPL.Vector3(self[3], self[2], self[1]); end;
  603. function __Helper.wzz: __IMPL.TVector3; begin result := __IMPL.Vector3(self[3], self[2], self[2]); end;
  604. function __Helper.wzw: __IMPL.TVector3; begin result := __IMPL.Vector3(self[3], self[2], self[3]); end;
  605. function __Helper.wwx: __IMPL.TVector3; begin result := __IMPL.Vector3(self[3], self[3], self[0]); end;
  606. function __Helper.wwy: __IMPL.TVector3; begin result := __IMPL.Vector3(self[3], self[3], self[1]); end;
  607. function __Helper.wwz: __IMPL.TVector3; begin result := __IMPL.Vector3(self[3], self[3], self[2]); end;
  608. function __Helper.www: __IMPL.TVector3; begin result := __IMPL.Vector3(self[3], self[3], self[3]); end;
  609. function __Helper.xxxx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[0], self[0], self[0]); end;
  610. function __Helper.xxxy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[0], self[0], self[1]); end;
  611. function __Helper.xxxz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[0], self[0], self[2]); end;
  612. function __Helper.xxxw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[0], self[0], self[3]); end;
  613. function __Helper.xxyx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[0], self[1], self[0]); end;
  614. function __Helper.xxyy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[0], self[1], self[1]); end;
  615. function __Helper.xxyz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[0], self[1], self[2]); end;
  616. function __Helper.xxyw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[0], self[1], self[3]); end;
  617. function __Helper.xxzx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[0], self[2], self[0]); end;
  618. function __Helper.xxzy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[0], self[2], self[1]); end;
  619. function __Helper.xxzz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[0], self[2], self[2]); end;
  620. function __Helper.xxzw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[0], self[2], self[3]); end;
  621. function __Helper.xxwx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[0], self[3], self[0]); end;
  622. function __Helper.xxwy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[0], self[3], self[1]); end;
  623. function __Helper.xxwz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[0], self[3], self[2]); end;
  624. function __Helper.xxww: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[0], self[3], self[3]); end;
  625. function __Helper.xyxx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[1], self[0], self[0]); end;
  626. function __Helper.xyxy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[1], self[0], self[1]); end;
  627. function __Helper.xyxz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[1], self[0], self[2]); end;
  628. function __Helper.xyxw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[1], self[0], self[3]); end;
  629. function __Helper.xyyx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[1], self[1], self[0]); end;
  630. function __Helper.xyyy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[1], self[1], self[1]); end;
  631. function __Helper.xyyz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[1], self[1], self[2]); end;
  632. function __Helper.xyyw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[1], self[1], self[3]); end;
  633. function __Helper.xyzx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[1], self[2], self[0]); end;
  634. function __Helper.xyzy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[1], self[2], self[1]); end;
  635. function __Helper.xyzz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[1], self[2], self[2]); end;
  636. function __Helper.xyzw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[1], self[2], self[3]); end;
  637. function __Helper.xywx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[1], self[3], self[0]); end;
  638. function __Helper.xywy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[1], self[3], self[1]); end;
  639. function __Helper.xywz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[1], self[3], self[2]); end;
  640. function __Helper.xyww: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[1], self[3], self[3]); end;
  641. function __Helper.xzxx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[2], self[0], self[0]); end;
  642. function __Helper.xzxy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[2], self[0], self[1]); end;
  643. function __Helper.xzxz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[2], self[0], self[2]); end;
  644. function __Helper.xzxw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[2], self[0], self[3]); end;
  645. function __Helper.xzyx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[2], self[1], self[0]); end;
  646. function __Helper.xzyy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[2], self[1], self[1]); end;
  647. function __Helper.xzyz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[2], self[1], self[2]); end;
  648. function __Helper.xzyw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[2], self[1], self[3]); end;
  649. function __Helper.xzzx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[2], self[2], self[0]); end;
  650. function __Helper.xzzy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[2], self[2], self[1]); end;
  651. function __Helper.xzzz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[2], self[2], self[2]); end;
  652. function __Helper.xzzw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[2], self[2], self[3]); end;
  653. function __Helper.xzwx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[2], self[3], self[0]); end;
  654. function __Helper.xzwy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[2], self[3], self[1]); end;
  655. function __Helper.xzwz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[2], self[3], self[2]); end;
  656. function __Helper.xzww: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[2], self[3], self[3]); end;
  657. function __Helper.xwxx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[3], self[0], self[0]); end;
  658. function __Helper.xwxy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[3], self[0], self[1]); end;
  659. function __Helper.xwxz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[3], self[0], self[2]); end;
  660. function __Helper.xwxw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[3], self[0], self[3]); end;
  661. function __Helper.xwyx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[3], self[1], self[0]); end;
  662. function __Helper.xwyy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[3], self[1], self[1]); end;
  663. function __Helper.xwyz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[3], self[1], self[2]); end;
  664. function __Helper.xwyw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[3], self[1], self[3]); end;
  665. function __Helper.xwzx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[3], self[2], self[0]); end;
  666. function __Helper.xwzy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[3], self[2], self[1]); end;
  667. function __Helper.xwzz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[3], self[2], self[2]); end;
  668. function __Helper.xwzw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[3], self[2], self[3]); end;
  669. function __Helper.xwwx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[3], self[3], self[0]); end;
  670. function __Helper.xwwy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[3], self[3], self[1]); end;
  671. function __Helper.xwwz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[3], self[3], self[2]); end;
  672. function __Helper.xwww: __IMPL.TVector4; begin result := __IMPL.Vector4(self[0], self[3], self[3], self[3]); end;
  673. function __Helper.yxxx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[0], self[0], self[0]); end;
  674. function __Helper.yxxy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[0], self[0], self[1]); end;
  675. function __Helper.yxxz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[0], self[0], self[2]); end;
  676. function __Helper.yxxw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[0], self[0], self[3]); end;
  677. function __Helper.yxyx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[0], self[1], self[0]); end;
  678. function __Helper.yxyy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[0], self[1], self[1]); end;
  679. function __Helper.yxyz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[0], self[1], self[2]); end;
  680. function __Helper.yxyw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[0], self[1], self[3]); end;
  681. function __Helper.yxzx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[0], self[2], self[0]); end;
  682. function __Helper.yxzy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[0], self[2], self[1]); end;
  683. function __Helper.yxzz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[0], self[2], self[2]); end;
  684. function __Helper.yxzw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[0], self[2], self[3]); end;
  685. function __Helper.yxwx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[0], self[3], self[0]); end;
  686. function __Helper.yxwy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[0], self[3], self[1]); end;
  687. function __Helper.yxwz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[0], self[3], self[2]); end;
  688. function __Helper.yxww: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[0], self[3], self[3]); end;
  689. function __Helper.yyxx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[1], self[0], self[0]); end;
  690. function __Helper.yyxy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[1], self[0], self[1]); end;
  691. function __Helper.yyxz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[1], self[0], self[2]); end;
  692. function __Helper.yyxw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[1], self[0], self[3]); end;
  693. function __Helper.yyyx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[1], self[1], self[0]); end;
  694. function __Helper.yyyy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[1], self[1], self[1]); end;
  695. function __Helper.yyyz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[1], self[1], self[2]); end;
  696. function __Helper.yyyw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[1], self[1], self[3]); end;
  697. function __Helper.yyzx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[1], self[2], self[0]); end;
  698. function __Helper.yyzy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[1], self[2], self[1]); end;
  699. function __Helper.yyzz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[1], self[2], self[2]); end;
  700. function __Helper.yyzw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[1], self[2], self[3]); end;
  701. function __Helper.yywx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[1], self[3], self[0]); end;
  702. function __Helper.yywy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[1], self[3], self[1]); end;
  703. function __Helper.yywz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[1], self[3], self[2]); end;
  704. function __Helper.yyww: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[1], self[3], self[3]); end;
  705. function __Helper.yzxx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[2], self[0], self[0]); end;
  706. function __Helper.yzxy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[2], self[0], self[1]); end;
  707. function __Helper.yzxz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[2], self[0], self[2]); end;
  708. function __Helper.yzxw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[2], self[0], self[3]); end;
  709. function __Helper.yzyx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[2], self[1], self[0]); end;
  710. function __Helper.yzyy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[2], self[1], self[1]); end;
  711. function __Helper.yzyz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[2], self[1], self[2]); end;
  712. function __Helper.yzyw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[2], self[1], self[3]); end;
  713. function __Helper.yzzx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[2], self[2], self[0]); end;
  714. function __Helper.yzzy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[2], self[2], self[1]); end;
  715. function __Helper.yzzz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[2], self[2], self[2]); end;
  716. function __Helper.yzzw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[2], self[2], self[3]); end;
  717. function __Helper.yzwx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[2], self[3], self[0]); end;
  718. function __Helper.yzwy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[2], self[3], self[1]); end;
  719. function __Helper.yzwz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[2], self[3], self[2]); end;
  720. function __Helper.yzww: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[2], self[3], self[3]); end;
  721. function __Helper.ywxx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[3], self[0], self[0]); end;
  722. function __Helper.ywxy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[3], self[0], self[1]); end;
  723. function __Helper.ywxz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[3], self[0], self[2]); end;
  724. function __Helper.ywxw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[3], self[0], self[3]); end;
  725. function __Helper.ywyx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[3], self[1], self[0]); end;
  726. function __Helper.ywyy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[3], self[1], self[1]); end;
  727. function __Helper.ywyz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[3], self[1], self[2]); end;
  728. function __Helper.ywyw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[3], self[1], self[3]); end;
  729. function __Helper.ywzx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[3], self[2], self[0]); end;
  730. function __Helper.ywzy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[3], self[2], self[1]); end;
  731. function __Helper.ywzz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[3], self[2], self[2]); end;
  732. function __Helper.ywzw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[3], self[2], self[3]); end;
  733. function __Helper.ywwx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[3], self[3], self[0]); end;
  734. function __Helper.ywwy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[3], self[3], self[1]); end;
  735. function __Helper.ywwz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[3], self[3], self[2]); end;
  736. function __Helper.ywww: __IMPL.TVector4; begin result := __IMPL.Vector4(self[1], self[3], self[3], self[3]); end;
  737. function __Helper.zxxx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[0], self[0], self[0]); end;
  738. function __Helper.zxxy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[0], self[0], self[1]); end;
  739. function __Helper.zxxz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[0], self[0], self[2]); end;
  740. function __Helper.zxxw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[0], self[0], self[3]); end;
  741. function __Helper.zxyx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[0], self[1], self[0]); end;
  742. function __Helper.zxyy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[0], self[1], self[1]); end;
  743. function __Helper.zxyz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[0], self[1], self[2]); end;
  744. function __Helper.zxyw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[0], self[1], self[3]); end;
  745. function __Helper.zxzx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[0], self[2], self[0]); end;
  746. function __Helper.zxzy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[0], self[2], self[1]); end;
  747. function __Helper.zxzz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[0], self[2], self[2]); end;
  748. function __Helper.zxzw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[0], self[2], self[3]); end;
  749. function __Helper.zxwx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[0], self[3], self[0]); end;
  750. function __Helper.zxwy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[0], self[3], self[1]); end;
  751. function __Helper.zxwz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[0], self[3], self[2]); end;
  752. function __Helper.zxww: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[0], self[3], self[3]); end;
  753. function __Helper.zyxx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[1], self[0], self[0]); end;
  754. function __Helper.zyxy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[1], self[0], self[1]); end;
  755. function __Helper.zyxz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[1], self[0], self[2]); end;
  756. function __Helper.zyxw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[1], self[0], self[3]); end;
  757. function __Helper.zyyx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[1], self[1], self[0]); end;
  758. function __Helper.zyyy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[1], self[1], self[1]); end;
  759. function __Helper.zyyz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[1], self[1], self[2]); end;
  760. function __Helper.zyyw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[1], self[1], self[3]); end;
  761. function __Helper.zyzx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[1], self[2], self[0]); end;
  762. function __Helper.zyzy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[1], self[2], self[1]); end;
  763. function __Helper.zyzz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[1], self[2], self[2]); end;
  764. function __Helper.zyzw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[1], self[2], self[3]); end;
  765. function __Helper.zywx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[1], self[3], self[0]); end;
  766. function __Helper.zywy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[1], self[3], self[1]); end;
  767. function __Helper.zywz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[1], self[3], self[2]); end;
  768. function __Helper.zyww: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[1], self[3], self[3]); end;
  769. function __Helper.zzxx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[2], self[0], self[0]); end;
  770. function __Helper.zzxy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[2], self[0], self[1]); end;
  771. function __Helper.zzxz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[2], self[0], self[2]); end;
  772. function __Helper.zzxw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[2], self[0], self[3]); end;
  773. function __Helper.zzyx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[2], self[1], self[0]); end;
  774. function __Helper.zzyy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[2], self[1], self[1]); end;
  775. function __Helper.zzyz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[2], self[1], self[2]); end;
  776. function __Helper.zzyw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[2], self[1], self[3]); end;
  777. function __Helper.zzzx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[2], self[2], self[0]); end;
  778. function __Helper.zzzy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[2], self[2], self[1]); end;
  779. function __Helper.zzzz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[2], self[2], self[2]); end;
  780. function __Helper.zzzw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[2], self[2], self[3]); end;
  781. function __Helper.zzwx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[2], self[3], self[0]); end;
  782. function __Helper.zzwy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[2], self[3], self[1]); end;
  783. function __Helper.zzwz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[2], self[3], self[2]); end;
  784. function __Helper.zzww: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[2], self[3], self[3]); end;
  785. function __Helper.zwxx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[3], self[0], self[0]); end;
  786. function __Helper.zwxy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[3], self[0], self[1]); end;
  787. function __Helper.zwxz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[3], self[0], self[2]); end;
  788. function __Helper.zwxw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[3], self[0], self[3]); end;
  789. function __Helper.zwyx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[3], self[1], self[0]); end;
  790. function __Helper.zwyy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[3], self[1], self[1]); end;
  791. function __Helper.zwyz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[3], self[1], self[2]); end;
  792. function __Helper.zwyw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[3], self[1], self[3]); end;
  793. function __Helper.zwzx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[3], self[2], self[0]); end;
  794. function __Helper.zwzy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[3], self[2], self[1]); end;
  795. function __Helper.zwzz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[3], self[2], self[2]); end;
  796. function __Helper.zwzw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[3], self[2], self[3]); end;
  797. function __Helper.zwwx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[3], self[3], self[0]); end;
  798. function __Helper.zwwy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[3], self[3], self[1]); end;
  799. function __Helper.zwwz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[3], self[3], self[2]); end;
  800. function __Helper.zwww: __IMPL.TVector4; begin result := __IMPL.Vector4(self[2], self[3], self[3], self[3]); end;
  801. function __Helper.wxxx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[0], self[0], self[0]); end;
  802. function __Helper.wxxy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[0], self[0], self[1]); end;
  803. function __Helper.wxxz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[0], self[0], self[2]); end;
  804. function __Helper.wxxw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[0], self[0], self[3]); end;
  805. function __Helper.wxyx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[0], self[1], self[0]); end;
  806. function __Helper.wxyy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[0], self[1], self[1]); end;
  807. function __Helper.wxyz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[0], self[1], self[2]); end;
  808. function __Helper.wxyw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[0], self[1], self[3]); end;
  809. function __Helper.wxzx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[0], self[2], self[0]); end;
  810. function __Helper.wxzy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[0], self[2], self[1]); end;
  811. function __Helper.wxzz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[0], self[2], self[2]); end;
  812. function __Helper.wxzw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[0], self[2], self[3]); end;
  813. function __Helper.wxwx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[0], self[3], self[0]); end;
  814. function __Helper.wxwy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[0], self[3], self[1]); end;
  815. function __Helper.wxwz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[0], self[3], self[2]); end;
  816. function __Helper.wxww: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[0], self[3], self[3]); end;
  817. function __Helper.wyxx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[1], self[0], self[0]); end;
  818. function __Helper.wyxy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[1], self[0], self[1]); end;
  819. function __Helper.wyxz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[1], self[0], self[2]); end;
  820. function __Helper.wyxw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[1], self[0], self[3]); end;
  821. function __Helper.wyyx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[1], self[1], self[0]); end;
  822. function __Helper.wyyy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[1], self[1], self[1]); end;
  823. function __Helper.wyyz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[1], self[1], self[2]); end;
  824. function __Helper.wyyw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[1], self[1], self[3]); end;
  825. function __Helper.wyzx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[1], self[2], self[0]); end;
  826. function __Helper.wyzy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[1], self[2], self[1]); end;
  827. function __Helper.wyzz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[1], self[2], self[2]); end;
  828. function __Helper.wyzw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[1], self[2], self[3]); end;
  829. function __Helper.wywx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[1], self[3], self[0]); end;
  830. function __Helper.wywy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[1], self[3], self[1]); end;
  831. function __Helper.wywz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[1], self[3], self[2]); end;
  832. function __Helper.wyww: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[1], self[3], self[3]); end;
  833. function __Helper.wzxx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[2], self[0], self[0]); end;
  834. function __Helper.wzxy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[2], self[0], self[1]); end;
  835. function __Helper.wzxz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[2], self[0], self[2]); end;
  836. function __Helper.wzxw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[2], self[0], self[3]); end;
  837. function __Helper.wzyx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[2], self[1], self[0]); end;
  838. function __Helper.wzyy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[2], self[1], self[1]); end;
  839. function __Helper.wzyz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[2], self[1], self[2]); end;
  840. function __Helper.wzyw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[2], self[1], self[3]); end;
  841. function __Helper.wzzx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[2], self[2], self[0]); end;
  842. function __Helper.wzzy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[2], self[2], self[1]); end;
  843. function __Helper.wzzz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[2], self[2], self[2]); end;
  844. function __Helper.wzzw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[2], self[2], self[3]); end;
  845. function __Helper.wzwx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[2], self[3], self[0]); end;
  846. function __Helper.wzwy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[2], self[3], self[1]); end;
  847. function __Helper.wzwz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[2], self[3], self[2]); end;
  848. function __Helper.wzww: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[2], self[3], self[3]); end;
  849. function __Helper.wwxx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[3], self[0], self[0]); end;
  850. function __Helper.wwxy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[3], self[0], self[1]); end;
  851. function __Helper.wwxz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[3], self[0], self[2]); end;
  852. function __Helper.wwxw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[3], self[0], self[3]); end;
  853. function __Helper.wwyx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[3], self[1], self[0]); end;
  854. function __Helper.wwyy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[3], self[1], self[1]); end;
  855. function __Helper.wwyz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[3], self[1], self[2]); end;
  856. function __Helper.wwyw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[3], self[1], self[3]); end;
  857. function __Helper.wwzx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[3], self[2], self[0]); end;
  858. function __Helper.wwzy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[3], self[2], self[1]); end;
  859. function __Helper.wwzz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[3], self[2], self[2]); end;
  860. function __Helper.wwzw: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[3], self[2], self[3]); end;
  861. function __Helper.wwwx: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[3], self[3], self[0]); end;
  862. function __Helper.wwwy: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[3], self[3], self[1]); end;
  863. function __Helper.wwwz: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[3], self[3], self[2]); end;
  864. function __Helper.wwww: __IMPL.TVector4; begin result := __IMPL.Vector4(self[3], self[3], self[3], self[3]); end;
  865. {$ENDIF}
  866. operator = (const v1, v2: __VEC): Boolean;
  867. begin
  868. result := __IMPL.Equals(v1, v2);
  869. end;
  870. {$IFDEF __HELPER_I}
  871. function __HELPER_I.Length: Double;
  872. begin
  873. result := __IMPL.Length(self);
  874. end;
  875. {$IF __SIZE <> 4}
  876. function __HELPER_I.Add(const v: __VEC): __VEC;
  877. begin
  878. result := __IMPL.Add(self, v);
  879. end;
  880. function __HELPER_I.Subtract(const v: __VEC): __VEC;
  881. begin
  882. result := __IMPL.Sub(self, v);
  883. end;
  884. {$ENDIF}
  885. function __HELPER_I.Multiply(const v: __IMPL.TBaseType): __VEC;
  886. begin
  887. result := __IMPL.Multiply(self, v);
  888. end;
  889. {$IF __SIZE <> 4}
  890. operator + (const v1, v2: __VEC): __VEC;
  891. begin
  892. result := __IMPL.Add(v1, v2);
  893. end;
  894. operator - (const v1, v2: __VEC): __VEC;
  895. begin
  896. result := __IMPL.Sub(v1, v2);
  897. end;
  898. {$ENDIF}
  899. {$IFDEF __HELPER_F}
  900. function __HELPER_F.Normalize: __VEC;
  901. begin
  902. result := __IMPL.Normalize(self);
  903. end;
  904. function __HELPER_F.Divide(const v: __IMPL.TBaseType): __VEC;
  905. begin
  906. result := __IMPL.Divide(self, v);
  907. end;
  908. function __HELPER_F.Dot(const v: __VEC): __IMPL.TBaseType;
  909. begin
  910. result := __IMPL.Dot(self, v);
  911. end;
  912. {$IF __SIZE <> 4}
  913. function __HELPER_F.Angle(const v: __VEC): Double;
  914. begin
  915. result := __IMPL.Angle(self, v);
  916. end;
  917. {$ENDIF}
  918. {$IF __SIZE = 2}
  919. function __HELPER_F.Angle2(const v: __VEC): Double;
  920. begin
  921. result := __IMPL.Angle2(self, v);
  922. end;
  923. {$ENDIF}
  924. function __HELPER_F.Clamp(const min, max: __VEC): __VEC;
  925. begin
  926. result := __IMPL.Clamp(self, min, max);
  927. end;
  928. function __HELPER_F.Clamp(const min, max: __IMPL.TBaseType): __VEC;
  929. begin
  930. result := __IMPL.Clamp(self, min, max);
  931. end;
  932. operator * (const v: __VEC; const s: __IMPL.TBaseType): __VEC;
  933. begin
  934. result := __IMPl.Multiply(v, s);
  935. end;
  936. operator * (const s: __IMPL.TBaseType; const v: __VEC): __VEC;
  937. begin
  938. result := __IMPl.Multiply(v, s);
  939. end;
  940. operator * (const v1, v2: __VEC): __IMPL.TBaseType;
  941. begin
  942. result := __IMPl.Dot(v1, v2);
  943. end;
  944. {$ENDIF}
  945. {$ENDIF}
  946. {$ENDIF}
  947. {$ENDIF}
  948. {$UNDEF __IMPL}
  949. {$UNDEF __SIZE}
  950. {$UNDEF __VEC}
  951. {$UNDEF __HELPER}
  952. {$UNDEF __HELPER_I}
  953. {$UNDEF __HELPER_F}