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.

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