mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-25 15:12:28 +00:00
Compare commits
1507 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9733f04c9c | |||
| 7140a2054f | |||
| 1049e48aca | |||
| 33b79a3588 | |||
| f82699c39b | |||
| 15eaf4e6d1 | |||
| 7621882b4e | |||
| 9b70b73759 | |||
| 8e43134bda | |||
| d26782b093 | |||
| a2368b4ea7 | |||
| 3d6bb964df | |||
| 347ae1bc34 | |||
| 64f5bfd5ce | |||
| 86c1420f6e | |||
| 364ed921ce | |||
| 85e1518856 | |||
| 11ce399e0d | |||
| ec0989454d | |||
| e9f6031936 | |||
| 03485ef1e0 | |||
| e256175ce6 | |||
| 0f662bf70c | |||
| 4c959159c2 | |||
| d51241720a | |||
| 873d343529 | |||
| 95969ce67b | |||
| bd5cdf502e | |||
| c6a7d5a96c | |||
| 6bc4ecf390 | |||
| c94ceb5b1d | |||
| bb702335e8 | |||
| 863c0c5b58 | |||
| 76e280da4e | |||
| bcca35b7b7 | |||
| 65abaade88 | |||
| 8020e921aa | |||
| f2f5b4c1ad | |||
| 5c6f9fcdc4 | |||
| 9e243a2426 | |||
| 9a889802d3 | |||
| 1420987c4c | |||
| ed4d954ba8 | |||
| 881f937a35 | |||
| ed4e762f03 | |||
| fa1e33783a | |||
| 2fa31799f6 | |||
| 6c3d5c713c | |||
| f16beddf6e | |||
| 506b3ca4a0 | |||
| 80242bd250 | |||
| 7f7f99cbe3 | |||
| 579294fbf0 | |||
| a3b54e5cae | |||
| b392d16808 | |||
| 616e13acac | |||
| b50f660339 | |||
| 84310ec8f0 | |||
| ffed5a9e22 | |||
| 92c9ff6e53 | |||
| 986a424322 | |||
| c3e7c48939 | |||
| b2aa3262a9 | |||
| b1587f0326 | |||
| 281b321237 | |||
| ba0e4bfc1d | |||
| 3cda62acf4 | |||
| 2ef43212e1 | |||
| f69eccc42b | |||
| a1e425f936 | |||
| 6186c3d866 | |||
| 1d0a6bdc71 | |||
| da121137e5 | |||
| c953f1dee1 | |||
| 32b595afb4 | |||
| 399bf96a0c | |||
| b7c409e11b | |||
| fd08e9f2ad | |||
| 37d3daaf9a | |||
| 9a4d01da8f | |||
| 81cf748b2b | |||
| 22742b6a25 | |||
| 7d8d96c049 | |||
| f5e49441b6 | |||
| 610f3ed37f | |||
| f215874486 | |||
| 8e529105cf | |||
| 891952eb79 | |||
| e6a0b01f37 | |||
| 64c324a42b | |||
| f909e76260 | |||
| b7dfdc5060 | |||
| e25239a50d | |||
| 76d3edc534 | |||
| 7301182b3e | |||
| 832e5e90d1 | |||
| 7ddaabee30 | |||
| 41d57ddab6 | |||
| 8dd00f5288 | |||
| 15f217b594 | |||
| 8422178233 | |||
| eebe902917 | |||
| 04dc593df9 | |||
| 11ed698642 | |||
| 0996570b78 | |||
| ca84040a39 | |||
| 467afc86af | |||
| 19271f90a4 | |||
| 0a9732a267 | |||
| 1bc06c9c24 | |||
| e0acc937b3 | |||
| 3a10a0129a | |||
| 18dbcf16cc | |||
| bed8dc7d34 | |||
| a0fc9844fd | |||
| 9d6dc47cf4 | |||
| d42d77d3ef | |||
| 9041891557 | |||
| dedd1fc70d | |||
| 9ddb56088e | |||
| 9f4167a65c | |||
| 085b021587 | |||
| 5a65fd4207 | |||
| 0f321b3a69 | |||
| 53c7b789f2 | |||
| 850ea7789e | |||
| c3a3dc19a7 | |||
| 2606592f32 | |||
| 5c3791631a | |||
| 4c9108a906 | |||
| efbcaf6f64 | |||
| 18a4f831be | |||
| 6597967acd | |||
| 24825677dc | |||
| 70d5983562 | |||
| d4a9fed45e | |||
| a6b923a22e | |||
| 1e87086471 | |||
| c3fdbfe904 | |||
| 00852063c2 | |||
| 44dcf7af7d | |||
| d525d040fe | |||
| 67a774dd9b | |||
| ff7ff658e0 | |||
| 6100da75c5 | |||
| a612c3c006 | |||
| 412835d7fa | |||
| 6a4f7466f0 | |||
| b3ea7ecd0d | |||
| 50e6d0d256 | |||
| f948786f6a | |||
| 4d0179d525 | |||
| c851cd3f12 | |||
| b6875564d4 | |||
| 0240c61952 | |||
| 7864a5285d | |||
| 538921701c | |||
| 3cf4d4af1b | |||
| c70c7e13ec | |||
| 9980dfe80e | |||
| 42a51eb373 | |||
| 932dd836d0 | |||
| adf36bf912 | |||
| e7ef4b5484 | |||
| 3d1521857e | |||
| 9707b53df2 | |||
| 5d6d489889 | |||
| 8f4e2e99db | |||
| 377c6a87a2 | |||
| b36cc3ab08 | |||
| 339b8e37a6 | |||
| 8f3e9b4a7a | |||
| 633583c266 | |||
| 3b048ee8a2 | |||
| 52ae78709b | |||
| dec290ba96 | |||
| cef1dfd0c0 | |||
| 3262bee6c5 | |||
| 2dbd616725 | |||
| eb98563fa1 | |||
| 7f92e96ae7 | |||
| a48138dfd6 | |||
| 0b486b3f76 | |||
| 46980e5260 | |||
| 44f9e5495e | |||
| 97f59282cf | |||
| b112dfe860 | |||
| 2a4a5b1beb | |||
| 232d61b983 | |||
| 4e10b77980 | |||
| c1469a3a8e | |||
| 9d5f427f57 | |||
| cdd1e17348 | |||
| 20e978b676 | |||
| 163906e0f0 | |||
| c9bd662b57 | |||
| 8529384b00 | |||
| 7f89191ffc | |||
| aaf5f8c930 | |||
| 2bdc44dfb2 | |||
| 6e7136ea18 | |||
| 7a507e8d1e | |||
| 76fdfa87c1 | |||
| 19486bac0d | |||
| de47755320 | |||
| 6b90f883cd | |||
| 5c640b2d40 | |||
| a568a6f194 | |||
| 85df09b3f2 | |||
| 16d47a2c47 | |||
| 9a5d2d2bc5 | |||
| 3b16c86007 | |||
| 7c451f8170 | |||
| 2e1b75e95b | |||
| 1cd5970649 | |||
| 1bccdf57ee | |||
| d03232ce1b | |||
| ba6a3ac94b | |||
| 85bd837a66 | |||
| 264024e8fc | |||
| 0d09f5d536 | |||
| 840f936c2f | |||
| ca380edfc8 | |||
| 389fa922e5 | |||
| f9423b018c | |||
| 05ccab87f3 | |||
| 27dec16551 | |||
| 07a2cbe9a5 | |||
| 4821ed79fb | |||
| 5bf49d2ef9 | |||
| cd0824ee71 | |||
| 8394cc9e2b | |||
| 504a8b19ce | |||
| 0b63eaa25d | |||
| 7fc21b9e3a | |||
| 8369570b50 | |||
| e429260763 | |||
| 06f18225ce | |||
| 9ff0c414c1 | |||
| 850d1e7c28 | |||
| 2df823d2db | |||
| 2e84781594 | |||
| 405884f47d | |||
| 6457c00548 | |||
| 2e80e56af1 | |||
| 0ad4ffe33f | |||
| 833227f7f6 | |||
| e731cfd48d | |||
| cf7574d9b8 | |||
| 16f112a281 | |||
| 69944d907d | |||
| 663dbf9fc2 | |||
| a4a8a1aba5 | |||
| fb84f7f84f | |||
| 1c295453da | |||
| 8199821343 | |||
| b59e856b33 | |||
| f81acf23a7 | |||
| 27eba2e6e9 | |||
| 10d384f131 | |||
| 00b8c8ce47 | |||
| cab43f41be | |||
| fc0d589f12 | |||
| 743175d4ff | |||
| b497b07fed | |||
| aab5ed2267 | |||
| 46c9fe46e9 | |||
| e8c92c6fcc | |||
| 765eaf7f4f | |||
| 699c8cc1eb | |||
| 5839921e08 | |||
| a3bde6e1f1 | |||
| 0ece5bf178 | |||
| fbefad9eaf | |||
| 351a7a52fe | |||
| 8441ffda31 | |||
| 8b19c76e89 | |||
| e79747c919 | |||
| 8525d819c1 | |||
| fe600bb084 | |||
| babaff1985 | |||
| 909ca5440d | |||
| e25f64d03b | |||
| 2df66bd625 | |||
| 2028a5846c | |||
| 2fd2cd4cec | |||
| 17b175daa4 | |||
| 5cabe109da | |||
| c6e82448b6 | |||
| 8384ab9d2f | |||
| b846d89b5d | |||
| d5a5635a14 | |||
| f8dc8be6e6 | |||
| 5f9676d1a5 | |||
| 964c4c83df | |||
| 322cea7342 | |||
| 205e1d404e | |||
| 9769a96ebd | |||
| 74d3192c2e | |||
| 41769a3fa8 | |||
| a7efa9d4e4 | |||
| 9ed69999a5 | |||
| e19a59b269 | |||
| d234016224 | |||
| c160d6d929 | |||
| 62ad60b4ad | |||
| d44d7c6bbd | |||
| efd97bad14 | |||
| bc884f5daf | |||
| 0f47b73a64 | |||
| e9c6e96452 | |||
| 09713311f6 | |||
| c666d9c553 | |||
| 3777e8d1ce | |||
| e60658c684 | |||
| 046da9efae | |||
| 09332f6c26 | |||
| ce507d891a | |||
| 96f122f901 | |||
| 3479525f39 | |||
| 4f9d4b0023 | |||
| bcdfd32bc0 | |||
| 693dde04e3 | |||
| f1bb019933 | |||
| 5a6373c429 | |||
| 19e04a1875 | |||
| 029314ec7f | |||
| cee4a3f475 | |||
| 2bc58a97bc | |||
| 2eb270376f | |||
| 5e858678e9 | |||
| 12a59853b5 | |||
| 971c3f633f | |||
| 826f7d0efd | |||
| 5da5e9b5de | |||
| 7a3c05a41f | |||
| 01382e87a0 | |||
| f0abaad84f | |||
| 5946af88a6 | |||
| fe718a81f3 | |||
| 2f30488cd5 | |||
| 8b69de46e9 | |||
| c466317082 | |||
| 06b0bd6da4 | |||
| 334e29a6d6 | |||
| cab0beb77f | |||
| 5f2db0d1cb | |||
| b654729383 | |||
| 5fec840f06 | |||
| 1b6ccca709 | |||
| 957671e649 | |||
| 79a9e393d2 | |||
| 50c186b608 | |||
| 9054b93338 | |||
| cf1f03fd5b | |||
| 7742273237 | |||
| 536773db44 | |||
| cf4145dad4 | |||
| bc90ab795b | |||
| 21ba9953f8 | |||
| 1c87a6069a | |||
| 9867fdd4d2 | |||
| 64cd589ca3 | |||
| 110d22e775 | |||
| 3bc582885b | |||
| e33e8b713e | |||
| 4214cf47c2 | |||
| 68115505f8 | |||
| d87c95c1f8 | |||
| cec990716f | |||
| f22b26f80f | |||
| 236d227319 | |||
| a5020a68f0 | |||
| c613f362a7 | |||
| 977b28cb9c | |||
| 8b89beb02e | |||
| 748748dda9 | |||
| 6364d2c31d | |||
| e618fe87bd | |||
| 4e71330508 | |||
| c6091c4f27 | |||
| 49d231f5dd | |||
| e907ab4f3e | |||
| 9814a6e5a2 | |||
| 65e865a550 | |||
| 9cdf0a7a83 | |||
| 43326c1804 | |||
| e2d85337d0 | |||
| c4f1f57f74 | |||
| ab70427b7d | |||
| 0af394fb96 | |||
| e4320f98f8 | |||
| b5a46735df | |||
| 352d46d2ee | |||
| b672475166 | |||
| 7692793289 | |||
| 8d909ea8e2 | |||
| f7781e6d1d | |||
| 810553de2a | |||
| c6b2b1da4e | |||
| 5234eb6fc8 | |||
| d8856a7bae | |||
| 6ca5fb19f4 | |||
| 4d83397506 | |||
| 3720d9e50f | |||
| d73449104a | |||
| 580f32c190 | |||
| 65cc3a4b0a | |||
| 52344bfe24 | |||
| 7b33ef67f2 | |||
| 9270c45a5e | |||
| 34f051ab9a | |||
| a2280d1fe5 | |||
| 042613d234 | |||
| 8b05eff179 | |||
| fcb022b8ae | |||
| 41182de4f2 | |||
| 37b45be6d8 | |||
| dd044ca453 | |||
| b234c67622 | |||
| 529408fca0 | |||
| 84e95d9a28 | |||
| b439881f37 | |||
| a75b53f9b0 | |||
| 85ebb32176 | |||
| 6450b08fd6 | |||
| 0353dcb28c | |||
| 230296e777 | |||
| ad987c5531 | |||
| 503a2c0d04 | |||
| b7bcd13cbd | |||
| 446da590d8 | |||
| 24732eff88 | |||
| b98f8c6262 | |||
| 11c327e1d7 | |||
| 1253fa2a25 | |||
| f052c6004a | |||
| 3cde8d9af8 | |||
| cbed61db7e | |||
| e360ba5209 | |||
| fd8dc1214c | |||
| 327fa38232 | |||
| 845ed720b3 | |||
| ea0c8f86fe | |||
| 76f727b7ff | |||
| 449d5f9358 | |||
| b2ca66267e | |||
| f292cbc3e7 | |||
| df705e34ad | |||
| 364f133ffd | |||
| c7e2d3b355 | |||
| 553d12412b | |||
| a701541fce | |||
| dd06ecf99b | |||
| 9e5fdc50d9 | |||
| 80cc6e4ef3 | |||
| 34a56f75cf | |||
| 941f1cc395 | |||
| 9eec8f37f5 | |||
| 1734641d12 | |||
| 3856f7f1e5 | |||
| 94110dbe52 | |||
| 8a44271b2f | |||
| cca9ddab43 | |||
| 7b440bbd9f | |||
| a2d4376763 | |||
| a91b6a0db8 | |||
| 22367622be | |||
| 87efd22394 | |||
| 69b7d500d8 | |||
| 00321126f1 | |||
| 9e1549b61b | |||
| a85bb6aca6 | |||
| 9207220238 | |||
| 539c09adc5 | |||
| 8ef17f2ccd | |||
| 8b08f19628 | |||
| adc801a069 | |||
| 0f5214f481 | |||
| eb609f2ea4 | |||
| a3069b63df | |||
| f7bb763aac | |||
| bce3b1b961 | |||
| e2874b2cc6 | |||
| dc6e6fd05f | |||
| c2282ced0e | |||
| 6badd7e00e | |||
| 12b9531d8a | |||
| 1ba4b6fc31 | |||
| cb3fa2d4a3 | |||
| cfd6364999 | |||
| f1b8908c9a | |||
| 11abc45e3f | |||
| 321cf17eac | |||
| 091047d08b | |||
| f0c46664d2 | |||
| 8b2dba9715 | |||
| 26ff1ae941 | |||
| 12ded4b506 | |||
| 2b66af2d91 | |||
| 8940e987c1 | |||
| c02cb2c343 | |||
| 99b25f42e4 | |||
| a327a0028d | |||
| 478eb35a3b | |||
| d7eb28c7f8 | |||
| e1996e62b0 | |||
| bb9f440882 | |||
| b7be8fb625 | |||
| 2aec190afc | |||
| f0496a6f59 | |||
| aab3cac29c | |||
| 9561f841c4 | |||
| 32243aa383 | |||
| 13f3c13c0e | |||
| 92a1abbbee | |||
| 4b7fa0654c | |||
| f3710856ad | |||
| ef982b9ce2 | |||
| 52d92b7181 | |||
| e0e473ce06 | |||
| 9c92c5dbe4 | |||
| b65d3c85b6 | |||
| 71b7fc57f6 | |||
| 454f2520c3 | |||
| e1e219ae97 | |||
| af57ca3b05 | |||
| a98eeb7be6 | |||
| cc0f2ac37a | |||
| 842f1fb9c7 | |||
| 8b14c21a24 | |||
| 0f6ce6a1f4 | |||
| 7aaf9ae00d | |||
| e902373ce7 | |||
| 0ad7c4470b | |||
| 36a2d52f1c | |||
| d0756ff2af | |||
| 9fcea56fbf | |||
| 1b239b7119 | |||
| 83f94da43b | |||
| 0d5a0525cd | |||
| 4f07be2343 | |||
| 152a7410b6 | |||
| 9e4a21d934 | |||
| 6b107d4197 | |||
| d99f9c1c09 | |||
| 089360a3a5 | |||
| d7c2d6108f | |||
| b7e36feeeb | |||
| 658bf04d0b | |||
| b43ab783b0 | |||
| be90b4e0cc | |||
| b3895f717a | |||
| 77a5d82de4 | |||
| a7ac4b8deb | |||
| 9cd2225f8c | |||
| f2e7f8ec64 | |||
| 899c34ff63 | |||
| 79819a85d6 | |||
| e66b4e4a3d | |||
| 48c24186d1 | |||
| 965bb039be | |||
| d606d8f4f2 | |||
| a862d9a06d | |||
| c4d9e543e3 | |||
| 5104b507bb | |||
| cb5cecd0c2 | |||
| 77c793166c | |||
| e08533c634 | |||
| 39196efcb3 | |||
| cc9bef9706 | |||
| 9d38c6d44e | |||
| fb213e6ee5 | |||
| aafc681034 | |||
| 11dc235121 | |||
| cb510e13d1 | |||
| 784b16bd43 | |||
| c6c47aba22 | |||
| 3581b0bf1a | |||
| b5f5dae9e8 | |||
| d68fca8e51 | |||
| dc6e5bc48e | |||
| 12c15c6db0 | |||
| d21c4a58b4 | |||
| 652b158ca4 | |||
| 71da40c757 | |||
| 3cf9c71c27 | |||
| c1b69594e5 | |||
| 8e8a21349f | |||
| b7fb8fa434 | |||
| e3d02cdf40 | |||
| 3b18c4891c | |||
| 0862feeba8 | |||
| 34a7b46163 | |||
| 538979716d | |||
| ed21229bba | |||
| 1ec7da0f36 | |||
| 61732658f2 | |||
| 474d5d1340 | |||
| fdb4e54ff6 | |||
| bde62709b5 | |||
| d4aaa93047 | |||
| 4ce7081ace | |||
| 6f8e7fc720 | |||
| 422f3b1ce9 | |||
| 397e3998ff | |||
| cff96b23a8 | |||
| 40798d38c5 | |||
| 09ede557b1 | |||
| 1f15f7ff9a | |||
| a96784aa18 | |||
| 3a2ceab58a | |||
| 84499e43dd | |||
| 2e8ff36ef7 | |||
| 6430a62c86 | |||
| ec47f8644c | |||
| 8b3afbdf10 | |||
| 57b11629ce | |||
| 396eced36e | |||
| 66070e9bf6 | |||
| 97588fbcf4 | |||
| d7a98e7655 | |||
| 4804cca0ab | |||
| 0850b1edad | |||
| c2e5875f02 | |||
| 56de9072c0 | |||
| 341121da32 | |||
| 869c041846 | |||
| 879ab418fd | |||
| 2ffc77be3d | |||
| 2f8cc6e57b | |||
| a64ef36d06 | |||
| 85895d01eb | |||
| fa3d8c9720 | |||
| 80a8a1fde3 | |||
| bf5ce11ff1 | |||
| 4a10bdb91a | |||
| 74b73e6f39 | |||
| d287d9731e | |||
| 95c072f692 | |||
| 41f453d5a4 | |||
| ddcaf855fe | |||
| d943183994 | |||
| 2424b1d3f1 | |||
| a036200369 | |||
| 0ddceb78ba | |||
| b23fb0e635 | |||
| 98ebbd50a1 | |||
| c39eb3ca86 | |||
| 2278ec023f | |||
| 2afd05de98 | |||
| 1655050730 | |||
| 9a30c24654 | |||
| 727d8a2bf8 | |||
| cdcb5e0692 | |||
| 01991f4beb | |||
| 28212ab8f8 | |||
| 22d06bc3d1 | |||
| 167ce7829c | |||
| bb2dc991eb | |||
| 989b5d96c5 | |||
| 0ea1010e3f | |||
| 4f4f9e8eb3 | |||
| d32f16fef5 | |||
| 41660240fb | |||
| c160059612 | |||
| c055b20b93 | |||
| e1b251ee8f | |||
| e60117cabb | |||
| 3449f5e11c | |||
| 010bc76440 | |||
| 4b647602b3 | |||
| 9abdf5f4b3 | |||
| 903a3a9060 | |||
| 4541bd5369 | |||
| 94e4da9456 | |||
| 2f3c1ed169 | |||
| 3db115b52f | |||
| 96c4b283fa | |||
| 7dce9d6c8e | |||
| bc46b1371d | |||
| 4a09b9b1a0 | |||
| a08c6c9a00 | |||
| 9b4491df57 | |||
| e81e47e9c5 | |||
| 34739b71b3 | |||
| c80f803ba7 | |||
| 6132fa0cb9 | |||
| 586e177f98 | |||
| 695e6f2026 | |||
| 9bbde71964 | |||
| 7a5afd8597 | |||
| c6f707d95c | |||
| b0612f8cdf | |||
| ceccf2b1ca | |||
| 137b624008 | |||
| 632b9b9c27 | |||
| 819de185ef | |||
| 61abdeb3f7 | |||
| cc9267707a | |||
| c82ce7cecc | |||
| 00db7e5c93 | |||
| f0106c90a8 | |||
| edf24308fb | |||
| 705ffa89bc | |||
| 8cdcd189f5 | |||
| 9e26ebb9e5 | |||
| 7b085c8018 | |||
| 41d3b177ea | |||
| effe2149da | |||
| 9af74e6468 | |||
| ede9d557a3 | |||
| 0be08b7899 | |||
| 2b204fa756 | |||
| 2c78a47a94 | |||
| e599820383 | |||
| cc69e81dab | |||
| 7048fcc358 | |||
| b169dbd09d | |||
| f7c637a0d9 | |||
| a054b83b92 | |||
| 4eea1e0468 | |||
| 853f1b56e5 | |||
| bf2d65d7e9 | |||
| 7b551f0399 | |||
| fdbb166076 | |||
| 2fe133fa0e | |||
| 6a59b83d43 | |||
| 9a634a2056 | |||
| d0416d5f35 | |||
| 3e0f6b8520 | |||
| 6877e40b38 | |||
| 1cd20c65e2 | |||
| 4672f223c1 | |||
| 042f6f3789 | |||
| 718ba3edbf | |||
| 32d20f22ef | |||
| d3ce9792b5 | |||
| 2afa08e361 | |||
| 25c20f0629 | |||
| 786b8c80fd | |||
| 6c4e69a71d | |||
| ef79a0607b | |||
| fbdc104c12 | |||
| 34bbb9236e | |||
| 54d1cff546 | |||
| 4684d92758 | |||
| 75fb34934d | |||
| a1f2e1c8fd | |||
| dc6154f71f | |||
| b7cc19f983 | |||
| ee6a4bd244 | |||
| e7051d0289 | |||
| 9680f39203 | |||
| 11918fccbf | |||
| 53fb53e822 | |||
| ad31de5f78 | |||
| 6821dc27f5 | |||
| ef7e107443 | |||
| 60dcdbd181 | |||
| b732133184 | |||
| 611f0e2aba | |||
| 5a4f80621b | |||
| 606bd86e3a | |||
| 3253f7494e | |||
| 31a774a92a | |||
| a0d5e5ad72 | |||
| cf8cfd8b17 | |||
| e607f5c079 | |||
| 397f7050ef | |||
| e20e5e59b8 | |||
| 20e40a9a9c | |||
| da2673d35e | |||
| 5c8cd19477 | |||
| 2a19a3ced4 | |||
| 24d08857e8 | |||
| 329fcc8302 | |||
| 91c8233a71 | |||
| ee696c2122 | |||
| 3dfff739fa | |||
| 6d6746f5a4 | |||
| 74d65f6fda | |||
| 87cb659dc2 | |||
| 4e25f4b68c | |||
| 5ef05d1bb6 | |||
| 20e80ebb92 | |||
| 9c6b538176 | |||
| 5e629a3e5c | |||
| 0aacecbee5 | |||
| 3aacf7df6a | |||
| 3cb7d9e3fe | |||
| 02b1b5ac0c | |||
| e3de570f29 | |||
| 2e7f7ad477 | |||
| ed6db3e7b0 | |||
| 0ab8c2481b | |||
| 95c82d9968 | |||
| 1bfdeeeb16 | |||
| 418e4ffee8 | |||
| cbf49b303b | |||
| 7f135d6e55 | |||
| 02f21ad7c9 | |||
| e6023a7013 | |||
| 699b27cecc | |||
| 4707e0f858 | |||
| fc721b8ec8 | |||
| 2918f6bc07 | |||
| b27ff80c75 | |||
| 0e0dee3d3d | |||
| d22d0a8145 | |||
| c175369ff6 | |||
| 923adc3ea5 | |||
| 0e438942e4 | |||
| 44aa1285ee | |||
| 122d180f02 | |||
| f3340343ad | |||
| d514eef59b | |||
| 3a4e72e3e7 | |||
| 58d585e2a6 | |||
| 9a76df62dd | |||
| fe5416958a | |||
| 3b9e9ae0fd | |||
| 773ab21085 | |||
| eb62481766 | |||
| 6197fb07e1 | |||
| c9830dff57 | |||
| 192f9f0cb5 | |||
| e599555ddb | |||
| 328cce33b9 | |||
| 127682cc84 | |||
| 065db3b396 | |||
| c645b81890 | |||
| 2734307ba2 | |||
| 53fd5e0a5c | |||
| 5a30d3ed03 | |||
| 28493488ac | |||
| 0d2127f874 | |||
| ee741048e9 | |||
| 90f74d6847 | |||
| a92b4c04e9 | |||
| 8453d5bc48 | |||
| 542c0913d6 | |||
| 35e72692c1 | |||
| 4a49a11e73 | |||
| ee6d7ae6ba | |||
| bd86e70766 | |||
| 5d85a26be1 | |||
| ede7f9899c | |||
| 3b8993a302 | |||
| c412038db8 | |||
| 2ef6d3f93e | |||
| 5e7d2fd07d | |||
| 8edb73dc3a | |||
| 93900086e1 | |||
| 70f10782b0 | |||
| 8a92fada5a | |||
| ce2a79b63e | |||
| 2fb95b00a5 | |||
| 1867088e1a | |||
| a573e840db | |||
| 87e7b9c3f0 | |||
| ec35c0d933 | |||
| 2a48b199d2 | |||
| 02e780025d | |||
| 677ba36d55 | |||
| b23af6d436 | |||
| db798ea4f4 | |||
| 6ef11777e3 | |||
| a4fe14a3d3 | |||
| 660db94607 | |||
| aa8195565d | |||
| a6589e283b | |||
| 58175a5442 | |||
| 41b190930f | |||
| f28a392f71 | |||
| 8ad9ad578c | |||
| a4769239fa | |||
| c20f35b3e8 | |||
| 5a14a85f52 | |||
| 3054a4c307 | |||
| 70476bfb06 | |||
| b3292e1d22 | |||
| a34a69b4c4 | |||
| aa6af15cb5 | |||
| da70a45d22 | |||
| 57a216cb44 | |||
| 308562f939 | |||
| 64784be57e | |||
| f0e8d88178 | |||
| 5137b84ba8 | |||
| 216113e14b | |||
| a1adda36fa | |||
| 5d074ea998 | |||
| e9c4613368 | |||
| 3690f93302 | |||
| 97e1963674 | |||
| dd73b82ec2 | |||
| 8a5405060f | |||
| 83270d0983 | |||
| fd4343702f | |||
| 0483e8bd1b | |||
| 39cbdbd5c2 | |||
| 5af47c5951 | |||
| c447c251cd | |||
| 3a2ccd7521 | |||
| 8c92271804 | |||
| cd7b5e4dce | |||
| ecc3459d93 | |||
| cc6dce25ad | |||
| 87ecdd38e5 | |||
| fc79521dd3 | |||
| 7d8f1bef87 | |||
| 10c43bfa51 | |||
| f50b83b293 | |||
| f89357f3c8 | |||
| 1f43e69b4c | |||
| 670c5e2e1a | |||
| e097722ec6 | |||
| b54c50ba7a | |||
| 7b1a084d39 | |||
| 6477de8c4f | |||
| 5c0a75071c | |||
| 391eee4289 | |||
| 2d6670cfe5 | |||
| 2cf546accd | |||
| ffa8e5ff62 | |||
| 84f99b6d6b | |||
| eb33e8ae11 | |||
| 5af0cb2844 | |||
| 26255b79db | |||
| f6e6f10716 | |||
| b5ca3219a1 | |||
| fb1d4109a9 | |||
| a2e86ebec5 | |||
| c6b637e5a5 | |||
| 0c9d640683 | |||
| db63c947b8 | |||
| 649f363917 | |||
| 6ad4a95cc6 | |||
| d652cc8ea4 | |||
| 989bffee81 | |||
| cd9cf9f52f | |||
| d3a9d509a8 | |||
| 380cf8691a | |||
| 62e48e7701 | |||
| 5e81848445 | |||
| e047d99a6c | |||
| d8ad337c0e | |||
| 391b6ed515 | |||
| d64f762277 | |||
| 4d3ba5087d | |||
| aba1acea9c | |||
| 9502f0aadf | |||
| 564c31c54d | |||
| 6aa0c9d694 | |||
| e726a82cc3 | |||
| dd1f5f6a11 | |||
| f08799f7ff | |||
| dffee38dc6 | |||
| fe542deb89 | |||
| 8aa13b51f4 | |||
| c16fe3c810 | |||
| 635d28cd65 | |||
| f915eed0f4 | |||
| 87994ebfba | |||
| 0b2281967b | |||
| fc9e7a3a3b | |||
| 884b0291f7 | |||
| 8d8b3241d1 | |||
| 272bbdb4d2 | |||
| 168183201a | |||
| aedd70f5fa | |||
| f9b46b46b1 | |||
| 983c7a9c91 | |||
| 48a9f05efb | |||
| f0a0f0677f | |||
| 35cd98c7a7 | |||
| 8b2f325cd0 | |||
| 4d70cb20e7 | |||
| 8e55b6618e | |||
| 7e75f7559a | |||
| 8ad1c1d8a9 | |||
| fb03db8980 | |||
| 11d5e4b6ca | |||
| 8db6060089 | |||
| 07625336fd | |||
| 35fad4d5a7 | |||
| 0f67e93a0f | |||
| 628a5764cc | |||
| 7cfc5b085e | |||
| fb3c6365e1 | |||
| 2c69dd7c93 | |||
| 1d6e947387 | |||
| c26637de53 | |||
| d1ecb32652 | |||
| 4b14ec53f1 | |||
| f6046477b4 | |||
| 2cdd50b9e9 | |||
| bb541eeb60 | |||
| 8866b3170e | |||
| 174cb1876a | |||
| 955f164efb | |||
| d939820918 | |||
| 12f8357373 | |||
| cbe0e94ca7 | |||
| 079d1ca870 | |||
| 41903e8f09 | |||
| 6906125725 | |||
| 11fbb86f8b | |||
| cfdd48b2a3 | |||
| 2cef299775 | |||
| 02e291d4e8 | |||
| 02d6471c88 | |||
| 02633d4b01 | |||
| 95176fc813 | |||
| 8571c35e77 | |||
| a84862897a | |||
| 2781f82d29 | |||
| f809f503c9 | |||
| 4170434b96 | |||
| 65e8c2ffde | |||
| c239964427 | |||
| 21bdc8c5b6 | |||
| 39abb4f50c | |||
| 93105966b6 | |||
| 2e4b4b94ed | |||
| bad963ddbc | |||
| 9ecf98195c | |||
| 1476ebdfe6 | |||
| e25fd47828 | |||
| d559a9ac0d | |||
| e8394c2b01 | |||
| 3ec1c894ee | |||
| fb3e3c8447 | |||
| 496f8151c9 | |||
| 55f5d4affa | |||
| d22c8832f7 | |||
| d8138d2c56 | |||
| 6c00eb9344 | |||
| b0e24b346e | |||
| 822a1b1003 | |||
| 3d5f99e14a | |||
| 0e8f62b480 | |||
| d70c4d7bbe | |||
| 05df6c5b21 | |||
| 3f6036a512 | |||
| 58f42f1af1 | |||
| 0ef95d8fe6 | |||
| ea677389ad | |||
| 057e4603db | |||
| a67aed9538 | |||
| 00068158c1 | |||
| 9e4cf19e0c | |||
| 84c85a4605 | |||
| c02ba17845 | |||
| f4b30c5861 | |||
| 5d9e400e86 | |||
| 39914c8eb4 | |||
| 7133357b1a | |||
| 629f9863ae | |||
| be57c66256 | |||
| e0edd7a290 | |||
| d46912fcdf | |||
| 5c7484cea2 | |||
| d525d23217 | |||
| c030cfe0ad | |||
| cb633e4b6a | |||
| 16afa277de | |||
| c18e9d9503 | |||
| a490b2ff22 | |||
| f32a30fb9a | |||
| 0f60fb06e3 | |||
| 01bd8bd9fa | |||
| 489a6ffd16 | |||
| f89d783308 | |||
| 1d6bd3cc5e | |||
| ea31a29f8a | |||
| 205dd8a1e5 | |||
| 8caac162b2 | |||
| 970b30b467 | |||
| 746569b471 | |||
| 20869a0aec | |||
| 88ec04e5ca | |||
| 33a8a398fe | |||
| d887c77a1b | |||
| 60c280a521 | |||
| 837c02ffd6 | |||
| 6b94e08404 | |||
| 1f471aa9f9 | |||
| 951c321ba6 | |||
| eabea6ea16 | |||
| 14649ce611 | |||
| c6377b93d5 | |||
| 5a6c25887a | |||
| 0e44a3625c | |||
| 476dc6e783 | |||
| 4ad2e5f9b5 | |||
| 2a28e88bcf | |||
| 44c833fbe6 | |||
| 026f019f58 | |||
| 451d422b8a | |||
| 808977f69a | |||
| 402a10c488 | |||
| 0caa1fd40b | |||
| 754d70d513 | |||
| eb3a11b49a | |||
| 916b33f714 | |||
| 58c5003ad5 | |||
| 0ca01641ff | |||
| 0fc7dade47 | |||
| ab4c9581ad | |||
| 6e474f22a2 | |||
| 068bd57fbc | |||
| d7f9cdf6b6 | |||
| a503c1af97 | |||
| 53a14381ba | |||
| 169b9161b9 | |||
| 85f2b46fe9 | |||
| 0dfa1e192d | |||
| 88eb0dcdfc | |||
| bb8a82030f | |||
| 16a6fc7d2c | |||
| 1ebf88abbb | |||
| 93e9f29c77 | |||
| 1b7271359e | |||
| 49df0a5d33 | |||
| 46f8723314 | |||
| 5f02de1c95 | |||
| 9d938cdd58 | |||
| e5fd0f5d75 | |||
| a3f9d5e707 | |||
| 5344679c7c | |||
| e09adbd13d | |||
| 275f9d6aaf | |||
| 9461067fdb | |||
| 7623770613 | |||
| 584278bf20 | |||
| 1ec0add76f | |||
| 51dff22b93 | |||
| c85c4a969d | |||
| 6a8a6e530b | |||
| ce4f4995b5 | |||
| a4260e54fe | |||
| f074ead7f6 | |||
| b819137e35 | |||
| 4d653caca3 | |||
| 75663774fe | |||
| 5ec5b398ac | |||
| 24c70a04ca | |||
| a602f70bf4 | |||
| 5733124c40 | |||
| 5216532e96 | |||
| c8bead6bdd | |||
| 72cec5608d | |||
| 8b1262b198 | |||
| 6e0a214bcc | |||
| 1ab19920f4 | |||
| 751d51c4d0 | |||
| 4a54e262f6 | |||
| bd0c325762 | |||
| de55f99174 | |||
| 044cf8da1a | |||
| aa57642103 | |||
| d98ed8f419 | |||
| 4b07f4ffc5 | |||
| 5a526a89aa | |||
| 3dbf863255 | |||
| 17f0cffca6 | |||
| d51e60cf8b | |||
| 85d6db1de1 | |||
| 1bf794c29f | |||
| 0e8f7a4542 | |||
| b72fe81e28 | |||
| a76889959f | |||
| 0166486e07 | |||
| bb793e5582 | |||
| a55c095d1b | |||
| 3d47d912fd | |||
| cc02d94bdf | |||
| 5121cc25a4 | |||
| e78d91104c | |||
| 38c5c79218 | |||
| b065f973c4 | |||
| 13609c4f09 | |||
| a93116aa19 | |||
| 95a5c7d4cc | |||
| 5d0136a4b6 | |||
| 2c74b4f1ac | |||
| 6bb8d87225 | |||
| 935ce8f968 | |||
| 70f994cda5 | |||
| 3970bb5955 | |||
| 3159453e75 | |||
| a1cb8d7ae7 | |||
| 4191c195c1 | |||
| b16ce6f809 | |||
| 88ba962a4c | |||
| 0315d15ce8 | |||
| 12681f4623 | |||
| a7a4f9373d | |||
| d2e66214f4 | |||
| 0a6d98b5e1 | |||
| 497c10e513 | |||
| 53765ebc62 | |||
| 4216627604 | |||
| 47c33f3b31 | |||
| 32359da1cc | |||
| f4e085c121 | |||
| 7972937072 | |||
| 5a6f2467f8 | |||
| 1822347a46 | |||
| 821ba8b701 | |||
| fdced53be1 | |||
| a394bf25b2 | |||
| f2c1c9f70e | |||
| 5199364091 | |||
| 50caef0086 | |||
| 8a04d8e2b7 | |||
| e7032bc2c2 | |||
| d128ef1b97 | |||
| 0645908762 | |||
| abbd0558a0 | |||
| c725ee84bb | |||
| a9b4e7819f | |||
| ae68deb4f8 | |||
| e4108d089f | |||
| 4d9d50c9ac | |||
| b727cbbfe9 | |||
| 864338a881 | |||
| 6dc444d2d1 | |||
| 13fcccefd5 | |||
| 30e8eac46e | |||
| 646e1f541c | |||
| a7c15ef598 | |||
| bddb03ba3b | |||
| 2ac1f37b02 | |||
| a96f10b6aa | |||
| ccf6b5ff68 | |||
| 0d661204ed | |||
| b0e50f13c9 | |||
| d3ad253b51 | |||
| 5ac23a2f8f | |||
| 9fff694382 | |||
| 4512326fe8 | |||
| bfb17a2fb5 | |||
| 53c124526c | |||
| 8007097aae | |||
| 32e5ed5ad8 | |||
| 65afbd4147 | |||
| 81e04ee185 | |||
| 52722dc0c8 | |||
| b9c270fab6 | |||
| 48db481fbb | |||
| 37cacd27b1 | |||
| 466f541798 | |||
| 9781af5696 | |||
| f6d5e8031f | |||
| c70ea4a621 | |||
| 76ec6e4da2 | |||
| cd2825288d | |||
| d95fdda30f | |||
| 4fdcf604f2 | |||
| 02c9007765 | |||
| 0f54830bc5 | |||
| d329fe0c12 | |||
| a7ce852ca5 | |||
| b4fce37c14 | |||
| 51181c8c8b | |||
| 1c07ae9172 | |||
| 2f8cbb3a9d | |||
| 093af6af0b | |||
| 0567073ca0 | |||
| e33eb9d7b0 | |||
| fd10ddf86d | |||
| edd4d47929 | |||
| f31b9ad98b | |||
| 10ee3ea346 | |||
| 62b7eda9e9 | |||
| 8b7984cf7d | |||
| 4a0e07a54c | |||
| 6e520c8476 | |||
| 917a8ed389 | |||
| 86bba4ff0e | |||
| 300799fdc8 | |||
| 65e36e02fb | |||
| 09dd3c1b37 | |||
| 36233538fd | |||
| 3d5b3d1e8c | |||
| 3c2ae8250f | |||
| 6a95abb01f | |||
| 4c6fce5d5c | |||
| 08b5225a13 | |||
| 765b5ee826 | |||
| a40a34d2e8 | |||
| 983ee2d39b | |||
| e1255af708 | |||
| b99d476754 | |||
| 23ab896dfc | |||
| d094a09ded | |||
| 3f8ee533d3 | |||
| 0c3c84d711 | |||
| 79c53a41a8 | |||
| 2ffa13c993 | |||
| 8af48bbe48 | |||
| 65c0772d37 | |||
| 78ab347171 | |||
| d83b94d231 | |||
| ed6c46f7ff | |||
| 925e19b15c | |||
| 2be71fc2ec | |||
| bc2ee8dce8 | |||
| 1deef77f07 | |||
| e00c57bc47 | |||
| da3ba12560 | |||
| f68b89b7d9 | |||
| c944aafb39 | |||
| 0e6c9820cd | |||
| b8d1838dcc | |||
| aba535b589 | |||
| cf117b1a4d | |||
| 1bae570b68 | |||
| 1f0e263b6e | |||
| 08706055af | |||
| 28bcf074fc | |||
| 1c8aaf97bc | |||
| a891597f4c | |||
| e3805d5920 | |||
| 3e6be197e6 | |||
| 0d5fc26841 | |||
| df47e17c8e | |||
| e53fa1d873 | |||
| d5152a0e59 | |||
| 78e04dee99 | |||
| b3d117f8c1 | |||
| cab77e83da | |||
| b4068823ed | |||
| a694cf3079 | |||
| 3c09613d01 | |||
| 36d336e69c | |||
| 4270d77692 | |||
| ec6c5519a5 | |||
| a06fe1d02e | |||
| 56ba87577b | |||
| cdb29be4f3 | |||
| 4ef9732e37 | |||
| f2f4e55818 | |||
| 403ac53a9e | |||
| cdcda943be | |||
| 2c25241763 | |||
| 17729365db | |||
| 5d5dc1b544 | |||
| 244c7e019c | |||
| a7fea4fc69 | |||
| 809925dc3e | |||
| 98c835e470 | |||
| 8ac4845930 | |||
| 765f23febc | |||
| f1b70b3340 | |||
| 549dfc9781 | |||
| 2019379a42 | |||
| 15335509c2 | |||
| da401acdb2 | |||
| 8327f22f6f | |||
| 6154cfce99 | |||
| c13c039721 | |||
| 7ee417ab05 | |||
| 3a95f81196 | |||
| 9a19a00bdc | |||
| 24308aec6c | |||
| 6b4b259753 | |||
| bf77bc47d1 | |||
| 2bde0b40bb | |||
| 478f7b8e49 | |||
| f289dffc48 | |||
| d119ed058b | |||
| fdb6f0fe84 | |||
| bef02b3511 | |||
| fcd9b525a8 | |||
| 590d8f4043 | |||
| 406e2f84eb | |||
| 926e2f7939 | |||
| b92a009539 | |||
| cfab1c4649 | |||
| fc03ee94e2 | |||
| 936c8cce4b | |||
| 1f2145a45d | |||
| 2331678312 | |||
| c216ece72c | |||
| 36e12110d5 | |||
| aa5ac1518b | |||
| d472c05f5d | |||
| 485fc2b2b7 | |||
| bdc83f4f37 | |||
| da178c9fba | |||
| a1dc390f49 | |||
| dfe63f87c3 | |||
| 239d4afb13 | |||
| ab2c184b54 | |||
| 31ede315f2 | |||
| 3992ac02bb | |||
| e6ad26f03c | |||
| 2f335372a0 | |||
| 63d678ce29 | |||
| 0c675c33e2 | |||
| 3c8d83f2a8 | |||
| b11ed32bcf | |||
| 9a63ee65c9 | |||
| 8b8742b242 | |||
| bccbc0f064 | |||
| b7fcd5b02a | |||
| 56b9dda60b | |||
| 1868d0e7a3 | |||
| 38b3433406 | |||
| 6d21823959 | |||
| 02eb56a696 | |||
| 6fe5c06fa0 | |||
| 2c68e813e9 | |||
| e42c7a38a5 | |||
| 7b5b1b2583 | |||
| 0578f45490 | |||
| f46f7bd528 | |||
| 945cc2117f | |||
| a5db4310c6 | |||
| d25205d9d3 | |||
| d12c700bbf | |||
| db70ad37dd | |||
| 9e1115f899 | |||
| 82f4b4ee53 | |||
| 4ff2efea43 | |||
| d2a3c051e5 | |||
| 16d3825df4 | |||
| 602b17f0e8 | |||
| 488b2888a8 | |||
| 1480b8911f | |||
| 72ef7f6557 | |||
| f35afed89a | |||
| ffe6494147 | |||
| 342a4c1b17 | |||
| b904689a98 | |||
| 0dc66b3dd7 | |||
| bb1282de30 | |||
| c5e4cf35c0 | |||
| 2529a7700e | |||
| 7e2806119b | |||
| 536e31d771 | |||
| 2a39449f6e | |||
| 7af04798fb | |||
| 76e25f75fa | |||
| 7b894a7c61 | |||
| d8a1d84a49 | |||
| bb8d11a57b | |||
| c0d37b2e04 | |||
| 56b41c882b | |||
| 8c3cce822a | |||
| b87d4a3e5f | |||
| cec60feba9 | |||
| a3738dc131 | |||
| 6d0c0aee7d | |||
| 1b290b577d | |||
| 85c7e1b059 | |||
| bc82bff4b4 | |||
| ff091e940c | |||
| 55a964267e | |||
| d14608356d | |||
| a1080fdb2d | |||
| 344feb7484 | |||
| 69f1187722 | |||
| 49c3a81e18 | |||
| 1e7c5bb9b7 | |||
| 850fa5aecc | |||
| 79a9d2112a | |||
| d25d8187b6 | |||
| e47de5deed | |||
| a3e24b6854 | |||
| ce63503bab | |||
| 1363d5d209 | |||
| 69bad31019 | |||
| 17954dd8fe | |||
| 7adcf6d3e5 | |||
| bec6acc01e | |||
| 1f265af1e7 | |||
| 3ddc61420b | |||
| b10de6f4e7 | |||
| f2e0f9cca5 | |||
| b26df187e6 | |||
| 6887ae18ae | |||
| 2336aa0e4f | |||
| 3cc1065873 | |||
| 38521e0009 | |||
| 20fc585b5e | |||
| 7b23c8dc75 | |||
| 2445576ae8 | |||
| 7648f071f1 | |||
| 60c93595f5 | |||
| 70998d25e3 | |||
| fa908040ca | |||
| d1f7935ee2 | |||
| dc045591e4 | |||
| 43d0350870 | |||
| 0e4ac63b6b | |||
| b6c0e7c302 | |||
| bdcb9d0c00 | |||
| b8adbee4ee | |||
| feae79b417 | |||
| bcf9546b2d | |||
| ac1d931b5e | |||
| 6e9e81a890 |
+16
@@ -0,0 +1,16 @@
|
||||
language: cpp
|
||||
compiler: gcc
|
||||
before_install:
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install -y libmysqlclient-dev libperl-dev libboost-dev liblua5.1-0-dev zlib1g-dev
|
||||
script:
|
||||
- cmake -G "Unix Makefiles" -DEQEMU_BUILD_TESTS=ON -DEQEMU_ENABLE_BOTS=ON
|
||||
- make
|
||||
- ./bin/tests
|
||||
branches:
|
||||
only: master
|
||||
notifications:
|
||||
email: false
|
||||
irc:
|
||||
channels: "irc.eqemulator.net#eqemucoders"
|
||||
os: linux
|
||||
+196
-18
@@ -1,4 +1,36 @@
|
||||
#EQEmu Cmake
|
||||
#EQEmu CMake
|
||||
#Variables used:
|
||||
#EQEMU_DISABLE_CRT_SECURE_WARNINGS
|
||||
#EQEMU_FAST_FLOATINGPOINT
|
||||
#EQEMU_ENABLE_CRASH_LOGGING
|
||||
#EQEMU_DISABLE_SAFESEH
|
||||
#EQEMU_BUILD_MSVC_MP
|
||||
#EQEMU_DEBUG_LEVEL
|
||||
#EQEMU_LOG_LEVEL_STATUS
|
||||
#EQEMU_LOG_LEVEL_NORMAL
|
||||
#EQEMU_LOG_LEVEL_ERROR
|
||||
#EQEMU_LOG_LEVEL_DEBUG
|
||||
#EQEMU_LOG_LEVEL_QUEST
|
||||
#EQEMU_LOG_LEVEL_COMMANDS
|
||||
#EQEMU_LOG_LEVEL_CRASH
|
||||
#EQEMU_STREAM_SEND_RATE
|
||||
#EQEMU_STREAM_DECAY_RATE
|
||||
#EQEMU_STREAM_RETRANSMIT_TIMEOUT_MUL
|
||||
#EQEMU_STREAM_RETRANSMIT_TIMEOUT_MAX
|
||||
#EQEMU_STREAM_AVERAGE_DELTA_MAX
|
||||
#EQEMU_STREAM_RETRANSMIT_ACKED_PACKETS
|
||||
#EQEMU_DEPOP_INVALIDATES_CACHE
|
||||
#EQEMU_ENABLE_BOTS
|
||||
#EQEMU_DISABLE_LOGSYS
|
||||
#EQEMU_COMMANDS_LOGGING
|
||||
#EQEMU_BUILD_SERVER
|
||||
#EQEMU_BUILD_LOGIN
|
||||
#EQEMU_BUILD_TESTS
|
||||
#EQEMU_BUILD_PERL
|
||||
#EQEMU_BUILD_LUA
|
||||
#EQEMU_SANITIZE_LUA_LIBS
|
||||
#EQEMU_BUILD_CLIENT_FILES
|
||||
#EQEMU_MAP_DIR
|
||||
|
||||
#We set a fairly new version (as of 2013) because I found finding perl was a bit... buggy on older ones
|
||||
#Can change this if you really want but you should upgrade!
|
||||
@@ -7,9 +39,6 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
||||
#FindMySQL is located here so lets make it so CMake can find it
|
||||
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/" ${CMAKE_MODULE_PATH})
|
||||
|
||||
#For checking includes
|
||||
INCLUDE (CheckIncludeFiles)
|
||||
|
||||
#Our project name is EQEmu
|
||||
PROJECT(EQEmu)
|
||||
|
||||
@@ -33,9 +62,11 @@ IF(MSVC)
|
||||
IF(CMAKE_CL_64)
|
||||
SET(ZLIB_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/zlib_x64")
|
||||
SET(MYSQL_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/mysql_x64")
|
||||
SET(LUA_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/luaj_x64")
|
||||
ELSE(CMAKE_CL_64)
|
||||
SET(ZLIB_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/zlib_x86")
|
||||
SET(MYSQL_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/mysql_x86")
|
||||
SET(LUA_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/luaj_x86")
|
||||
ENDIF(CMAKE_CL_64)
|
||||
|
||||
#disable CRT warnings on windows cause they're annoying as shit and we use C functions everywhere
|
||||
@@ -72,6 +103,11 @@ IF(MSVC)
|
||||
SET(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} /SAFESEH:NO")
|
||||
SET(CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO} /SAFESEH:NO")
|
||||
ENDIF(EQEMU_DISABLE_SAFESEH)
|
||||
|
||||
OPTION(EQEMU_BUILD_MSVC_MP "Enable build with multiple processes." ON)
|
||||
IF(EQEMU_BUILD_MSVC_MP)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
||||
ENDIF(EQEMU_BUILD_MSVC_MP)
|
||||
|
||||
#We want to compile /MT not /MD so we change that
|
||||
FOREACH(flag_var CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELWITHDEBINFO CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO)
|
||||
@@ -92,14 +128,12 @@ IF(UNIX)
|
||||
ADD_DEFINITIONS(-DFREEBSD)
|
||||
SET(FREEBSD TRUE)
|
||||
ENDIF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
||||
IF(CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||
ADD_DEFINITIONS(-DDARWIN)
|
||||
SET(DARWIN TRUE)
|
||||
ENDIF(CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||
ENDIF(UNIX)
|
||||
|
||||
#use stdint.h types if they exist for this platform (we have to guess otherwise)
|
||||
CHECK_INCLUDE_FILES(stdint.h HAVE_STDINT_H)
|
||||
IF(HAVE_STDINT_H)
|
||||
ADD_DEFINITIONS(-DEQEMU_USE_STDINT)
|
||||
ENDIF(HAVE_STDINT_H)
|
||||
|
||||
#debug level, 5 is default. Most people wont ever change this but it's there if you want to
|
||||
SET(EQEMU_DEBUG_LEVEL 5 CACHE STRING "EQEmu debug level:
|
||||
0 - Quiet mode Errors to file Status and Normal ignored
|
||||
@@ -111,8 +145,106 @@ SET(EQEMU_DEBUG_LEVEL 5 CACHE STRING "EQEmu debug level:
|
||||
10 - More errors than you ever wanted to see"
|
||||
)
|
||||
|
||||
SET(EQEMU_LOG_LEVEL_STATUS 2 CACHE STRING "EQEmu logging level for [Status]:
|
||||
0 - Disabled
|
||||
1 - Ouput to File Enabled
|
||||
2 - Output to stdout Enabled
|
||||
3 - Output to File and stdout Enabled
|
||||
8 - Output to stderr Enabled
|
||||
9 - Output to File and stderr Enabled
|
||||
11 - Output to File, stdout and stderr Enabled"
|
||||
)
|
||||
|
||||
SET(EQEMU_LOG_LEVEL_NORMAL 3 CACHE STRING "EQEmu logging level for [Normal]:
|
||||
0 - Disabled
|
||||
1 - Ouput to File Enabled
|
||||
2 - Output to stdout Enabled
|
||||
3 - Output to File and stdout Enabled
|
||||
8 - Output to stderr Enabled
|
||||
9 - Output to File and stderr Enabled
|
||||
11 - Output to File, stdout and stderr Enabled"
|
||||
)
|
||||
|
||||
SET(EQEMU_LOG_LEVEL_ERROR 2 CACHE STRING "EQEmu logging level for [Error]:
|
||||
0 - Disabled
|
||||
1 - Ouput to File Enabled
|
||||
2 - Output to stdout Enabled
|
||||
3 - Output to File and stdout Enabled
|
||||
8 - Output to stderr Enabled
|
||||
9 - Output to File and stderr Enabled
|
||||
11 - Output to File, stdout and stderr Enabled"
|
||||
)
|
||||
|
||||
SET(EQEMU_LOG_LEVEL_DEBUG 3 CACHE STRING "EQEmu logging level for [Debug]:
|
||||
0 - Disabled
|
||||
1 - Ouput to File Enabled
|
||||
2 - Output to stdout Enabled
|
||||
3 - Output to File and stdout Enabled
|
||||
8 - Output to stderr Enabled
|
||||
9 - Output to File and stderr Enabled
|
||||
11 - Output to File, stdout and stderr Enabled"
|
||||
)
|
||||
|
||||
SET(EQEMU_LOG_LEVEL_QUEST 2 CACHE STRING "EQEmu logging level for [Quest]:
|
||||
0 - Disabled
|
||||
1 - Ouput to File Enabled
|
||||
2 - Output to stdout Enabled
|
||||
3 - Output to File and stdout Enabled
|
||||
8 - Output to stderr Enabled
|
||||
9 - Output to File and stderr Enabled
|
||||
11 - Output to File, stdout and stderr Enabled"
|
||||
)
|
||||
|
||||
SET(EQEMU_LOG_LEVEL_COMMANDS 1 CACHE STRING "EQEmu logging level for [Commands]:
|
||||
0 - Disabled
|
||||
1 - Ouput to File Enabled
|
||||
2 - Output to stdout Enabled
|
||||
3 - Output to File and stdout Enabled
|
||||
8 - Output to stderr Enabled
|
||||
9 - Output to File and stderr Enabled
|
||||
11 - Output to File, stdout and stderr Enabled"
|
||||
)
|
||||
|
||||
SET(EQEMU_LOG_LEVEL_CRASH 3 CACHE STRING "EQEmu logging level for [Crash]:
|
||||
0 - Disabled
|
||||
1 - Ouput to File Enabled
|
||||
2 - Output to stdout Enabled
|
||||
3 - Output to File and stdout Enabled
|
||||
8 - Output to stderr Enabled
|
||||
9 - Output to File and stderr Enabled
|
||||
11 - Output to File, stdout and stderr Enabled"
|
||||
)
|
||||
|
||||
MARK_AS_ADVANCED(EQEMU_LOG_LEVEL_STATUS EQEMU_LOG_LEVEL_NORMAL EQEMU_LOG_LEVEL_ERROR EQEMU_LOG_LEVEL_DEBUG EQEMU_LOG_LEVEL_QUEST EQEMU_LOG_LEVEL_COMMANDS EQEMU_LOG_LEVEL_CRASH)
|
||||
|
||||
SET(EQEMU_STREAM_SEND_RATE 1048576 CACHE STRING "Advanced: Base amount of data stream can send before throttle.")
|
||||
SET(EQEMU_STREAM_DECAY_RATE 78642 CACHE STRING "Advanced: Base amount of data stream recovers per tic.")
|
||||
SET(EQEMU_STREAM_RETRANSMIT_TIMEOUT_MUL 3.0 CACHE STRING "Advanced: Multiplier on retransmit timeout.")
|
||||
SET(EQEMU_STREAM_RETRANSMIT_TIMEOUT_MAX 5000 CACHE STRING "Advanced: Max in ms for retransmit timeout timer.")
|
||||
SET(EQEMU_STREAM_AVERAGE_DELTA_MAX 2500 CACHE STRING "Advanced: The maximum average delta in ms allowed.")
|
||||
SET(EQEMU_STREAM_RETRANSMIT_ACKED_PACKETS TRUE CACHE BOOL "Advanced: Whether or not acked packets can be retransmitted")
|
||||
MARK_AS_ADVANCED(EQEMU_STREAM_SEND_RATE EQEMU_STREAM_DECAY_RATE EQEMU_STREAM_RETRANSMIT_TIMEOUT_MUL EQEMU_STREAM_RETRANSMIT_TIMEOUT_MAX EQEMU_STREAM_AVERAGE_DELTA_MAX EQEMU_STREAM_RETRANSMIT_ACKED_PACKETS)
|
||||
|
||||
#NPC Types Cache Behavior
|
||||
OPTION(EQEMU_DEPOP_INVALIDATES_CACHE "#repop invalidates the npc_types cache (will cause a larger database hit on #repop but is more convienent)." ON)
|
||||
|
||||
#Bots are a compile time option so on/off
|
||||
OPTION(EQEMU_ENABLE_BOTS "Enable Bots" OFF)
|
||||
|
||||
#Disable entire _mlog system (excludes trade/command logs)
|
||||
OPTION(EQEMU_DISABLE_LOGSYS "Disable Logging INI System" ON)
|
||||
|
||||
#Enable GM Command log system
|
||||
OPTION(EQEMU_COMMANDS_LOGGING "Enable GM Command logs" ON)
|
||||
|
||||
IF(EQEMU_COMMANDS_LOGGING)
|
||||
ADD_DEFINITIONS(-DCOMMANDS_LOGGING)
|
||||
ENDIF(EQEMU_COMMANDS_LOGGING)
|
||||
|
||||
IF(EQEMU_DISABLE_LOGSYS)
|
||||
ADD_DEFINITIONS(-DDISABLE_LOGSYS)
|
||||
ENDIF(EQEMU_DISABLE_LOGSYS)
|
||||
|
||||
IF(EQEMU_ENABLE_BOTS)
|
||||
ADD_DEFINITIONS(-DBOTS)
|
||||
ENDIF(EQEMU_ENABLE_BOTS)
|
||||
@@ -120,13 +252,14 @@ ENDIF(EQEMU_ENABLE_BOTS)
|
||||
#What to build
|
||||
OPTION(EQEMU_BUILD_SERVER "Build the game server." ON)
|
||||
OPTION(EQEMU_BUILD_LOGIN "Build the login server." OFF)
|
||||
OPTION(EQEMU_BUILD_AZONE "Build azone utility." OFF)
|
||||
OPTION(EQEMU_BUILD_TESTS "Build utility tests." OFF)
|
||||
OPTION(EQEMU_BUILD_PERL "Build Perl parser." ON)
|
||||
OPTION(EQEMU_BUILD_LUA "Build Lua parser." ON)
|
||||
OPTION(EQEMU_BUILD_CLIENT_FILES "Build Client Import/Export Data Programs." ON)
|
||||
|
||||
#C++11 stuff
|
||||
IF(NOT MSVC)
|
||||
ADD_DEFINITIONS(-std=c++0x)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
||||
ENDIF(NOT MSVC)
|
||||
|
||||
#Various definitions
|
||||
@@ -134,10 +267,34 @@ IF(EQEMU_BUILD_PERL)
|
||||
ADD_DEFINITIONS(-DEMBPERL)
|
||||
ADD_DEFINITIONS(-DEMBPERL_PLUGIN)
|
||||
ENDIF(EQEMU_BUILD_PERL)
|
||||
IF(EQEMU_BUILD_LUA)
|
||||
ADD_DEFINITIONS(-DLUA_EQEMU)
|
||||
ENDIF(EQEMU_BUILD_LUA)
|
||||
|
||||
SET(EQEMU_MAP_DIR "./Maps" CACHE STRING "The dir that maps, water maps, and paths are located in.")
|
||||
|
||||
ADD_DEFINITIONS(-DEQDEBUG=${EQEMU_DEBUG_LEVEL})
|
||||
ADD_DEFINITIONS(-DINVERSEXY)
|
||||
ADD_DEFINITIONS(-DFIELD_ITEMS)
|
||||
ADD_DEFINITIONS(-DMAP_DIR="./Maps")
|
||||
ADD_DEFINITIONS(-DMAP_DIR="${EQEMU_MAP_DIR}")
|
||||
ADD_DEFINITIONS(-DRATEBASE=${EQEMU_STREAM_SEND_RATE})
|
||||
ADD_DEFINITIONS(-DDECAYBASE=${EQEMU_STREAM_DECAY_RATE})
|
||||
ADD_DEFINITIONS(-DRETRANSMIT_TIMEOUT_MULT=${EQEMU_STREAM_RETRANSMIT_TIMEOUT_MUL})
|
||||
ADD_DEFINITIONS(-DRETRANSMIT_TIMEOUT_MAX=${EQEMU_STREAM_RETRANSMIT_TIMEOUT_MAX})
|
||||
ADD_DEFINITIONS(-DAVERAGE_DELTA_MAX=${EQEMU_STREAM_AVERAGE_DELTA_MAX})
|
||||
ADD_DEFINITIONS(-DLOG_LEVEL_STATUS=${EQEMU_LOG_LEVEL_STATUS})
|
||||
ADD_DEFINITIONS(-DLOG_LEVEL_NORMAL=${EQEMU_LOG_LEVEL_NORMAL})
|
||||
ADD_DEFINITIONS(-DLOG_LEVEL_ERROR=${EQEMU_LOG_LEVEL_ERROR})
|
||||
ADD_DEFINITIONS(-DLOG_LEVEL_DEBUG=${EQEMU_LOG_LEVEL_DEBUG})
|
||||
ADD_DEFINITIONS(-DLOG_LEVEL_QUEST=${EQEMU_LOG_LEVEL_QUEST})
|
||||
ADD_DEFINITIONS(-DLOG_LEVEL_COMMANDS=${EQEMU_LOG_LEVEL_COMMANDS})
|
||||
ADD_DEFINITIONS(-DLOG_LEVEL_CRASH=${EQEMU_LOG_LEVEL_CRASH})
|
||||
|
||||
IF(EQEMU_STREAM_RETRANSMIT_ACKED_PACKETS)
|
||||
ADD_DEFINITIONS(-DRETRANSMIT_ACKED_PACKETS=true)
|
||||
ELSE(EQEMU_STREAM_RETRANSMIT_ACKED_PACKETS)
|
||||
ADD_DEFINITIONS(-DRETRANSMIT_ACKED_PACKETS=false)
|
||||
ENDIF(EQEMU_STREAM_RETRANSMIT_ACKED_PACKETS)
|
||||
|
||||
#Find everything we need
|
||||
FIND_PACKAGE(ZLIB REQUIRED)
|
||||
@@ -146,7 +303,28 @@ IF(EQEMU_BUILD_PERL)
|
||||
FIND_PACKAGE(PerlLibs REQUIRED)
|
||||
INCLUDE_DIRECTORIES("${PERL_INCLUDE_PATH}")
|
||||
ENDIF(EQEMU_BUILD_PERL)
|
||||
INCLUDE_DIRECTORIES("${ZLIB_INCLUDE_DIRS}" "${MySQL_INCLUDE_DIR}")
|
||||
|
||||
IF(EQEMU_BUILD_LUA)
|
||||
FIND_PACKAGE(EQLua51 REQUIRED)
|
||||
SET(Boost_USE_STATIC_LIBS OFF)
|
||||
SET(Boost_USE_MULTITHREADED ON)
|
||||
SET(Boost_USE_STATIC_RUNTIME OFF)
|
||||
SET(BOOST_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/boost")
|
||||
|
||||
FIND_PACKAGE(Boost REQUIRED)
|
||||
INCLUDE_DIRECTORIES("${LUA_INCLUDE_DIR}" "${Boost_INCLUDE_DIRS}" "luabind")
|
||||
|
||||
OPTION(EQEMU_SANITIZE_LUA_LIBS "Sanitize Lua Libraries (Remove OS and IO standard libraries from being able to run)." ON)
|
||||
IF(EQEMU_SANITIZE_LUA_LIBS)
|
||||
ADD_DEFINITIONS(-DSANITIZE_LUA_LIBS)
|
||||
ENDIF(EQEMU_SANITIZE_LUA_LIBS)
|
||||
ENDIF(EQEMU_BUILD_LUA)
|
||||
|
||||
INCLUDE_DIRECTORIES("${ZLIB_INCLUDE_DIRS}" "${MySQL_INCLUDE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/common/glm/glm")
|
||||
|
||||
IF(EQEMU_BUILD_LUA)
|
||||
ADD_SUBDIRECTORY(luabind)
|
||||
ENDIF(EQEMU_BUILD_LUA)
|
||||
|
||||
IF(EQEMU_BUILD_SERVER OR EQEMU_BUILD_LOGIN OR EQEMU_BUILD_TESTS)
|
||||
ADD_SUBDIRECTORY(common)
|
||||
@@ -163,10 +341,10 @@ IF(EQEMU_BUILD_LOGIN)
|
||||
ADD_SUBDIRECTORY(loginserver)
|
||||
ENDIF(EQEMU_BUILD_LOGIN)
|
||||
|
||||
IF(EQEMU_BUILD_AZONE)
|
||||
ADD_SUBDIRECTORY(utils)
|
||||
ENDIF(EQEMU_BUILD_AZONE)
|
||||
|
||||
IF(EQEMU_BUILD_TESTS)
|
||||
ADD_SUBDIRECTORY(tests)
|
||||
ENDIF(EQEMU_BUILD_TESTS)
|
||||
|
||||
IF(EQEMU_BUILD_CLIENT_FILES)
|
||||
ADD_SUBDIRECTORY(client_files)
|
||||
ENDIF(EQEMU_BUILD_CLIENT_FILES)
|
||||
|
||||
@@ -1,5 +1,53 @@
|
||||
EQEmu - Custom Game Implementation for EverQuest
|
||||
EQEmu
|
||||
===
|
||||
|
||||
TODO: A less useless readme file.
|
||||
[](https://travis-ci.org/EQEmu/Server)
|
||||
|
||||
Overview
|
||||
---
|
||||
|
||||
EQEmu is a custom server implementation for EverQuest
|
||||
|
||||
Dependencies
|
||||
---
|
||||
|
||||
For Windows: http://eqemu.github.io
|
||||
|
||||
Login Server dependencies for Windows/Linux/OSX: http://eqemu.github.io
|
||||
|
||||
For Debian based distros (adjust to your local flavor):
|
||||
|
||||
- libmysqlclient-dev
|
||||
- libperl-dev
|
||||
- liblua5.1-0-dev (5.2 should work as well)
|
||||
- libboost-dev
|
||||
|
||||
Further instructions on building the source can be found on the
|
||||
[wiki](http://wiki.eqemulator.org/i?M=Wiki).
|
||||
|
||||
Bug reports
|
||||
---
|
||||
|
||||
Please use the [issue tracker](https://github.com/EQEmu/Server/issues) provided by GitHub to send us bug
|
||||
reports or feature requests.
|
||||
|
||||
The [EQEmu Forums](http://www.eqemulator.org/forums/) also have forums to submit
|
||||
bugs/get help with bugs.
|
||||
|
||||
Contributions
|
||||
---
|
||||
|
||||
The preferred way to contribute is to fork the repo and submit a pull request on
|
||||
GitHub. If you need help with your changes, you can always post on the forums or
|
||||
try IRC. You can also post unified diffs (`git diff` should do the trick) on the
|
||||
[Server Code Submissions](http://www.eqemulator.org/forums/forumdisplay.php?f=669)
|
||||
forum, although pull requests will be much quicker and easier on all parties.
|
||||
|
||||
Contact
|
||||
---
|
||||
- **User IRC Channel**: `#eqemu` on `irc.eqemulator.net`
|
||||
- **Developer IRC Channel**: `#eqemucoders` on `irc.eqemulator.net`
|
||||
|
||||
- [EQEmulator Forums](http://www.eqemulator.org/forums)
|
||||
- [EQEmulator Wiki](http://wiki.eqemulator.org/i?M=Wiki)
|
||||
|
||||
Dependencies can be obtained at http://eqemu.github.com/
|
||||
|
||||
+1006
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,4 @@
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
||||
|
||||
add_subdirectory(import)
|
||||
add_subdirectory(export)
|
||||
@@ -0,0 +1,36 @@
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
||||
|
||||
SET(export_sources
|
||||
main.cpp
|
||||
)
|
||||
|
||||
SET(export_headers
|
||||
)
|
||||
|
||||
ADD_EXECUTABLE(export_client_files ${export_sources} ${export_headers})
|
||||
|
||||
INSTALL(TARGETS export_client_files RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX})
|
||||
|
||||
TARGET_LINK_LIBRARIES(export_client_files common debug ${MySQL_LIBRARY_DEBUG} optimized ${MySQL_LIBRARY_RELEASE} ${ZLIB_LIBRARY})
|
||||
|
||||
IF(MSVC)
|
||||
SET_TARGET_PROPERTIES(export_client_files PROPERTIES LINK_FLAGS_RELEASE "/OPT:REF /OPT:ICF")
|
||||
TARGET_LINK_LIBRARIES(export_client_files "Ws2_32.lib")
|
||||
ENDIF(MSVC)
|
||||
|
||||
IF(MINGW)
|
||||
TARGET_LINK_LIBRARIES(export_client_files "WS2_32")
|
||||
ENDIF(MINGW)
|
||||
|
||||
IF(UNIX)
|
||||
TARGET_LINK_LIBRARIES(export_client_files "${CMAKE_DL_LIBS}")
|
||||
TARGET_LINK_LIBRARIES(export_client_files "z")
|
||||
TARGET_LINK_LIBRARIES(export_client_files "m")
|
||||
IF(NOT DARWIN)
|
||||
TARGET_LINK_LIBRARIES(export_client_files "rt")
|
||||
ENDIF(NOT DARWIN)
|
||||
TARGET_LINK_LIBRARIES(export_client_files "pthread")
|
||||
ADD_DEFINITIONS(-fPIC)
|
||||
ENDIF(UNIX)
|
||||
|
||||
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
|
||||
@@ -0,0 +1,198 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2013 EQEMu Development Team (http://eqemulator.net)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY except by those people which sell it, which
|
||||
are required to give you total support for your newly bought product;
|
||||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "../../common/debug.h"
|
||||
#include "../../common/shareddb.h"
|
||||
#include "../../common/eqemu_config.h"
|
||||
#include "../../common/platform.h"
|
||||
#include "../../common/crash.h"
|
||||
#include "../../common/rulesys.h"
|
||||
#include "../../common/string_util.h"
|
||||
|
||||
void ExportSpells(SharedDatabase *db);
|
||||
void ExportSkillCaps(SharedDatabase *db);
|
||||
void ExportBaseData(SharedDatabase *db);
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
RegisterExecutablePlatform(ExePlatformClientExport);
|
||||
set_exception_handler();
|
||||
|
||||
LogFile->write(EQEMuLog::Status, "Client Files Export Utility");
|
||||
if(!EQEmuConfig::LoadConfig()) {
|
||||
LogFile->write(EQEMuLog::Error, "Unable to load configuration file.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
const EQEmuConfig *config = EQEmuConfig::get();
|
||||
if(!load_log_settings(config->LogSettingsFile.c_str())) {
|
||||
LogFile->write(EQEMuLog::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str());
|
||||
}
|
||||
|
||||
SharedDatabase database;
|
||||
LogFile->write(EQEMuLog::Status, "Connecting to database...");
|
||||
if(!database.Connect(config->DatabaseHost.c_str(), config->DatabaseUsername.c_str(),
|
||||
config->DatabasePassword.c_str(), config->DatabaseDB.c_str(), config->DatabasePort)) {
|
||||
LogFile->write(EQEMuLog::Error, "Unable to connect to the database, cannot continue without a "
|
||||
"database connection");
|
||||
return 1;
|
||||
}
|
||||
|
||||
ExportSpells(&database);
|
||||
ExportSkillCaps(&database);
|
||||
ExportBaseData(&database);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ExportSpells(SharedDatabase *db) {
|
||||
LogFile->write(EQEMuLog::Status, "Exporting Spells...");
|
||||
|
||||
FILE *f = fopen("export/spells_us.txt", "w");
|
||||
if(!f) {
|
||||
LogFile->write(EQEMuLog::Error, "Unable to open export/spells_us.txt to write, skipping.");
|
||||
return;
|
||||
}
|
||||
|
||||
const std::string query = "SELECT * FROM spells_new ORDER BY id";
|
||||
auto results = db->QueryDatabase(query);
|
||||
|
||||
if(results.Success()) {
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
std::string line;
|
||||
unsigned int fields = results.ColumnCount();
|
||||
for(unsigned int i = 0; i < fields; ++i) {
|
||||
if(i != 0) {
|
||||
line.push_back('^');
|
||||
}
|
||||
|
||||
if(row[i] != nullptr) {
|
||||
line += row[i];
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(f, "%s\n", line.c_str());
|
||||
}
|
||||
} else {
|
||||
LogFile->write(EQEMuLog::Error, "Error in ExportSpells query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
bool SkillUsable(SharedDatabase *db, int skill_id, int class_id) {
|
||||
|
||||
bool res = false;
|
||||
|
||||
std::string query = StringFormat("SELECT max(cap) FROM skill_caps WHERE class=%d AND skillID=%d",
|
||||
class_id, skill_id);
|
||||
auto results = db->QueryDatabase(query);
|
||||
if(!results.Success()) {
|
||||
LogFile->write(EQEMuLog::Error, "Error in skill_usable query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
if (results.RowCount() == 0)
|
||||
return false;
|
||||
|
||||
auto row = results.begin();
|
||||
if(row[0] && atoi(row[0]) > 0)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int GetSkill(SharedDatabase *db, int skill_id, int class_id, int level) {
|
||||
|
||||
std::string query = StringFormat("SELECT cap FROM skill_caps WHERE class=%d AND skillID=%d AND level=%d",
|
||||
class_id, skill_id, level);
|
||||
auto results = db->QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
LogFile->write(EQEMuLog::Error, "Error in get_skill query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (results.RowCount() == 0)
|
||||
return 0;
|
||||
|
||||
auto row = results.begin();
|
||||
return atoi(row[0]);
|
||||
}
|
||||
|
||||
void ExportSkillCaps(SharedDatabase *db) {
|
||||
LogFile->write(EQEMuLog::Status, "Exporting Skill Caps...");
|
||||
|
||||
FILE *f = fopen("export/SkillCaps.txt", "w");
|
||||
if(!f) {
|
||||
LogFile->write(EQEMuLog::Error, "Unable to open export/SkillCaps.txt to write, skipping.");
|
||||
return;
|
||||
}
|
||||
|
||||
for(int cl = 1; cl <= 16; ++cl) {
|
||||
for(int skill = 0; skill <= 77; ++skill) {
|
||||
if(SkillUsable(db, skill, cl)) {
|
||||
int previous_cap = 0;
|
||||
for(int level = 1; level <= 100; ++level) {
|
||||
int cap = GetSkill(db, skill, cl, level);
|
||||
if(cap < previous_cap) {
|
||||
cap = previous_cap;
|
||||
}
|
||||
|
||||
fprintf(f, "%d^%d^%d^%d^0\n", cl, skill, level, cap);
|
||||
previous_cap = cap;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
void ExportBaseData(SharedDatabase *db) {
|
||||
LogFile->write(EQEMuLog::Status, "Exporting Base Data...");
|
||||
|
||||
FILE *f = fopen("export/BaseData.txt", "w");
|
||||
if(!f) {
|
||||
LogFile->write(EQEMuLog::Error, "Unable to open export/BaseData.txt to write, skipping.");
|
||||
return;
|
||||
}
|
||||
|
||||
const std::string query = "SELECT * FROM base_data ORDER BY level, class";
|
||||
auto results = db->QueryDatabase(query);
|
||||
if(results.Success()) {
|
||||
for (auto row = results.begin();row != results.end();++row) {
|
||||
std::string line;
|
||||
unsigned int fields = results.ColumnCount();
|
||||
for(unsigned int rowIndex = 0; rowIndex < fields; ++rowIndex) {
|
||||
if(rowIndex != 0)
|
||||
line.push_back('^');
|
||||
|
||||
if(row[rowIndex] != nullptr) {
|
||||
line += row[rowIndex];
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(f, "%s\n", line.c_str());
|
||||
}
|
||||
} else {
|
||||
LogFile->write(EQEMuLog::Error, "Error in ExportBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
||||
|
||||
SET(import_sources
|
||||
main.cpp
|
||||
)
|
||||
|
||||
SET(import_headers
|
||||
)
|
||||
|
||||
ADD_EXECUTABLE(import_client_files ${import_sources} ${import_headers})
|
||||
|
||||
INSTALL(TARGETS import_client_files RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX})
|
||||
|
||||
TARGET_LINK_LIBRARIES(import_client_files common debug ${MySQL_LIBRARY_DEBUG} optimized ${MySQL_LIBRARY_RELEASE} ${ZLIB_LIBRARY})
|
||||
|
||||
IF(MSVC)
|
||||
SET_TARGET_PROPERTIES(import_client_files PROPERTIES LINK_FLAGS_RELEASE "/OPT:REF /OPT:ICF")
|
||||
TARGET_LINK_LIBRARIES(import_client_files "Ws2_32.lib")
|
||||
ENDIF(MSVC)
|
||||
|
||||
IF(MINGW)
|
||||
TARGET_LINK_LIBRARIES(import_client_files "WS2_32")
|
||||
ENDIF(MINGW)
|
||||
|
||||
IF(UNIX)
|
||||
TARGET_LINK_LIBRARIES(import_client_files "${CMAKE_DL_LIBS}")
|
||||
TARGET_LINK_LIBRARIES(import_client_files "z")
|
||||
TARGET_LINK_LIBRARIES(import_client_files "m")
|
||||
IF(NOT DARWIN)
|
||||
TARGET_LINK_LIBRARIES(import_client_files "rt")
|
||||
ENDIF(NOT DARWIN)
|
||||
TARGET_LINK_LIBRARIES(import_client_files "pthread")
|
||||
ADD_DEFINITIONS(-fPIC)
|
||||
ENDIF(UNIX)
|
||||
|
||||
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
|
||||
@@ -0,0 +1,231 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2013 EQEMu Development Team (http://eqemulator.net)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY except by those people which sell it, which
|
||||
are required to give you total support for your newly bought product;
|
||||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "../../common/debug.h"
|
||||
#include "../../common/shareddb.h"
|
||||
#include "../../common/eqemu_config.h"
|
||||
#include "../../common/platform.h"
|
||||
#include "../../common/crash.h"
|
||||
#include "../../common/rulesys.h"
|
||||
#include "../../common/string_util.h"
|
||||
|
||||
void ImportSpells(SharedDatabase *db);
|
||||
void ImportSkillCaps(SharedDatabase *db);
|
||||
void ImportBaseData(SharedDatabase *db);
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
RegisterExecutablePlatform(ExePlatformClientImport);
|
||||
set_exception_handler();
|
||||
|
||||
LogFile->write(EQEMuLog::Status, "Client Files Import Utility");
|
||||
if(!EQEmuConfig::LoadConfig()) {
|
||||
LogFile->write(EQEMuLog::Error, "Unable to load configuration file.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
const EQEmuConfig *config = EQEmuConfig::get();
|
||||
if(!load_log_settings(config->LogSettingsFile.c_str())) {
|
||||
LogFile->write(EQEMuLog::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str());
|
||||
}
|
||||
|
||||
SharedDatabase database;
|
||||
LogFile->write(EQEMuLog::Status, "Connecting to database...");
|
||||
if(!database.Connect(config->DatabaseHost.c_str(), config->DatabaseUsername.c_str(),
|
||||
config->DatabasePassword.c_str(), config->DatabaseDB.c_str(), config->DatabasePort)) {
|
||||
LogFile->write(EQEMuLog::Error, "Unable to connect to the database, cannot continue without a "
|
||||
"database connection");
|
||||
return 1;
|
||||
}
|
||||
|
||||
ImportSpells(&database);
|
||||
ImportSkillCaps(&database);
|
||||
ImportBaseData(&database);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int GetSpellColumns(SharedDatabase *db) {
|
||||
|
||||
const std::string query = "DESCRIBE spells_new";
|
||||
auto results = db->QueryDatabase(query);
|
||||
if(!results.Success()) {
|
||||
LogFile->write(EQEMuLog::Error, "Error in GetSpellColumns query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
|
||||
return 0;
|
||||
}
|
||||
|
||||
return results.RowCount();
|
||||
}
|
||||
|
||||
void ImportSpells(SharedDatabase *db) {
|
||||
LogFile->write(EQEMuLog::Status, "Importing Spells...");
|
||||
FILE *f = fopen("import/spells_us.txt", "r");
|
||||
if(!f) {
|
||||
LogFile->write(EQEMuLog::Error, "Unable to open import/spells_us.txt to read, skipping.");
|
||||
return;
|
||||
}
|
||||
|
||||
std::string query = "DELETE FROM spells_new";
|
||||
db->QueryDatabase(query);
|
||||
|
||||
int columns = GetSpellColumns(db);
|
||||
int spells_imported = 0;
|
||||
|
||||
char buffer[2048];
|
||||
while(fgets(buffer, 2048, f)) {
|
||||
for(int i = 0; i < 2048; ++i) {
|
||||
if(buffer[i] == '\n') {
|
||||
buffer[i] = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
std::string escaped = ::EscapeString(buffer);
|
||||
auto split = SplitString(escaped, '^');
|
||||
int line_columns = (int)split.size();
|
||||
|
||||
std::string sql;
|
||||
if(line_columns >= columns) {
|
||||
sql = "INSERT INTO spells_new VALUES(";
|
||||
for(int i = 0; i < columns; ++i) {
|
||||
if(i != 0) {
|
||||
sql += ", '";
|
||||
} else {
|
||||
sql += "'";
|
||||
}
|
||||
|
||||
sql += split[i];
|
||||
sql += "'";
|
||||
}
|
||||
|
||||
sql += ");";
|
||||
} else {
|
||||
int i = 0;
|
||||
sql = "INSERT INTO spells_new VALUES(";
|
||||
for(; i < line_columns; ++i) {
|
||||
if(i != 0) {
|
||||
sql += ", '";
|
||||
} else {
|
||||
sql += "'";
|
||||
}
|
||||
|
||||
sql += split[i];
|
||||
sql += "'";
|
||||
}
|
||||
|
||||
for(; i < columns; ++i) {
|
||||
sql += ", '0'";
|
||||
}
|
||||
|
||||
sql += ");";
|
||||
}
|
||||
|
||||
db->QueryDatabase(sql);
|
||||
|
||||
spells_imported++;
|
||||
if(spells_imported % 1000 == 0) {
|
||||
LogFile->write(EQEMuLog::Status, "%d spells imported.", spells_imported);
|
||||
}
|
||||
}
|
||||
|
||||
if(spells_imported % 1000 != 0) {
|
||||
LogFile->write(EQEMuLog::Status, "%d spells imported.", spells_imported);
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
void ImportSkillCaps(SharedDatabase *db) {
|
||||
LogFile->write(EQEMuLog::Status, "Importing Skill Caps...");
|
||||
|
||||
FILE *f = fopen("import/SkillCaps.txt", "r");
|
||||
if(!f) {
|
||||
LogFile->write(EQEMuLog::Error, "Unable to open import/SkillCaps.txt to read, skipping.");
|
||||
return;
|
||||
}
|
||||
|
||||
std::string delete_sql = "DELETE FROM skill_caps";
|
||||
db->QueryDatabase(delete_sql);
|
||||
|
||||
char buffer[2048];
|
||||
while(fgets(buffer, 2048, f)) {
|
||||
auto split = SplitString(buffer, '^');
|
||||
|
||||
if(split.size() < 4) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
int class_id, skill_id, level, cap;
|
||||
class_id = atoi(split[0].c_str());
|
||||
skill_id = atoi(split[1].c_str());
|
||||
level = atoi(split[2].c_str());
|
||||
cap = atoi(split[3].c_str());
|
||||
|
||||
std::string sql = StringFormat("INSERT INTO skill_caps(class, skillID, level, cap) VALUES(%d, %d, %d, %d)",
|
||||
class_id, skill_id, level, cap);
|
||||
|
||||
db->QueryDatabase(sql);
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
void ImportBaseData(SharedDatabase *db) {
|
||||
LogFile->write(EQEMuLog::Status, "Importing Base Data...");
|
||||
|
||||
FILE *f = fopen("import/BaseData.txt", "r");
|
||||
if(!f) {
|
||||
LogFile->write(EQEMuLog::Error, "Unable to open import/BaseData.txt to read, skipping.");
|
||||
return;
|
||||
}
|
||||
|
||||
std::string delete_sql = "DELETE FROM base_data";
|
||||
db->QueryDatabase(delete_sql);
|
||||
|
||||
char buffer[2048];
|
||||
while(fgets(buffer, 2048, f)) {
|
||||
auto split = SplitString(buffer, '^');
|
||||
|
||||
if(split.size() < 10) {
|
||||
continue;
|
||||
}
|
||||
|
||||
std::string sql;
|
||||
int level, class_id;
|
||||
double hp, mana, end, unk1, unk2, hp_fac, mana_fac, end_fac;
|
||||
|
||||
level = atoi(split[0].c_str());
|
||||
class_id = atoi(split[1].c_str());
|
||||
hp = atof(split[2].c_str());
|
||||
mana = atof(split[3].c_str());
|
||||
end = atof(split[4].c_str());
|
||||
unk1 = atof(split[5].c_str());
|
||||
unk2 = atof(split[6].c_str());
|
||||
hp_fac = atof(split[7].c_str());
|
||||
mana_fac = atof(split[8].c_str());
|
||||
end_fac = atof(split[9].c_str());
|
||||
|
||||
sql = StringFormat("INSERT INTO base_data(level, class, hp, mana, end, unk1, unk2, hp_fac, "
|
||||
"mana_fac, end_fac) VALUES(%d, %d, %f, %f, %f, %f, %f, %f, %f, %f)",
|
||||
level, class_id, hp, mana, end, unk1, unk2, hp_fac, mana_fac, end_fac);
|
||||
|
||||
db->QueryDatabase(sql);
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
#CMake - Cross Platform Makefile Generator
|
||||
#Copyright 2000-2011 Kitware, Inc., Insight Software Consortium
|
||||
#All rights reserved.
|
||||
#
|
||||
#Redistribution and use in source and binary forms, with or without
|
||||
#modification, are permitted provided that the following conditions
|
||||
#are met:
|
||||
#
|
||||
#* Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
#* Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
#* Neither the names of Kitware, Inc., the Insight Software Consortium,
|
||||
# nor the names of their contributors may be used to endorse or promote
|
||||
# products derived from this software without specific prior written
|
||||
# permission.
|
||||
#
|
||||
#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
#A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
#HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
#SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
#LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
#DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
#THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
#(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
#OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# This module defines
|
||||
# LUA51_FOUND, if false, do not try to link to Lua
|
||||
# LUA_LIBRARIES
|
||||
# LUA_INCLUDE_DIR, where to find lua.h
|
||||
# LUA_VERSION_STRING, the version of Lua found (since CMake 2.8.8)
|
||||
|
||||
IF(LUA_ROOT)
|
||||
FIND_PATH(LUA_INCLUDE_DIR
|
||||
NAMES lua.h
|
||||
HINTS
|
||||
ENV LUA_DIR
|
||||
PATHS
|
||||
${LUA_ROOT}
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/sw
|
||||
/opt/local
|
||||
/opt/csw
|
||||
/opt
|
||||
PATH_SUFFIXES include/lua51 include/lua5.1 include/lua include src
|
||||
)
|
||||
|
||||
FIND_LIBRARY(LUA_LIBRARY
|
||||
NAMES lua51 lua5.1 lua-5.1 lua
|
||||
HINTS
|
||||
ENV LUA_DIR
|
||||
PATHS
|
||||
${LUA_ROOT}
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/sw
|
||||
/opt/local
|
||||
/opt/csw
|
||||
/opt
|
||||
PATH_SUFFIXES lib bin
|
||||
)
|
||||
ELSE(LUA_ROOT)
|
||||
FIND_PATH(LUA_INCLUDE_DIR
|
||||
NAMES lua.h
|
||||
HINTS
|
||||
ENV LUA_DIR
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/sw
|
||||
/opt/local
|
||||
/opt/csw
|
||||
/opt
|
||||
PATH_SUFFIXES include/lua51 include/lua5.1 include/lua include
|
||||
)
|
||||
|
||||
FIND_LIBRARY(LUA_LIBRARY
|
||||
NAMES lua51 lua5.1 lua-5.1 lua
|
||||
HINTS
|
||||
ENV LUA_DIR
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/sw
|
||||
/opt/local
|
||||
/opt/csw
|
||||
/opt
|
||||
PATH_SUFFIXES lib bin
|
||||
)
|
||||
ENDIF(LUA_ROOT)
|
||||
|
||||
IF(LUA_LIBRARY)
|
||||
# include the math library for Unix
|
||||
IF(UNIX AND NOT APPLE)
|
||||
FIND_LIBRARY(LUA_MATH_LIBRARY m)
|
||||
SET(LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}" CACHE STRING "Lua Libraries")
|
||||
# For Windows and Mac, don't need to explicitly include the math library
|
||||
ELSE()
|
||||
SET( LUA_LIBRARIES "${LUA_LIBRARY}" CACHE STRING "Lua Libraries")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
|
||||
FILE(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_str REGEX "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua .+\"")
|
||||
|
||||
STRING(REGEX REPLACE "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([^\"]+)\".*" "\\1" LUA_VERSION_STRING "${lua_version_str}")
|
||||
UNSET(lua_version_str)
|
||||
ENDIF()
|
||||
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua51
|
||||
REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
|
||||
VERSION_VAR LUA_VERSION_STRING)
|
||||
|
||||
MARK_AS_ADVANCED(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY)
|
||||
|
||||
|
||||
+146
-127
@@ -1,52 +1,55 @@
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
||||
|
||||
SET(common_sources
|
||||
BasePacket.cpp
|
||||
base_packet.cpp
|
||||
classes.cpp
|
||||
Condition.cpp
|
||||
condition.cpp
|
||||
crash.cpp
|
||||
CRC16.cpp
|
||||
crc16.cpp
|
||||
crc32.cpp
|
||||
database.cpp
|
||||
dbasync.cpp
|
||||
dbcore.cpp
|
||||
debug.cpp
|
||||
emu_opcodes.cpp
|
||||
EmuTCPConnection.cpp
|
||||
EmuTCPServer.cpp
|
||||
EQDB.cpp
|
||||
EQDBRes.cpp
|
||||
emu_tcp_connection.cpp
|
||||
emu_tcp_server.cpp
|
||||
eq_dictionary.cpp
|
||||
eqdb.cpp
|
||||
eqdb_res.cpp
|
||||
eqemu_exception.cpp
|
||||
EQEmuConfig.cpp
|
||||
EQEMuError.cpp
|
||||
EQPacket.cpp
|
||||
EQStream.cpp
|
||||
EQStreamFactory.cpp
|
||||
EQStreamIdent.cpp
|
||||
EQStreamProxy.cpp
|
||||
eqemu_config.cpp
|
||||
eqemu_error.cpp
|
||||
eq_packet.cpp
|
||||
eq_stream.cpp
|
||||
eq_stream_factory.cpp
|
||||
eq_stream_ident.cpp
|
||||
eq_stream_proxy.cpp
|
||||
eqtime.cpp
|
||||
extprofile.cpp
|
||||
faction.cpp
|
||||
guild_base.cpp
|
||||
guilds.cpp
|
||||
ipc_mutex.cpp
|
||||
Item.cpp
|
||||
item.cpp
|
||||
logsys.cpp
|
||||
logsys_eqemu.cpp
|
||||
md5.cpp
|
||||
memory_mapped_file.cpp
|
||||
misc.cpp
|
||||
MiscFunctions.cpp
|
||||
misc_functions.cpp
|
||||
moremath.cpp
|
||||
Mutex.cpp
|
||||
mutex.cpp
|
||||
mysql_request_result.cpp
|
||||
mysql_request_row.cpp
|
||||
opcode_map.cpp
|
||||
opcodemgr.cpp
|
||||
packet_dump.cpp
|
||||
packet_dump_file.cpp
|
||||
packet_functions.cpp
|
||||
perl_EQDB.cpp
|
||||
perl_EQDBRes.cpp
|
||||
ProcLauncher.cpp
|
||||
perl_eqdb.cpp
|
||||
perl_eqdb_res.cpp
|
||||
proc_launcher.cpp
|
||||
ptimer.cpp
|
||||
races.cpp
|
||||
rdtsc.cpp
|
||||
@@ -54,23 +57,23 @@ SET(common_sources
|
||||
serverinfo.cpp
|
||||
shareddb.cpp
|
||||
spdat.cpp
|
||||
StringUtil.cpp
|
||||
StructStrategy.cpp
|
||||
TCPConnection.cpp
|
||||
TCPServer.cpp
|
||||
string_util.cpp
|
||||
struct_strategy.cpp
|
||||
tcp_connection.cpp
|
||||
tcp_server.cpp
|
||||
timeoutmgr.cpp
|
||||
timer.cpp
|
||||
unix.cpp
|
||||
worldconn.cpp
|
||||
XMLParser.cpp
|
||||
xml_parser.cpp
|
||||
platform.cpp
|
||||
patches/Client62.cpp
|
||||
patches/client62.cpp
|
||||
patches/patches.cpp
|
||||
patches/SoD.cpp
|
||||
patches/SoF.cpp
|
||||
patches/RoF.cpp
|
||||
patches/Titanium.cpp
|
||||
patches/Underfoot.cpp
|
||||
patches/sod.cpp
|
||||
patches/sof.cpp
|
||||
patches/rof.cpp
|
||||
patches/titanium.cpp
|
||||
patches/underfoot.cpp
|
||||
SocketLib/Base64.cpp
|
||||
SocketLib/File.cpp
|
||||
SocketLib/HttpdCookies.cpp
|
||||
@@ -90,14 +93,15 @@ SET(common_sources
|
||||
)
|
||||
|
||||
SET(common_headers
|
||||
BasePacket.h
|
||||
any.h
|
||||
base_packet.h
|
||||
base_data.h
|
||||
bodytypes.h
|
||||
breakdowns.h
|
||||
classes.h
|
||||
common_profile.h
|
||||
Condition.h
|
||||
condition.h
|
||||
crash.h
|
||||
CRC16.h
|
||||
crc16.h
|
||||
crc32.h
|
||||
database.h
|
||||
dbasync.h
|
||||
@@ -106,24 +110,25 @@ SET(common_headers
|
||||
deity.h
|
||||
emu_opcodes.h
|
||||
emu_oplist.h
|
||||
EmuTCPConnection.h
|
||||
EmuTCPServer.h
|
||||
emu_tcp_connection.h
|
||||
emu_tcp_server.h
|
||||
eq_constants.h
|
||||
eq_dictionary.h
|
||||
eq_packet_structs.h
|
||||
EQDB.h
|
||||
EQDBRes.h
|
||||
eqdb.h
|
||||
eqdb_res.h
|
||||
eqemu_exception.h
|
||||
EQEmuConfig.h
|
||||
EQEmuConfig_elements.h
|
||||
EQEMuError.h
|
||||
EQPacket.h
|
||||
EQStream.h
|
||||
EQStreamFactory.h
|
||||
EQStreamIdent.h
|
||||
EQStreamIntf.h
|
||||
EQStreamLocator.h
|
||||
EQStreamProxy.h
|
||||
EQStreamType.h
|
||||
eqemu_config.h
|
||||
eqemu_config_elements.h
|
||||
eqemu_error.h
|
||||
eq_packet.h
|
||||
eq_stream.h
|
||||
eq_stream_factory.h
|
||||
eq_stream_ident.h
|
||||
eq_stream_intf.h
|
||||
eq_stream_locator.h
|
||||
eq_stream_proxy.h
|
||||
eq_stream_type.h
|
||||
eqtime.h
|
||||
errmsg.h
|
||||
extprofile.h
|
||||
@@ -134,7 +139,7 @@ SET(common_headers
|
||||
guild_base.h
|
||||
guilds.h
|
||||
ipc_mutex.h
|
||||
Item.h
|
||||
item.h
|
||||
item_fieldlist.h
|
||||
item_struct.h
|
||||
languages.h
|
||||
@@ -146,16 +151,19 @@ SET(common_headers
|
||||
md5.h
|
||||
memory_mapped_file.h
|
||||
misc.h
|
||||
MiscFunctions.h
|
||||
misc_functions.h
|
||||
moremath.h
|
||||
Mutex.h
|
||||
mutex.h
|
||||
mysql_request_result.h
|
||||
mysql_request_row.h
|
||||
op_codes.h
|
||||
opcode_dispatch.h
|
||||
opcodemgr.h
|
||||
packet_dump.h
|
||||
packet_dump_file.h
|
||||
packet_functions.h
|
||||
ProcLauncher.h
|
||||
platform.h
|
||||
proc_launcher.h
|
||||
profiler.h
|
||||
ptimer.h
|
||||
queue.h
|
||||
@@ -169,11 +177,11 @@ SET(common_headers
|
||||
shareddb.h
|
||||
skills.h
|
||||
spdat.h
|
||||
StringUtil.h
|
||||
StructStrategy.h
|
||||
TCPBasicServer.h
|
||||
TCPConnection.h
|
||||
TCPServer.h
|
||||
string_util.h
|
||||
struct_strategy.h
|
||||
tcp_basic_server.h
|
||||
tcp_connection.h
|
||||
tcp_server.h
|
||||
timeoutmgr.h
|
||||
timer.h
|
||||
types.h
|
||||
@@ -181,38 +189,43 @@ SET(common_headers
|
||||
useperl.h
|
||||
version.h
|
||||
worldconn.h
|
||||
XMLParser.h
|
||||
ZoneNumbers.h
|
||||
platform.h
|
||||
patches/Client62.h
|
||||
patches/Client62_itemfields.h
|
||||
patches/Client62_ops.h
|
||||
patches/Client62_structs.h
|
||||
xml_parser.h
|
||||
zone_numbers.h
|
||||
patches/client62.h
|
||||
patches/client62_constants.h
|
||||
patches/client62_itemfields.h
|
||||
patches/client62_ops.h
|
||||
patches/client62_structs.h
|
||||
patches/patches.h
|
||||
patches/SoD.h
|
||||
patches/SoD_itemfields.h
|
||||
patches/SoD_ops.h
|
||||
patches/SoD_structs.h
|
||||
patches/SoF.h
|
||||
patches/SoF_itemfields.h
|
||||
patches/SoF_opcode_list.h
|
||||
patches/SoF_ops.h
|
||||
patches/SoF_structs.h
|
||||
patches/SSDeclare.h
|
||||
patches/SSDefine.h
|
||||
patches/SSRegister.h
|
||||
patches/RoF.h
|
||||
patches/RoF_itemfields.h
|
||||
patches/RoF_ops.h
|
||||
patches/RoF_structs.h
|
||||
patches/Titanium.h
|
||||
patches/Titanium_itemfields.h
|
||||
patches/Titanium_ops.h
|
||||
patches/Titanium_structs.h
|
||||
patches/Underfoot.h
|
||||
patches/Underfoot_itemfields.h
|
||||
patches/Underfoot_ops.h
|
||||
patches/Underfoot_structs.h
|
||||
patches/sod.h
|
||||
patches/sod_constants.h
|
||||
patches/sod_itemfields.h
|
||||
patches/sod_ops.h
|
||||
patches/sod_structs.h
|
||||
patches/sof.h
|
||||
patches/sof_constants.h
|
||||
patches/sof_itemfields.h
|
||||
patches/sof_opcode_list.h
|
||||
patches/sof_ops.h
|
||||
patches/sof_structs.h
|
||||
patches/ss_declare.h
|
||||
patches/ss_define.h
|
||||
patches/ss_register.h
|
||||
patches/rof.h
|
||||
patches/rof_constants.h
|
||||
patches/rof_itemfields.h
|
||||
patches/rof_ops.h
|
||||
patches/rof_structs.h
|
||||
patches/titanium.h
|
||||
patches/titanium_constants.h
|
||||
patches/titanium_itemfields.h
|
||||
patches/titanium_ops.h
|
||||
patches/titanium_structs.h
|
||||
patches/underfoot.h
|
||||
patches/underfoot_constants.h
|
||||
patches/underfoot_itemfields.h
|
||||
patches/underfoot_ops.h
|
||||
patches/underfoot_structs.h
|
||||
SocketLib/Base64.h
|
||||
SocketLib/File.h
|
||||
SocketLib/HttpdCookies.h
|
||||
@@ -231,42 +244,48 @@ SET(common_headers
|
||||
)
|
||||
|
||||
SOURCE_GROUP(Patches FILES
|
||||
patches/Client62.h
|
||||
patches/Client62_itemfields.h
|
||||
patches/Client62_ops.h
|
||||
patches/Client62_structs.h
|
||||
patches/client62.h
|
||||
patches/client62_itemfields.h
|
||||
patches/client62_ops.h
|
||||
patches/client62_constants.h
|
||||
patches/client62_structs.h
|
||||
patches/patches.h
|
||||
patches/SoD.h
|
||||
patches/SoD_itemfields.h
|
||||
patches/SoD_ops.h
|
||||
patches/SoD_structs.h
|
||||
patches/SoF.h
|
||||
patches/SoF_itemfields.h
|
||||
patches/SoF_opcode_list.h
|
||||
patches/SoF_ops.h
|
||||
patches/SoF_structs.h
|
||||
patches/SSDeclare.h
|
||||
patches/SSDefine.h
|
||||
patches/SSRegister.h
|
||||
patches/RoF.h
|
||||
patches/RoF_itemfields.h
|
||||
patches/RoF_ops.h
|
||||
patches/RoF_structs.h
|
||||
patches/Titanium.h
|
||||
patches/Titanium_itemfields.h
|
||||
patches/Titanium_ops.h
|
||||
patches/Titanium_structs.h
|
||||
patches/Underfoot.h
|
||||
patches/Underfoot_itemfields.h
|
||||
patches/Underfoot_ops.h
|
||||
patches/Underfoot_structs.h
|
||||
patches/Client62.cpp
|
||||
patches/sod.h
|
||||
patches/sod_itemfields.h
|
||||
patches/sod_ops.h
|
||||
patches/sod_constants.h
|
||||
patches/sod_structs.h
|
||||
patches/sof.h
|
||||
patches/sof_itemfields.h
|
||||
patches/sof_opcode_list.h
|
||||
patches/sof_ops.h
|
||||
patches/sof_constants.h
|
||||
patches/sof_structs.h
|
||||
patches/ss_declare.h
|
||||
patches/ss_define.h
|
||||
patches/ss_register.h
|
||||
patches/rof.h
|
||||
patches/rof_itemfields.h
|
||||
patches/rof_ops.h
|
||||
patches/rof_constants.h
|
||||
patches/rof_structs.h
|
||||
patches/titanium.h
|
||||
patches/titanium_itemfields.h
|
||||
patches/titanium_ops.h
|
||||
patches/titanium_constants.h
|
||||
patches/titanium_structs.h
|
||||
patches/underfoot.h
|
||||
patches/underfoot_itemfields.h
|
||||
patches/underfoot_ops.h
|
||||
patches/underfoot_constants.h
|
||||
patches/underfoot_structs.h
|
||||
patches/client62.cpp
|
||||
patches/patches.cpp
|
||||
patches/SoD.cpp
|
||||
patches/SoF.cpp
|
||||
patches/RoF.cpp
|
||||
patches/Titanium.cpp
|
||||
patches/Underfoot.cpp
|
||||
patches/sod.cpp
|
||||
patches/sof.cpp
|
||||
patches/rof.cpp
|
||||
patches/titanium.cpp
|
||||
patches/underfoot.cpp
|
||||
)
|
||||
|
||||
SOURCE_GROUP(SocketLib FILES
|
||||
@@ -311,11 +330,11 @@ SOURCE_GROUP(TinyXML FILES
|
||||
|
||||
INCLUDE_DIRECTORIES(Patches SocketLib StackWalker TinyXML)
|
||||
|
||||
ADD_LIBRARY(Common ${common_sources} ${common_headers})
|
||||
ADD_LIBRARY(common ${common_sources} ${common_headers})
|
||||
|
||||
IF(UNIX)
|
||||
ADD_DEFINITIONS(-fPIC)
|
||||
SET_SOURCE_FILES_PROPERTIES("patches/SoD.cpp" "patches/SoF.cpp" "patches/RoF.cpp" "patches/Underfoot.cpp" PROPERTIES COMPILE_FLAGS -O0)
|
||||
SET_SOURCE_FILES_PROPERTIES("patches/sod.cpp" "patches/sof.cpp" "patches/rof.cpp" "patches/underfoot.cpp" PROPERTIES COMPILE_FLAGS -O0)
|
||||
ENDIF(UNIX)
|
||||
|
||||
SET(LIBRARY_OUTPUT_PATH ../Bin)
|
||||
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
|
||||
|
||||
@@ -1,412 +0,0 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY except by those people which sell it, which
|
||||
are required to give you total support for your newly bought product;
|
||||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
/*
|
||||
* EQStream classes, by Quagmire
|
||||
*/
|
||||
|
||||
#include "../common/debug.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#ifdef WIN32
|
||||
#include <process.h>
|
||||
#else
|
||||
#include <arpa/inet.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <pthread.h>
|
||||
#include "../common/unix.h"
|
||||
#define SOCKET_ERROR -1
|
||||
#endif
|
||||
#include "EQNetwork.h"
|
||||
#include "EQStream.h"
|
||||
#include "../common/packet_dump.h"
|
||||
#include "../common/packet_dump_file.h"
|
||||
#include "../common/packet_functions.h"
|
||||
#include "../common/MiscFunctions.h"
|
||||
#include "../common/crc32.h"
|
||||
#include "../common/eq_packet_structs.h"
|
||||
|
||||
#define EQN_DEBUG 0
|
||||
#define EQN_DEBUG_Error 0
|
||||
#define EQN_DEBUG_Packet 0
|
||||
#define EQN_DEBUG_Fragment 0
|
||||
#define EQN_DEBUG_ACK 0
|
||||
#define EQN_DEBUG_Unknown 0
|
||||
#define EQN_DEBUG_NewStream 0
|
||||
#define LOG_PACKETS 0
|
||||
#define LOG_RAW_PACKETS_OUT 0
|
||||
#define LOG_RAW_PACKETS_IN 0
|
||||
//#define PRIORITYTEST
|
||||
|
||||
template <typename type> // LO_BYTE
|
||||
type LO_BYTE (type a) {return (a&=0xff);}
|
||||
template <typename type> // HI_BYTE
|
||||
type HI_BYTE (type a) {return (a&=0xff00);}
|
||||
template <typename type> // LO_WORD
|
||||
type LO_WORD (type a) {return (a&=0xffff);}
|
||||
template <typename type> // HI_WORD
|
||||
type HI_WORD (type a) {return (a&=0xffff0000);}
|
||||
template <typename type> // HI_LOSWAPshort
|
||||
type HI_LOSWAPshort (type a) {return (LO_BYTE(a)<<8) | (HI_BYTE(a)>>8);}
|
||||
template <typename type> // HI_LOSWAPlong
|
||||
type HI_LOSWAPlong (type x) {return (LO_WORD(a)<<16) | (HIWORD(a)>>16);}
|
||||
|
||||
EQStreamServer::EQStreamServer(uint16 iPort) {
|
||||
RunLoop = false;
|
||||
pPort = iPort;
|
||||
pOpen = false;
|
||||
#ifdef WIN32
|
||||
WORD version = MAKEWORD (1,1);
|
||||
WSADATA wsadata;
|
||||
WSAStartup (version, &wsadata);
|
||||
#endif
|
||||
sock = 0;
|
||||
}
|
||||
|
||||
EQStreamServer::~EQStreamServer() {
|
||||
Close();
|
||||
RunLoop = false;
|
||||
MLoopRunning.lock();
|
||||
MLoopRunning.unlock();
|
||||
#ifdef WIN32
|
||||
WSACleanup();
|
||||
#endif
|
||||
connection_list.clear();
|
||||
while (!NewQueue.empty())
|
||||
NewQueue.pop(); // they're deleted with the list, clear this queue so it doesnt try to delete them again
|
||||
}
|
||||
|
||||
bool EQStreamServer::Open(uint16 iPort) {
|
||||
LockMutex lock(&MOpen);
|
||||
if (iPort && pPort != iPort) {
|
||||
if (pOpen)
|
||||
return false;
|
||||
pPort = iPort;
|
||||
}
|
||||
if (!RunLoop) {
|
||||
RunLoop = true;
|
||||
#ifdef WIN32
|
||||
_beginthread(EQStreamServerLoop, 0, this);
|
||||
#else
|
||||
pthread_t thread;
|
||||
pthread_create(&thread, NULL, &EQStreamServerLoop, this);
|
||||
#endif
|
||||
}
|
||||
if (pOpen) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
struct sockaddr_in address;
|
||||
// int reuse_addr = 1;
|
||||
int bufsize = 64 * 1024; // 64kbyte send/recieve buffers, up from default of 8k
|
||||
#ifdef WIN32
|
||||
unsigned long nonblocking = 1;
|
||||
#endif
|
||||
|
||||
/* Setup internet address information.
|
||||
This is used with the bind() call */
|
||||
memset((char *) &address, 0, sizeof(address));
|
||||
address.sin_family = AF_INET;
|
||||
address.sin_port = htons(pPort);
|
||||
address.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||
|
||||
/* Setting up UDP port for new clients */
|
||||
sock = socket(AF_INET, SOCK_DGRAM, 0);
|
||||
if (sock < 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//#ifdef WIN32
|
||||
// setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *) &reuse_addr, sizeof(reuse_addr));
|
||||
setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (char*) &bufsize, sizeof(bufsize));
|
||||
setsockopt(sock, SOL_SOCKET, SO_SNDBUF, (char*) &bufsize, sizeof(bufsize));
|
||||
//#else
|
||||
// setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &reuse_addr, sizeof(reuse_addr));
|
||||
// setsockopt(sock, SOL_SOCKET, SO_RCVBUF, &bufsize, sizeof(bufsize));
|
||||
// setsockopt(sock, SOL_SOCKET, SO_SNDBUF, &bufsize, sizeof(bufsize));
|
||||
//#endif
|
||||
|
||||
if (bind(sock, (struct sockaddr *) &address, sizeof(address)) < 0) {
|
||||
#ifdef WIN32
|
||||
closesocket(sock);
|
||||
#else
|
||||
close(sock);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
ioctlsocket (sock, FIONBIO, &nonblocking);
|
||||
#else
|
||||
fcntl(sock, F_SETFL, O_NONBLOCK);
|
||||
#endif
|
||||
pOpen = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
void EQStreamServer::Close() {
|
||||
SetOpen(false);
|
||||
if (sock) {
|
||||
#ifdef WIN32
|
||||
closesocket(sock);
|
||||
#else
|
||||
close(sock);
|
||||
#endif
|
||||
}
|
||||
sock = 0;
|
||||
}
|
||||
|
||||
bool EQStreamServer::IsOpen() {
|
||||
MOpen.lock();
|
||||
bool ret = pOpen;
|
||||
MOpen.unlock();
|
||||
return ret;
|
||||
}
|
||||
|
||||
void EQStreamServer::SetOpen(bool iOpen) {
|
||||
MOpen.lock();
|
||||
pOpen = iOpen;
|
||||
MOpen.unlock();
|
||||
}
|
||||
|
||||
void EQStreamServer::Process() {
|
||||
_CP(EQStreamServer_Process);
|
||||
if (!IsOpen()) {
|
||||
if (sock) {
|
||||
#ifdef WIN32
|
||||
closesocket(sock);
|
||||
#else
|
||||
close(sock);
|
||||
#endif
|
||||
sock = 0;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
uchar buffer[1518];
|
||||
|
||||
int status;
|
||||
struct sockaddr_in from;
|
||||
unsigned int fromlen;
|
||||
|
||||
from.sin_family = AF_INET;
|
||||
fromlen = sizeof(from);
|
||||
|
||||
while (1) {
|
||||
#ifdef WIN32
|
||||
status = recvfrom(sock, (char *) buffer, sizeof(buffer), 0,(struct sockaddr*) &from, (int *) &fromlen);
|
||||
#else
|
||||
status = recvfrom(sock, buffer, sizeof(buffer), 0,(struct sockaddr*) &from, &fromlen);
|
||||
#endif
|
||||
if (status >= 1) {
|
||||
cout << "Got data from recvfrom" << endl;
|
||||
RecvData(buffer, status, from.sin_addr.s_addr, from.sin_port);
|
||||
}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
std::map <std::string, EQStream*>::iterator connection;
|
||||
for (connection = connection_list.begin( ); connection != connection_list.end( );)
|
||||
{
|
||||
if(!connection->second)
|
||||
{
|
||||
std::map <std::string, EQStream*>::iterator tmp=connection;
|
||||
connection++;
|
||||
connection_list.erase(tmp);
|
||||
continue;
|
||||
}
|
||||
EQStream* eqs_data = connection->second;
|
||||
if (eqs_data->IsFree() && (!eqs_data->CheckNetActive())) {
|
||||
std::map <std::string, EQStream*>::iterator tmp=connection;
|
||||
connection++;
|
||||
safe_delete(eqs_data);
|
||||
connection_list.erase(tmp);
|
||||
}
|
||||
else if(!eqs_data->RunLoop) {
|
||||
eqs_data->Process(sock);
|
||||
connection++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EQStreamServer::RecvData(uchar* data, uint32 size, uint32 irIP, uint16 irPort) {
|
||||
/*
|
||||
CHANGE HISTORY
|
||||
|
||||
Version Author Date Comment
|
||||
1 Unknown Unknown Initial Revision
|
||||
2 Joolz 05-Jan-2003 Optimised
|
||||
3 Quagmire 05-Feb-2003 Changed so 2 connection objects wouldnt be created for the same ip/port pair, often happened
|
||||
*/
|
||||
|
||||
// Check for invalid data
|
||||
if (!data || size <= 4) return;
|
||||
//if (CRC32::Generate(data, size-4) != ntohl(*((uint32*) &data[size-4]))) {
|
||||
#if EQN_DEBUG_Error >= 1
|
||||
//cout << "Incomming Packet failed checksum" << endl;
|
||||
#endif
|
||||
//return;
|
||||
//}
|
||||
|
||||
char temp[25];
|
||||
sprintf(temp,"%lu:%u",(unsigned long)irIP,irPort);
|
||||
cout << "Data from " << temp << endl;
|
||||
EQStream* tmp = NULL;
|
||||
std::map <std::string, EQStream*>::iterator connection;
|
||||
if ((connection=connection_list.find(temp))!=connection_list.end())
|
||||
tmp=connection->second;
|
||||
if(tmp != NULL && tmp->GetrPort() == irPort)
|
||||
{
|
||||
tmp->RecvData(data, size);
|
||||
return;
|
||||
}
|
||||
else if(tmp != NULL && tmp->GetrPort() != irPort)
|
||||
{
|
||||
printf("Conflicting IPs & Ports: IP %i and Port %i is conflicting with IP %i and Port %i\n",irIP,irPort,tmp->GetrIP(),tmp->GetrPort());
|
||||
return;
|
||||
}
|
||||
|
||||
if (data[1]==0x01) {
|
||||
cout << "New EQStream Connection." << endl;
|
||||
EQStream* tmp = new EQStream(irIP, irPort);
|
||||
tmp->RecvData(data, size);
|
||||
connection_list[temp]=tmp;
|
||||
if (connection_list.find(temp)==connection_list.end()) {
|
||||
cerr <<"Could not find new connection we just added!" << endl;
|
||||
}
|
||||
MNewQueue.lock();
|
||||
NewQueue.push(tmp);
|
||||
MNewQueue.unlock();
|
||||
return;
|
||||
}
|
||||
#if EQN_DEBUG >= 4
|
||||
struct in_addr in;
|
||||
in.s_addr = irIP;
|
||||
cout << "WARNING: Stray packet? " << inet_ntoa(in) << ":" << irPort << endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
EQStream* EQStreamServer::NewQueuePop() {
|
||||
EQStream* ret = 0;
|
||||
MNewQueue.lock();
|
||||
if (!NewQueue.empty()) {
|
||||
ret = NewQueue.front();
|
||||
NewQueue.pop();
|
||||
}
|
||||
MNewQueue.unlock();
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
void EQStreamServerLoop(void* tmp)
|
||||
#else
|
||||
void* EQStreamServerLoop(void* tmp)
|
||||
#endif
|
||||
{
|
||||
#ifdef WIN32
|
||||
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL);
|
||||
#endif
|
||||
EQStreamServer* eqns = (EQStreamServer*) tmp;
|
||||
eqns->MLoopRunning.lock();
|
||||
while (eqns->RunLoop) {
|
||||
{
|
||||
_CP(EQStreamServerLoop);
|
||||
eqns->Process();
|
||||
}
|
||||
Sleep(1);
|
||||
}
|
||||
eqns->MLoopRunning.unlock();
|
||||
#ifdef WIN32
|
||||
_endthread();
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
void EQStreamInLoop(void* tmp)
|
||||
#else
|
||||
void* EQStreamInLoop(void* tmp)
|
||||
#endif
|
||||
{
|
||||
EQStream* eqs = (EQStream*) tmp;
|
||||
#ifdef _DEBUG
|
||||
if (eqs->ConnectionType != Outgoing) {
|
||||
ThrowError("EQStreamInLoop: eqs->ConnectionType != Outgoing");
|
||||
}
|
||||
#endif
|
||||
eqs->MLoopRunning.lock();
|
||||
Timer* tmp_timer = new Timer(100);
|
||||
tmp_timer->Start();
|
||||
while (eqs->RunLoop) {
|
||||
{
|
||||
_CP(EQStreamInLoop);
|
||||
if(tmp_timer->Check())
|
||||
eqs->DoRecvData();
|
||||
}
|
||||
Sleep(1);
|
||||
}
|
||||
safe_delete(tmp_timer);
|
||||
eqs->MLoopRunning.unlock();
|
||||
#ifdef WIN32
|
||||
_endthread();
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
void EQStreamOutLoop(void* tmp)
|
||||
#else
|
||||
void* EQStreamOutLoop(void* tmp)
|
||||
#endif
|
||||
{
|
||||
EQStream* eqs = (EQStream*) tmp;
|
||||
#ifdef _DEBUG
|
||||
if (eqs->ConnectionType != Outgoing) {
|
||||
ThrowError("EQStreamOutLoop: eqs->ConnectionType != Outgoing");
|
||||
}
|
||||
#endif
|
||||
eqs->MLoopRunning.lock();
|
||||
Timer* tmp_timer = new Timer(100);
|
||||
tmp_timer->Start();
|
||||
while (eqs->RunLoop) {
|
||||
{
|
||||
_CP(EQStreamOutLoop);
|
||||
if(tmp_timer->Check())
|
||||
eqs->Process(eqs->outsock);
|
||||
}
|
||||
Sleep(1);
|
||||
}
|
||||
safe_delete(tmp_timer);
|
||||
eqs->MLoopRunning.unlock();
|
||||
#ifdef WIN32
|
||||
_endthread();
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1,120 +0,0 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY except by those people which sell it, which
|
||||
are required to give you total support for your newly bought product;
|
||||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#ifndef EQNETWORK_H
|
||||
#define EQNETWORK_H
|
||||
|
||||
#include "../common/debug.h"
|
||||
|
||||
//uncomment this to enable the packet profiler. Counts the number
|
||||
//of each type of packet sent or received on a connection.
|
||||
#ifdef ZONE
|
||||
//#define PACKET_PROFILER 1
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <map>
|
||||
#include <list>
|
||||
#include <queue>
|
||||
|
||||
#include "../common/types.h"
|
||||
#include "../common/timer.h"
|
||||
#include "../common/linked_list.h"
|
||||
#include "../common/queue.h"
|
||||
#include "../common/Mutex.h"
|
||||
#include "../common/packet_functions.h"
|
||||
#include "EQStream.h"
|
||||
#ifdef PACKET_PROFILER
|
||||
#include "../common/rdtsc.h"
|
||||
#endif
|
||||
|
||||
#define EQNC_TIMEOUT 60000
|
||||
#define NAS_TIMER 100
|
||||
#define KA_TIMER 400 /* keeps the lag bar constant */
|
||||
#define MAX_HEADER_SIZE 39 // Quag: 39 is the max header + opcode + crc32 + unknowns size
|
||||
|
||||
class EQStreamServer;
|
||||
class EQStream;
|
||||
class EQStreamPacket;
|
||||
class EQStreamFragmentGroupList;
|
||||
class EQStreamFragmentGroup;
|
||||
typedef EQStreamServer EQNServer;
|
||||
typedef EQStream EQNConnection;
|
||||
typedef EQStreamPacket EQNPacket;
|
||||
typedef EQStreamFragmentGroupList EQNFragmentGroupList;
|
||||
typedef EQStreamFragmentGroup EQNFragmentGroup;
|
||||
|
||||
#define FLAG_COMPRESSED 0x1000
|
||||
#define FLAG_COMBINED 0x2000
|
||||
#define FLAG_ENCRYPTED 0x4000
|
||||
#define FLAG_IMPLICIT 0x8000
|
||||
#define FLAG_ALL 0xF000
|
||||
#define StripFlags(x) (x & ~FLAG_ALL)
|
||||
|
||||
// Optimistic compression, used for guessing pre-alloc size on debug output
|
||||
#define BEST_COMPR_RATIO 300
|
||||
|
||||
enum eappCompressed { appNormal, appInflated, appDeflated };
|
||||
|
||||
#ifdef WIN32
|
||||
void EQStreamServerLoop(void* tmp);
|
||||
void EQStreamInLoop(void* tmp);
|
||||
void EQStreamOutLoop(void* tmp);
|
||||
#else
|
||||
void* EQStreamServerLoop(void* tmp);
|
||||
void* EQStreamInLoop(void* tmp);
|
||||
void* EQStreamOutLoop(void* tmp);
|
||||
#endif
|
||||
class EQStreamServer {
|
||||
public:
|
||||
EQStreamServer(uint16 iPort = 0);
|
||||
virtual ~EQStreamServer();
|
||||
|
||||
bool Open(uint16 iPort = 0); // opens the port
|
||||
void Close(); // closes the port
|
||||
void KillAll(); // kills all clients
|
||||
inline uint16 GetPort() { return pPort; }
|
||||
|
||||
EQStream* NewQueuePop();
|
||||
protected:
|
||||
#ifdef WIN32
|
||||
friend void EQStreamServerLoop(void* tmp);
|
||||
#else
|
||||
friend void* EQStreamServerLoop(void* tmp);
|
||||
#endif
|
||||
void Process();
|
||||
bool IsOpen();
|
||||
void SetOpen(bool iOpen);
|
||||
bool RunLoop;
|
||||
Mutex MLoopRunning;
|
||||
private:
|
||||
void RecvData(uchar* data, uint32 size, uint32 irIP, uint16 irPort);
|
||||
#ifdef WIN32
|
||||
SOCKET sock;
|
||||
#else
|
||||
int sock;
|
||||
#endif
|
||||
uint16 pPort;
|
||||
bool pOpen;
|
||||
Mutex MNewQueue;
|
||||
Mutex MOpen;
|
||||
|
||||
std::map<std::string,EQStream*> connection_list;
|
||||
std::queue<EQStream *> NewQueue;
|
||||
};
|
||||
|
||||
#endif
|
||||
-1900
File diff suppressed because it is too large
Load Diff
@@ -46,7 +46,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#include <stdarg.h>
|
||||
#include "Parse.h"
|
||||
#include "HTTPSocket.h"
|
||||
#include "../TCPConnection.h"
|
||||
#include "../tcp_connection.h"
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include "../TCPConnection.h"
|
||||
#include "../tcp_connection.h"
|
||||
|
||||
|
||||
#ifdef SOCKETS_NAMESPACE
|
||||
|
||||
@@ -211,7 +211,7 @@ typedef unsigned short port_t;
|
||||
#endif
|
||||
|
||||
#ifdef _THREADSAFE_SOCKETS
|
||||
#include "Mutex.h"
|
||||
#include "mutex.h"
|
||||
#include "Lock.h"
|
||||
#endif
|
||||
|
||||
|
||||
+190
@@ -0,0 +1,190 @@
|
||||
/*
|
||||
* Boost Software License - Version 1.0 - August 17th, 2003
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person or organization
|
||||
* obtaining a copy of the software and accompanying documentation covered by
|
||||
* this license (the "Software") to use, reproduce, display, distribute,
|
||||
* execute, and transmit the Software, and to prepare derivative works of the
|
||||
* Software, and to permit third-parties to whom the Software is furnished to
|
||||
* do so, all subject to the following:
|
||||
*
|
||||
* The copyright notices in the Software and this entire statement, including
|
||||
* the above license grant, this restriction and the following disclaimer,
|
||||
* must be included in all copies of the Software, in whole or in part, and
|
||||
* all derivative works of the Software, unless such copies or derivative
|
||||
* works are solely in the form of machine-executable object code generated by
|
||||
* a source language processor.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
* SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
* FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
// EQEmu::Any is a modified version of Boost::Any and as such retains the Boost licensing.
|
||||
|
||||
#ifndef EQEMU_COMMON_ANY_H
|
||||
#define EQEMU_COMMON_ANY_H
|
||||
|
||||
#include <algorithm>
|
||||
#include <typeinfo>
|
||||
|
||||
namespace EQEmu
|
||||
{
|
||||
class Any
|
||||
{
|
||||
public:
|
||||
Any()
|
||||
: content(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
template<typename ValueType>
|
||||
Any(const ValueType &value)
|
||||
: content(new Holder<ValueType>(value))
|
||||
{
|
||||
}
|
||||
|
||||
Any(const Any &other)
|
||||
: content(other.content ? other.content->clone() : 0)
|
||||
{
|
||||
}
|
||||
|
||||
~Any()
|
||||
{
|
||||
if(content)
|
||||
delete content;
|
||||
}
|
||||
|
||||
Any& swap(Any &rhs)
|
||||
{
|
||||
std::swap(content, rhs.content);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename ValueType>
|
||||
Any& operator=(const ValueType &rhs)
|
||||
{
|
||||
Any(rhs).swap(*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
Any& operator=(Any rhs)
|
||||
{
|
||||
rhs.swap(*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool empty() const
|
||||
{
|
||||
return !content;
|
||||
}
|
||||
|
||||
const std::type_info& type() const
|
||||
{
|
||||
return content ? content->type() : typeid(void);
|
||||
}
|
||||
|
||||
class Placeholder
|
||||
{
|
||||
public:
|
||||
virtual ~Placeholder()
|
||||
{
|
||||
}
|
||||
|
||||
virtual const std::type_info& type() const = 0;
|
||||
virtual Placeholder* clone() const = 0;
|
||||
};
|
||||
|
||||
|
||||
template<typename ValueType>
|
||||
class Holder : public Placeholder
|
||||
{
|
||||
public:
|
||||
Holder(const ValueType &value)
|
||||
: held(value)
|
||||
{
|
||||
}
|
||||
|
||||
virtual const std::type_info& type() const
|
||||
{
|
||||
return typeid(ValueType);
|
||||
}
|
||||
|
||||
virtual Placeholder* clone() const
|
||||
{
|
||||
return new Holder(held);
|
||||
}
|
||||
|
||||
ValueType held;
|
||||
|
||||
private:
|
||||
Holder& operator=(const Holder&);
|
||||
};
|
||||
|
||||
private:
|
||||
template<typename ValueType>
|
||||
friend ValueType* any_cast(Any*);
|
||||
|
||||
template<typename ValueType>
|
||||
friend ValueType* unsafe_any_cast(Any*);
|
||||
|
||||
Placeholder* content;
|
||||
};
|
||||
|
||||
class bad_any_cast : public std::bad_cast
|
||||
{
|
||||
public:
|
||||
virtual const char * what() const throw()
|
||||
{
|
||||
return "DBI::bad_any_cast: failed conversion using DBI::any_cast";
|
||||
}
|
||||
};
|
||||
|
||||
template<typename ValueType>
|
||||
ValueType* any_cast(Any* operand)
|
||||
{
|
||||
return operand &&
|
||||
operand->type() == typeid(ValueType) ? &static_cast<Any::Holder<ValueType>*>(operand->content)->held : nullptr;
|
||||
}
|
||||
|
||||
template<typename ValueType>
|
||||
inline const ValueType* any_cast(const Any* operand)
|
||||
{
|
||||
return any_cast<ValueType>(const_cast<Any*>(operand));
|
||||
}
|
||||
|
||||
template<typename ValueType>
|
||||
ValueType any_cast(Any& operand)
|
||||
{
|
||||
typedef typename std::remove_reference<ValueType>::type nonref;
|
||||
nonref* result = any_cast<nonref>(&operand);
|
||||
if(!result)
|
||||
throw bad_any_cast();
|
||||
return *result;
|
||||
}
|
||||
|
||||
template<typename ValueType>
|
||||
inline ValueType any_cast(const Any& operand)
|
||||
{
|
||||
typedef typename std::remove_reference<ValueType>::type nonref;
|
||||
return any_cast<const nonref&>(const_cast<Any&>(operand));
|
||||
}
|
||||
|
||||
template<typename ValueType>
|
||||
inline ValueType* unsafe_any_cast(Any* operand)
|
||||
{
|
||||
return &static_cast<Any::Holder<ValueType>*>(operand->content)->held;
|
||||
}
|
||||
|
||||
template<typename ValueType>
|
||||
inline const ValueType* unsafe_any_cast(const Any* operand)
|
||||
{
|
||||
return unsafe_any_cast<ValueType>(const_cast<Any*>(operand));
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,34 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2013 EQEMu Development Team (http://eqemulator.net)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY except by those people which sell it, which
|
||||
are required to give you total support for your newly bought product;
|
||||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef __EQEMU_COMMON_BASE_DATA_H
|
||||
#define __EQEMU_COMMON_BASE_DATA_H
|
||||
|
||||
struct BaseDataStruct
|
||||
{
|
||||
double base_hp;
|
||||
double base_mana;
|
||||
double base_end;
|
||||
double unk1;
|
||||
double unk2;
|
||||
double hp_factor;
|
||||
double mana_factor;
|
||||
double endurance_factor;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -16,7 +16,7 @@
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "debug.h"
|
||||
#include "BasePacket.h"
|
||||
#include "base_packet.h"
|
||||
#include "misc.h"
|
||||
#include "packet_dump.h"
|
||||
|
||||
+33
-18
@@ -1,27 +1,42 @@
|
||||
#ifndef CLIENTVERSIONS_H
|
||||
#define CLIENTVERSIONS_H
|
||||
|
||||
static const uint32 BIT_Client62 = 1;
|
||||
static const uint32 BIT_Titanium = 2;
|
||||
static const uint32 BIT_SoF = 4;
|
||||
static const uint32 BIT_SoD = 8;
|
||||
static const uint32 BIT_Underfoot = 16;
|
||||
static const uint32 BIT_RoF = 32;
|
||||
static const uint32 BIT_TitaniumAndEarlier = 3;
|
||||
static const uint32 BIT_SoFAndLater = 0xFFFFFFFC;
|
||||
static const uint32 BIT_SoDAndLater = 0xFFFFFFF8;
|
||||
static const uint32 BIT_UnderfootAndLater = 0xFFFFFFF0;
|
||||
static const uint32 BIT_RoFAndLater = 0xFFFFFFE0;
|
||||
static const uint32 BIT_AllClients = 0xFFFFFFFF;
|
||||
static const uint32 BIT_Client62 = 1;
|
||||
static const uint32 BIT_Titanium = 2;
|
||||
static const uint32 BIT_SoF = 4;
|
||||
static const uint32 BIT_SoD = 8;
|
||||
static const uint32 BIT_Underfoot = 16;
|
||||
static const uint32 BIT_RoF = 32;
|
||||
static const uint32 BIT_RoF2 = 64;
|
||||
|
||||
static const uint32 BIT_TitaniumAndEarlier = 0x00000003;
|
||||
static const uint32 BIT_SoFAndLater = 0xFFFFFFFC;
|
||||
static const uint32 BIT_SoDAndLater = 0xFFFFFFF8;
|
||||
static const uint32 BIT_UnderfootAndLater = 0xFFFFFFF0;
|
||||
static const uint32 BIT_RoFAndLater = 0xFFFFFFE0;
|
||||
static const uint32 BIT_RoF2AndLater = 0xFFFFFFC0;
|
||||
static const uint32 BIT_AllClients = 0xFFFFFFFF;
|
||||
|
||||
typedef enum {
|
||||
EQClientUnknown = 0,
|
||||
EQClient62,
|
||||
EQClientTitanium,
|
||||
EQClientSoF,
|
||||
EQClientSoD,
|
||||
EQClientUnderfoot,
|
||||
EQClientRoF
|
||||
EQClient62, // Build: 'Aug 4 2005 15:40:59'
|
||||
EQClientTitanium, // Build: 'Oct 31 2005 10:33:37'
|
||||
EQClientSoF, // Build: 'Sep 7 2007 09:11:49'
|
||||
EQClientSoD, // Build: 'Dec 19 2008 15:22:49'
|
||||
EQClientUnderfoot, // Build: 'Jun 8 2010 16:44:32'
|
||||
EQClientRoF, // Build: 'Dec 10 2012 17:35:44'
|
||||
EQClientRoF2, // Build: 'May 10 2013 23:30:08'
|
||||
|
||||
_EQClientCount, // place new clients before this point (preferably, in release/attribute order)
|
||||
|
||||
// Values below are not implemented, as yet...
|
||||
|
||||
EmuNPC = _EQClientCount,
|
||||
EmuMerc,
|
||||
EmuBot,
|
||||
EmuPet,
|
||||
|
||||
_EmuClientCount // array size for EQLimits
|
||||
} EQClientVersion;
|
||||
|
||||
#endif /* CLIENTVERSIONS_H */
|
||||
|
||||
@@ -1,103 +0,0 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY except by those people which sell it, which
|
||||
are required to give you total support for your newly bought product;
|
||||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#ifndef COMMON_PROFILE_H
|
||||
#define COMMON_PROFILE_H
|
||||
|
||||
#ifdef ZONE
|
||||
#include "../common/features.h"
|
||||
|
||||
#ifndef EQPROFILE
|
||||
#ifdef COMMON_PROFILE
|
||||
#undef COMMON_PROFILE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef COMMON_PROFILE
|
||||
|
||||
#include "../common/profiler.h"
|
||||
|
||||
class CommonProfiler : public GeneralProfiler {
|
||||
public:
|
||||
enum {
|
||||
Database_SaveInventory = 0,
|
||||
Database_StoreCharacter,
|
||||
Database_GetCharacterInfoForLogin,
|
||||
Database_GetCharacterInfoForLogin_result,
|
||||
Database_GetPlayerProfile,
|
||||
Database_GetInventory,
|
||||
Database_GetInventory_name,
|
||||
Database_SetPlayerProfile,
|
||||
Database_DBLoadItems,
|
||||
Database_GetWaypoints,
|
||||
Database_DBLoadNPCFactionLists,
|
||||
|
||||
DBcore_RunQuery,
|
||||
|
||||
DBAsync_ProcessWork,
|
||||
DBAsync_DispatchWork,
|
||||
DBAsyncLoop_loop,
|
||||
|
||||
EQStreamServer_Process,
|
||||
|
||||
EQStream_Process,
|
||||
|
||||
EQStreamServerLoop,
|
||||
EQStreamInLoop,
|
||||
EQStreamOutLoop,
|
||||
TCPServerLoop,
|
||||
TCPConnectionLoop,
|
||||
|
||||
Inventory_GetItem,
|
||||
Inventory_HasItem,
|
||||
|
||||
BaseTCPServerLoop,
|
||||
|
||||
MakeRandomInt,
|
||||
MakeRandomFloat,
|
||||
|
||||
Mutex_lock,
|
||||
Timer_Check,
|
||||
|
||||
WorldConnection_Process,
|
||||
|
||||
MaxCommonProfilerId
|
||||
};
|
||||
|
||||
inline CommonProfiler() : GeneralProfiler(MaxCommonProfilerId) { }
|
||||
|
||||
};
|
||||
|
||||
extern CommonProfiler _cp;
|
||||
|
||||
|
||||
#define _CP(name) _GP(_cp, CommonProfiler, name)
|
||||
|
||||
#else
|
||||
//no zone profiling, dummy functions
|
||||
#define _CP(name) ;
|
||||
|
||||
#endif //COMMON_PROFILE
|
||||
|
||||
#else //else !ZONE
|
||||
|
||||
#define _CP(name) ;
|
||||
|
||||
#endif //!ZONE
|
||||
|
||||
#endif
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
#include "debug.h"
|
||||
#include "Condition.h"
|
||||
#include "condition.h"
|
||||
|
||||
#ifdef _WINDOWS
|
||||
|
||||
+1397
-2047
File diff suppressed because it is too large
Load Diff
+23
-9
@@ -26,11 +26,11 @@
|
||||
#include "dbcore.h"
|
||||
#include "linked_list.h"
|
||||
#include "eq_packet_structs.h"
|
||||
/*#include "EQStream.h"
|
||||
/*#include "eq_stream.h"
|
||||
#include "guilds.h"
|
||||
#include "MiscFunctions.h"
|
||||
#include "Mutex.h"
|
||||
#include "Item.h"
|
||||
#include "misc_functions.h"
|
||||
#include "mutex.h"
|
||||
#include "item.h"
|
||||
#include "extprofile.h"*/
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@@ -130,7 +130,7 @@ public:
|
||||
uint32 GetAccountIDByChar(const char* charname, uint32* oCharID = 0);
|
||||
uint32 GetAccountIDByChar(uint32 char_id);
|
||||
uint32 GetAccountIDByName(const char* accname, int16* status = 0, uint32* lsid = 0);
|
||||
uint32 GetGuildDBIDByCharID(uint32 char_id);
|
||||
uint32 GetGuildIDByCharID(uint32 char_id);
|
||||
void GetAccountName(uint32 accountid, char* name, uint32* oLSAccountID = 0);
|
||||
void GetCharName(uint32 char_id, char* name);
|
||||
uint32 GetCharacterInfo(const char* iName, uint32* oAccID = 0, uint32* oZoneID = 0, uint32* oInstanceID = 0,float* oX = 0, float* oY = 0, float* oZ = 0);
|
||||
@@ -163,6 +163,7 @@ public:
|
||||
uint16 GetInstanceVersion(uint16 instance_id);
|
||||
uint16 GetInstanceID(const char* zone, uint32 charid, int16 version);
|
||||
uint16 GetInstanceID(uint32 zone, uint32 charid, int16 version);
|
||||
void GetCharactersInInstance(uint16 instance_id, std::list<uint32> &charid_list);
|
||||
void AssignGroupToInstance(uint32 gid, uint32 instance_id);
|
||||
void AssignRaidToInstance(uint32 rid, uint32 instance_id);
|
||||
void FlagInstanceByGroupLeader(uint32 zone, int16 version, uint32 charid, uint32 gid);
|
||||
@@ -206,6 +207,7 @@ public:
|
||||
char* GetGroupLeadershipInfo(uint32 gid, char* leaderbuf, char* maintank = nullptr, char* assist = nullptr, char* puller = nullptr, char *marknpc = nullptr,
|
||||
GroupLeadershipAA_Struct* GLAA = nullptr);
|
||||
void ClearGroupLeader(uint32 gid = 0);
|
||||
|
||||
|
||||
/*
|
||||
* Raids
|
||||
@@ -222,7 +224,7 @@ public:
|
||||
bool SetVariable(const char* varname, const char* varvalue);
|
||||
bool LoadVariables();
|
||||
uint32 LoadVariables_MQ(char** query);
|
||||
bool LoadVariables_result(MYSQL_RES* result);
|
||||
bool LoadVariables_result(MySQLRequestResult results);
|
||||
|
||||
/*
|
||||
* General Queries
|
||||
@@ -255,14 +257,26 @@ protected:
|
||||
private:
|
||||
void DBInitVars();
|
||||
|
||||
uint32 max_zonename;
|
||||
char** zonename_array;
|
||||
std::map<uint32,std::string> zonename_array;
|
||||
|
||||
Mutex Mvarcache;
|
||||
uint32 varcache_max;
|
||||
VarCache_Struct** varcache_array;
|
||||
uint32 varcache_lastupdate;
|
||||
|
||||
|
||||
/*
|
||||
* Groups, utility methods.
|
||||
*/
|
||||
void ClearAllGroupLeaders();
|
||||
void ClearAllGroups();
|
||||
|
||||
|
||||
/*
|
||||
* Raid, utility methods.
|
||||
*/
|
||||
void ClearAllRaids();
|
||||
void ClearAllRaidDetails();
|
||||
};
|
||||
|
||||
bool FetchRowMap(MYSQL_RES *result, std::map<std::string,std::string> &rowmap);
|
||||
#endif
|
||||
|
||||
+2
-10
@@ -11,10 +11,9 @@
|
||||
#include <mysqld_error.h>
|
||||
#include <limits.h>
|
||||
#include "dbcore.h"
|
||||
#include "common_profile.h"
|
||||
#include <string.h>
|
||||
//#include "../common/MiscFunctions.h"
|
||||
#include "StringUtil.h"
|
||||
//#include "../common/misc_functions.h"
|
||||
#include "string_util.h"
|
||||
#define ASYNC_LOOP_GRANULARITY 4 //# of ms between checking our work
|
||||
|
||||
bool DBAsyncCB_LoadVariables(DBAsyncWork* iWork) {
|
||||
@@ -54,10 +53,8 @@ ThreadReturnType DBAsyncLoop(void* tmp) {
|
||||
//we could check dba->RunLoop() again to see if we
|
||||
//got turned off while we were waiting
|
||||
{
|
||||
_CP(DBAsyncLoop_loop);
|
||||
dba->Process();
|
||||
}
|
||||
// Sleep(ASYNC_LOOP_GRANULARITY);
|
||||
}
|
||||
dba->MLoopRunning.unlock();
|
||||
|
||||
@@ -302,11 +299,7 @@ void DBAsync::CommitWrites() {
|
||||
}
|
||||
|
||||
void DBAsync::ProcessWork(DBAsyncWork* iWork, bool iSleep) {
|
||||
_CP(DBAsync_ProcessWork);
|
||||
DBAsyncQuery* CurrentQuery;
|
||||
#if DEBUG_MYSQL_QUERIES >= 2
|
||||
std::cout << "Processing AsyncWork #" << iWork->GetWorkID() << std::endl;
|
||||
#endif
|
||||
while ((CurrentQuery = iWork->PopQuery())) {
|
||||
CurrentQuery->Process(pDBC);
|
||||
iWork->PushAnswer(CurrentQuery);
|
||||
@@ -316,7 +309,6 @@ void DBAsync::ProcessWork(DBAsyncWork* iWork, bool iSleep) {
|
||||
}
|
||||
|
||||
void DBAsync::DispatchWork(DBAsyncWork* iWork) {
|
||||
_CP(DBAsync_DispatchWork);
|
||||
//if this work has a callback, call it
|
||||
//otherwise, stick the work on the finish queue
|
||||
if (iWork->pCB) {
|
||||
|
||||
+90
-8
@@ -10,7 +10,7 @@
|
||||
#include <limits.h>
|
||||
#include "dbcore.h"
|
||||
#include <string.h>
|
||||
#include "../common/MiscFunctions.h"
|
||||
#include "../common/misc_functions.h"
|
||||
#include <cstdlib>
|
||||
|
||||
#ifdef _WINDOWS
|
||||
@@ -58,8 +58,94 @@ void DBcore::ping() {
|
||||
MDatabase.unlock();
|
||||
}
|
||||
|
||||
MySQLRequestResult DBcore::QueryDatabase(std::string query, bool retryOnFailureOnce)
|
||||
{
|
||||
return QueryDatabase(query.c_str(), query.length(), retryOnFailureOnce);
|
||||
}
|
||||
|
||||
MySQLRequestResult DBcore::QueryDatabase(const char* query, uint32 querylen, bool retryOnFailureOnce)
|
||||
{
|
||||
LockMutex lock(&MDatabase);
|
||||
|
||||
// Reconnect if we are not connected before hand.
|
||||
if (pStatus != Connected)
|
||||
Open();
|
||||
|
||||
// request query. != 0 indicates some kind of error.
|
||||
if (mysql_real_query(&mysql, query, querylen) != 0)
|
||||
{
|
||||
unsigned int errorNumber = mysql_errno(&mysql);
|
||||
|
||||
if (errorNumber == CR_SERVER_GONE_ERROR)
|
||||
pStatus = Error;
|
||||
|
||||
// error appears to be a disconnect error, may need to try again.
|
||||
if (errorNumber == CR_SERVER_LOST || errorNumber == CR_SERVER_GONE_ERROR)
|
||||
{
|
||||
|
||||
if (retryOnFailureOnce)
|
||||
{
|
||||
std::cout << "Database Error: Lost connection, attempting to recover...." << std::endl;
|
||||
MySQLRequestResult requestResult = QueryDatabase(query, querylen, false);
|
||||
|
||||
if (requestResult.Success())
|
||||
{
|
||||
std::cout << "Reconnection to database successful." << std::endl;
|
||||
return requestResult;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
pStatus = Error;
|
||||
|
||||
char *errorBuffer = new char[MYSQL_ERRMSG_SIZE];
|
||||
|
||||
snprintf(errorBuffer, MYSQL_ERRMSG_SIZE, "#%i: %s", mysql_errno(&mysql), mysql_error(&mysql));
|
||||
|
||||
std::cout << "DB Query Error #" << mysql_errno(&mysql) << ": " << mysql_error(&mysql) << std::endl;
|
||||
|
||||
return MySQLRequestResult(nullptr, 0, 0, 0, 0, (uint32)mysql_errno(&mysql), errorBuffer);
|
||||
}
|
||||
|
||||
char *errorBuffer = new char[MYSQL_ERRMSG_SIZE];
|
||||
snprintf(errorBuffer, MYSQL_ERRMSG_SIZE, "#%i: %s", mysql_errno(&mysql), mysql_error(&mysql));
|
||||
|
||||
#ifdef _EQDEBUG
|
||||
std::cout << "DB Query Error #" << mysql_errno(&mysql) << ": " << mysql_error(&mysql) << std::endl;
|
||||
#endif
|
||||
return MySQLRequestResult(nullptr, 0, 0, 0, 0, mysql_errno(&mysql),errorBuffer);
|
||||
|
||||
}
|
||||
|
||||
// successful query. get results.
|
||||
MYSQL_RES* res = mysql_store_result(&mysql);
|
||||
uint32 rowCount = 0;
|
||||
|
||||
if (res != nullptr)
|
||||
rowCount = (uint32)mysql_num_rows(res);
|
||||
|
||||
MySQLRequestResult requestResult(res, (uint32)mysql_affected_rows(&mysql), rowCount, (uint32)mysql_field_count(&mysql), (uint32)mysql_insert_id(&mysql));
|
||||
|
||||
|
||||
#if DEBUG_MYSQL_QUERIES >= 1
|
||||
if (requestResult.Success())
|
||||
{
|
||||
std::cout << "query successful";
|
||||
if (requestResult.Result())
|
||||
std::cout << ", " << (int) mysql_num_rows(requestResult.Result()) << " rows returned";
|
||||
|
||||
std::cout << ", " << requestResult.RowCount() << " rows affected";
|
||||
std::cout<< std::endl;
|
||||
}
|
||||
else {
|
||||
std::cout << "QUERY: query FAILED" << std::endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
return requestResult;
|
||||
}
|
||||
|
||||
bool DBcore::RunQuery(const char* query, uint32 querylen, char* errbuf, MYSQL_RES** result, uint32* affected_rows, uint32* last_insert_id, uint32* errnum, bool retry) {
|
||||
_CP(DBcore_RunQuery);
|
||||
if (errnum)
|
||||
*errnum = 0;
|
||||
if (errbuf)
|
||||
@@ -68,11 +154,7 @@ bool DBcore::RunQuery(const char* query, uint32 querylen, char* errbuf, MYSQL_RE
|
||||
LockMutex lock(&MDatabase);
|
||||
if (pStatus != Connected)
|
||||
Open();
|
||||
#if DEBUG_MYSQL_QUERIES >= 1
|
||||
char tmp[120];
|
||||
strn0cpy(tmp, query, sizeof(tmp));
|
||||
std::cout << "QUERY: " << tmp << std::endl;
|
||||
#endif
|
||||
|
||||
if (mysql_real_query(&mysql, query, querylen)) {
|
||||
if (mysql_errno(&mysql) == CR_SERVER_GONE_ERROR)
|
||||
pStatus = Error;
|
||||
@@ -116,7 +198,7 @@ bool DBcore::RunQuery(const char* query, uint32 querylen, char* errbuf, MYSQL_RE
|
||||
if (affected_rows)
|
||||
*affected_rows = mysql_affected_rows(&mysql);
|
||||
if (last_insert_id)
|
||||
*last_insert_id = mysql_insert_id(&mysql);
|
||||
*last_insert_id = (uint32)mysql_insert_id(&mysql);
|
||||
if (result) {
|
||||
if (*result) {
|
||||
ret = true;
|
||||
|
||||
+7
-3
@@ -4,15 +4,17 @@
|
||||
#ifdef _WINDOWS
|
||||
#include <winsock.h>
|
||||
#include <windows.h>
|
||||
//#include <winsock.h>
|
||||
#endif
|
||||
|
||||
#include <mysql.h>
|
||||
#include <string.h>
|
||||
#include "../common/types.h"
|
||||
#include "../common/Mutex.h"
|
||||
#include "../common/mutex.h"
|
||||
#include "../common/linked_list.h"
|
||||
#include "../common/queue.h"
|
||||
#include "../common/timer.h"
|
||||
#include "../common/Condition.h"
|
||||
#include "../common/condition.h"
|
||||
#include "../common/mysql_request_result.h"
|
||||
|
||||
class DBcore {
|
||||
public:
|
||||
@@ -22,6 +24,8 @@ public:
|
||||
~DBcore();
|
||||
eStatus GetStatus() { return pStatus; }
|
||||
bool RunQuery(const char* query, uint32 querylen, char* errbuf = 0, MYSQL_RES** result = 0, uint32* affected_rows = 0, uint32* last_insert_id = 0, uint32* errnum = 0, bool retry = true);
|
||||
MySQLRequestResult QueryDatabase(const char* query, uint32 querylen, bool retryOnFailureOnce = true);
|
||||
MySQLRequestResult QueryDatabase(std::string query, bool retryOnFailureOnce = true);
|
||||
uint32 DoEscapeString(char* tobuf, const char* frombuf, uint32 fromlen);
|
||||
void ping();
|
||||
MYSQL* getMySQL(){ return &mysql; }
|
||||
|
||||
+14
-23
@@ -19,8 +19,8 @@
|
||||
#endif
|
||||
|
||||
#include "debug.h"
|
||||
#include "StringUtil.h"
|
||||
#include "MiscFunctions.h"
|
||||
#include "string_util.h"
|
||||
#include "misc_functions.h"
|
||||
#include "platform.h"
|
||||
|
||||
#ifndef va_copy
|
||||
@@ -35,29 +35,20 @@ static const char* FileNames[EQEMuLog::MaxLogID] = { "logs/eqemu", "logs/eqemu",
|
||||
static const char* LogNames[EQEMuLog::MaxLogID] = { "Status", "Normal", "Error", "Debug", "Quest", "Command", "Crash" };
|
||||
|
||||
EQEMuLog::EQEMuLog() {
|
||||
// MOpen = new Mutex;
|
||||
// MLog = new Mutex*[MaxLogID];
|
||||
// fp = new FILE*[MaxLogID];
|
||||
// pLogStatus = new uint8[MaxLogID];
|
||||
for (int i=0; i<MaxLogID; i++) {
|
||||
fp[i] = 0;
|
||||
// MLog[i] = new Mutex;
|
||||
#if EQDEBUG >= 2
|
||||
pLogStatus[i] = 1 | 2;
|
||||
#else
|
||||
pLogStatus[i] = 0;
|
||||
#endif
|
||||
logCallbackFmt[i] = nullptr;
|
||||
logCallbackBuf[i] = nullptr;
|
||||
logCallbackPva[i] = nullptr;
|
||||
}
|
||||
// TODO: Make this read from an ini or something, everyone has different opinions on what it should be
|
||||
#if EQDEBUG < 2
|
||||
pLogStatus[Status] = 2;
|
||||
pLogStatus[Error] = 2;
|
||||
pLogStatus[Quest] = 2;
|
||||
pLogStatus[Commands] = 1;
|
||||
#endif
|
||||
|
||||
pLogStatus[Status] = LOG_LEVEL_STATUS;
|
||||
pLogStatus[Normal] = LOG_LEVEL_NORMAL;
|
||||
pLogStatus[Error] = LOG_LEVEL_ERROR;
|
||||
pLogStatus[Debug] = LOG_LEVEL_DEBUG;
|
||||
pLogStatus[Quest] = LOG_LEVEL_QUEST;
|
||||
pLogStatus[Commands] = LOG_LEVEL_COMMANDS;
|
||||
pLogStatus[Crash] = LOG_LEVEL_CRASH;
|
||||
logFileValid = true;
|
||||
}
|
||||
|
||||
@@ -68,10 +59,6 @@ EQEMuLog::~EQEMuLog() {
|
||||
if (fp[i])
|
||||
fclose(fp[i]);
|
||||
}
|
||||
// safe_delete_array(fp);
|
||||
// safe_delete_array(MLog);
|
||||
// safe_delete_array(pLogStatus);
|
||||
// safe_delete(MOpen);
|
||||
}
|
||||
|
||||
bool EQEMuLog::open(LogIDs id) {
|
||||
@@ -104,6 +91,10 @@ bool EQEMuLog::open(LogIDs id) {
|
||||
snprintf(exename, sizeof(exename), "_queryserv");
|
||||
} else if(platform == ExePlatformSharedMemory) {
|
||||
snprintf(exename, sizeof(exename), "_shared_memory");
|
||||
} else if(platform == ExePlatformClientImport) {
|
||||
snprintf(exename, sizeof(exename), "_import");
|
||||
} else if(platform == ExePlatformClientExport) {
|
||||
snprintf(exename, sizeof(exename), "_export");
|
||||
}
|
||||
|
||||
char filename[200];
|
||||
|
||||
+1
-5
@@ -68,12 +68,8 @@
|
||||
#endif
|
||||
|
||||
#include "logsys.h"
|
||||
#include "common_profile.h"
|
||||
#ifdef ZONE
|
||||
#include "../zone/zone_profile.h"
|
||||
#endif
|
||||
|
||||
#include "../common/Mutex.h"
|
||||
#include "../common/mutex.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
|
||||
+140
-39
@@ -18,48 +18,149 @@
|
||||
#ifndef DEITY_H
|
||||
#define DEITY_H
|
||||
|
||||
#include "types.h"
|
||||
#include <string>
|
||||
|
||||
// NOTE: This code is not fully implemented since there are no references in the existing code
|
||||
|
||||
/*
|
||||
** Diety List
|
||||
** Diety types
|
||||
**
|
||||
** (ref: eqstr_us.txt)
|
||||
**
|
||||
** (Another orphaned enumeration...)
|
||||
*/
|
||||
#define DEITY_AGNOSTIC 396 //drop the high bit for 140
|
||||
#define DEITY_BRELL 202
|
||||
#define DEITY_CAZIC 203
|
||||
#define DEITY_EROLLSI 204
|
||||
#define DEITY_BRISTLE 205
|
||||
#define DEITY_INNY 206
|
||||
#define DEITY_KARANA 207
|
||||
#define DEITY_MITH 208
|
||||
#define DEITY_PREXUS 209
|
||||
#define DEITY_QUELLIOUS 210
|
||||
#define DEITY_RALLOS 211
|
||||
#define DEITY_SOLUSEK 213
|
||||
#define DEITY_TRIBUNAL 214
|
||||
#define DEITY_TUNARE 215
|
||||
enum DeityTypes
|
||||
{
|
||||
/*----*/ DeityUnknown = 0,
|
||||
/*----*/ DeityAgnostic_LB = 140,
|
||||
/*3251*/ DeityBertoxxulous = 201,
|
||||
/*3262*/ DeityBrellSirilis,
|
||||
/*3253*/ DeityCazicThule,
|
||||
/*3256*/ DeityErollisiMarr,
|
||||
/*3252*/ DeityBristlebane,
|
||||
/*3254*/ DeityInnoruuk,
|
||||
/*3255*/ DeityKarana,
|
||||
/*3257*/ DeityMithanielMarr,
|
||||
/*3259*/ DeityPrexus,
|
||||
/*3260*/ DeityQuellious,
|
||||
/*3266*/ DeityRallosZek,
|
||||
/*3258*/ DeityRodcetNife,
|
||||
/*3261*/ DeitySolusekRo,
|
||||
/*3263*/ DeityTheTribunal,
|
||||
/*3264*/ DeityTunare,
|
||||
/*3265*/ DeityVeeshan,
|
||||
/*3250*/ DeityAgnostic = 396
|
||||
};
|
||||
|
||||
//Guessed:
|
||||
#define DEITY_BERTOX 201
|
||||
#define DEITY_RODCET 212
|
||||
#define DEITY_VEESHAN 216
|
||||
|
||||
/* on items:
|
||||
*All 0
|
||||
AGNOSTIC 1
|
||||
BERTOX 2
|
||||
BRELL 4
|
||||
CAZIC 8
|
||||
EROLLSI 16
|
||||
BRISTLE 32
|
||||
INNY 64
|
||||
KARANA 128
|
||||
MITH 256
|
||||
PREXUS 512
|
||||
QUELLIOUS 1024
|
||||
RALLOS 2048
|
||||
RODCET 4096
|
||||
SOLUSEK 8192
|
||||
TRIBUNAL 16384
|
||||
TUNARE 32768
|
||||
VEESHAN 65536
|
||||
/*
|
||||
** Deity type bits
|
||||
**
|
||||
** (New orphan, but make use of it!)
|
||||
*/
|
||||
enum DeityTypeBits : uint32
|
||||
{
|
||||
BIT_DeityAll = 0x00000000,
|
||||
BIT_DeityAgnostic = 0x00000001,
|
||||
BIT_DeityBertoxxulous = 0x00000002,
|
||||
BIT_DeityBrellSirilis = 0x00000004,
|
||||
BIT_DeityCazicThule = 0x00000008,
|
||||
BIT_DeityErollisiMarr = 0x00000010,
|
||||
BIT_DeityBristlebane = 0x00000020,
|
||||
BIT_DeityInnoruuk = 0x00000040,
|
||||
BIT_DeityKarana = 0x00000080,
|
||||
BIT_DeityMithanielMarr = 0x00000100,
|
||||
BIT_DeityPrexus = 0x00000200,
|
||||
BIT_DeityQuellious = 0x00000400,
|
||||
BIT_DeityRallosZek = 0x00000800,
|
||||
BIT_DeityRodcetNife = 0x00001000,
|
||||
BIT_DeitySolusekRo = 0x00002000,
|
||||
BIT_DeityTheTribunal = 0x00004000,
|
||||
BIT_DeityTunare = 0x00008000,
|
||||
BIT_DeityVeeshan = 0x00010000
|
||||
};
|
||||
|
||||
static DeityTypeBits ConvertDeityToBitDeity(DeityTypes deity)
|
||||
{
|
||||
switch(deity)
|
||||
{
|
||||
case DeityBertoxxulous: { return BIT_DeityBertoxxulous; }
|
||||
case DeityBrellSirilis: { return BIT_DeityBrellSirilis; }
|
||||
case DeityCazicThule: { return BIT_DeityCazicThule; }
|
||||
case DeityErollisiMarr: { return BIT_DeityErollisiMarr; }
|
||||
case DeityBristlebane: { return BIT_DeityBristlebane; }
|
||||
case DeityInnoruuk: { return BIT_DeityInnoruuk; }
|
||||
case DeityKarana: { return BIT_DeityKarana; }
|
||||
case DeityMithanielMarr: { return BIT_DeityMithanielMarr; }
|
||||
case DeityPrexus: { return BIT_DeityPrexus; }
|
||||
case DeityQuellious: { return BIT_DeityQuellious; }
|
||||
case DeityRallosZek: { return BIT_DeityRallosZek; }
|
||||
case DeityRodcetNife: { return BIT_DeityRodcetNife; }
|
||||
case DeitySolusekRo: { return BIT_DeitySolusekRo; }
|
||||
case DeityTheTribunal: { return BIT_DeityTheTribunal; }
|
||||
case DeityTunare: { return BIT_DeityTunare; }
|
||||
case DeityVeeshan: { return BIT_DeityVeeshan; }
|
||||
case DeityAgnostic_LB:
|
||||
case DeityAgnostic: { return BIT_DeityAgnostic; }
|
||||
default: { break; }
|
||||
};
|
||||
|
||||
return BIT_DeityAll;
|
||||
};
|
||||
|
||||
static DeityTypes ConvertBitDeityToDeity(DeityTypeBits deity_bit)
|
||||
{
|
||||
switch(deity_bit)
|
||||
{
|
||||
case BIT_DeityAgnostic: { return DeityAgnostic; }
|
||||
case BIT_DeityBertoxxulous: { return DeityBertoxxulous; }
|
||||
case BIT_DeityBrellSirilis: { return DeityBrellSirilis; }
|
||||
case BIT_DeityCazicThule: { return DeityCazicThule; }
|
||||
case BIT_DeityErollisiMarr: { return DeityErollisiMarr; }
|
||||
case BIT_DeityBristlebane: { return DeityBristlebane; }
|
||||
case BIT_DeityInnoruuk: { return DeityInnoruuk; }
|
||||
case BIT_DeityKarana: { return DeityKarana; }
|
||||
case BIT_DeityMithanielMarr: { return DeityMithanielMarr; }
|
||||
case BIT_DeityPrexus: { return DeityPrexus; }
|
||||
case BIT_DeityQuellious: { return DeityQuellious; }
|
||||
case BIT_DeityRallosZek: { return DeityRallosZek; }
|
||||
case BIT_DeityRodcetNife: { return DeityRodcetNife; }
|
||||
case BIT_DeitySolusekRo: { return DeitySolusekRo; }
|
||||
case BIT_DeityTheTribunal: { return DeityTheTribunal; }
|
||||
case BIT_DeityTunare: { return DeityTunare; }
|
||||
case BIT_DeityVeeshan: { return DeityVeeshan; }
|
||||
default: { break; }
|
||||
};
|
||||
|
||||
return DeityUnknown;
|
||||
};
|
||||
|
||||
static std::string GetDeityName(DeityTypes deity)
|
||||
{
|
||||
switch(deity)
|
||||
{
|
||||
case DeityBertoxxulous: { return "Bertoxxulous"; }
|
||||
case DeityBrellSirilis: { return "Brell Serilis"; }
|
||||
case DeityCazicThule: { return "Cazic-Thule"; }
|
||||
case DeityErollisiMarr: { return "Erollisi Marr"; }
|
||||
case DeityBristlebane: { return "Bristlebane"; }
|
||||
case DeityInnoruuk: { return "Innoruuk"; }
|
||||
case DeityKarana: { return "Karana"; }
|
||||
case DeityMithanielMarr: { return "Mithaniel Marr"; }
|
||||
case DeityPrexus: { return "Prexus"; }
|
||||
case DeityQuellious: { return "Quellious"; }
|
||||
case DeityRallosZek: { return "Rallos Zek"; }
|
||||
case DeityRodcetNife: { return "Rodcet Nife"; }
|
||||
case DeitySolusekRo: { return "Solusek Ro"; }
|
||||
case DeityTheTribunal: { return "The Tribunal"; }
|
||||
case DeityTunare: { return "Tunare"; }
|
||||
case DeityVeeshan: { return "Veeshan"; }
|
||||
case DeityAgnostic_LB:
|
||||
case DeityAgnostic: { return "Agnostic"; }
|
||||
default: { break; }
|
||||
};
|
||||
|
||||
return "Unknown";
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -538,3 +538,6 @@ N(OP_MercenaryDismiss),
|
||||
N(OP_MercenaryTimerRequest),
|
||||
N(OP_OpenInventory),
|
||||
N(OP_OpenContainer),
|
||||
N(OP_Marquee),
|
||||
N(OP_ClientTimeStamp),
|
||||
N(OP_GuildPromote),
|
||||
|
||||
@@ -30,8 +30,8 @@ tremendously.
|
||||
#include <stdio.h>
|
||||
#include <iomanip>
|
||||
|
||||
#include "EmuTCPConnection.h"
|
||||
#include "EmuTCPServer.h"
|
||||
#include "emu_tcp_connection.h"
|
||||
#include "emu_tcp_server.h"
|
||||
#include "../common/servertalk.h"
|
||||
#include "../common/packet_dump.h"
|
||||
|
||||
@@ -171,7 +171,7 @@ bool EmuTCPConnection::SendPacket(ServerPacket* pack, uint32 iDestination) {
|
||||
struct in_addr in;
|
||||
in.s_addr = GetrIP();
|
||||
CoutTimestamp(true);
|
||||
std::cout << ": Logging outgoing TCP OldPacket. OPCode: 0x" << hex << setw(4) << setfill('0') << pack->opcode << dec << ", size: " << setw(5) << setfill(' ') << pack->size << " " << inet_ntoa(in) << ":" << GetrPort() << std::endl;
|
||||
std::cout << ": Logging outgoing TCP OldPacket. OPCode: 0x" << std::hex << std::setw(4) << std::setfill('0') << pack->opcode << std::dec << ", size: " << std::setw(5) << std::setfill(' ') << pack->size << " " << inet_ntoa(in) << ":" << GetrPort() << std::endl;
|
||||
#if TCPN_LOG_PACKETS == 2
|
||||
if (pack->size >= 32)
|
||||
DumpPacket(pack->pBuffer, 32);
|
||||
@@ -198,7 +198,7 @@ bool EmuTCPConnection::SendPacket(ServerPacket* pack, uint32 iDestination) {
|
||||
struct in_addr in;
|
||||
in.s_addr = GetrIP();
|
||||
CoutTimestamp(true);
|
||||
std::cout << ": Logging outgoing TCP packet. OPCode: 0x" << hex << setw(4) << setfill('0') << pack->opcode << dec << ", size: " << setw(5) << setfill(' ') << pack->size << " " << inet_ntoa(in) << ":" << GetrPort() << std::endl;
|
||||
std::cout << ": Logging outgoing TCP packet. OPCode: 0x" << std::hex << std::setw(4) << std::setfill('0') << pack->opcode << std::dec << ", size: " << std::setw(5) << std::setfill(' ') << pack->size << " " << inet_ntoa(in) << ":" << GetrPort() << std::endl;
|
||||
#if TCPN_LOG_PACKETS == 2
|
||||
if (pack->size >= 32)
|
||||
DumpPacket(pack->pBuffer, 32);
|
||||
@@ -237,7 +237,7 @@ bool EmuTCPConnection::SendPacket(EmuTCPNetPacket_Struct* tnps) {
|
||||
struct in_addr in;
|
||||
in.s_addr = GetrIP();
|
||||
CoutTimestamp(true);
|
||||
std::cout << ": Logging outgoing TCP NetPacket. OPCode: 0x" << hex << setw(4) << setfill('0') << tnps->opcode << dec << ", size: " << setw(5) << setfill(' ') << tnps->size << " " << inet_ntoa(in) << ":" << GetrPort();
|
||||
std::cout << ": Logging outgoing TCP NetPacket. OPCode: 0x" << std::hex << std::setw(4) << std::setfill('0') << tnps->opcode << std::dec << ", size: " << std::setw(5) << std::setfill(' ') << tnps->size << " " << inet_ntoa(in) << ":" << GetrPort();
|
||||
if (pOldFormat)
|
||||
std::cout << " (OldFormat)";
|
||||
std::cout << std::endl;
|
||||
@@ -366,7 +366,6 @@ bool EmuTCPConnection::LineOutQueuePush(char* line) {
|
||||
safe_delete_array(line);
|
||||
return(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return(TCPConnection::LineOutQueuePush(line));
|
||||
@@ -419,7 +418,8 @@ bool EmuTCPConnection::ConnectIP(uint32 irIP, uint16 irPort, char* errbuf) {
|
||||
sendbuf_used = sendbuf_size;
|
||||
sendbuf = new uchar[sendbuf_size];
|
||||
memcpy(sendbuf, "\0**PACKETMODEQS**\r", sendbuf_size);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
//default: packetModeZone
|
||||
safe_delete_array(sendbuf);
|
||||
sendbuf_size = 20;
|
||||
@@ -578,7 +578,7 @@ bool EmuTCPConnection::ProcessReceivedDataAsPackets(char* errbuf) {
|
||||
struct in_addr in;
|
||||
in.s_addr = GetrIP();
|
||||
CoutTimestamp(true);
|
||||
std::cout << ": Logging incoming TCP packet. OPCode: 0x" << hex << setw(4) << setfill('0') << pack->opcode << dec << ", size: " << setw(5) << setfill(' ') << pack->size << " " << inet_ntoa(in) << ":" << GetrPort() << std::endl;
|
||||
std::cout << ": Logging incoming TCP packet. OPCode: 0x" << std::hex << std::setw(4) << std::setfill('0') << pack->opcode << std::dec << ", size: " << std::setw(5) << std::setfill(' ') << pack->size << " " << inet_ntoa(in) << ":" << GetrPort() << std::endl;
|
||||
#if TCPN_LOG_PACKETS == 2
|
||||
if (pack->size >= 32)
|
||||
DumpPacket(pack->pBuffer, 32);
|
||||
@@ -663,7 +663,7 @@ bool EmuTCPConnection::ProcessReceivedDataAsOldPackets(char* errbuf) {
|
||||
struct in_addr in;
|
||||
in.s_addr = GetrIP();
|
||||
CoutTimestamp(true);
|
||||
std::cout << ": Logging incoming TCP OldPacket. OPCode: 0x" << hex << setw(4) << setfill('0') << pack->opcode << dec << ", size: " << setw(5) << setfill(' ') << pack->size << " " << inet_ntoa(in) << ":" << GetrPort() << std::endl;
|
||||
std::cout << ": Logging incoming TCP OldPacket. OPCode: 0x" << std::hex << std::setw(4) << std::setfill('0') << pack->opcode << std::dec << ", size: " << std::setw(5) << std::setfill(' ') << pack->size << " " << inet_ntoa(in) << ":" << GetrPort() << std::endl;
|
||||
#if TCPN_LOG_PACKETS == 2
|
||||
if (pack->size >= 32)
|
||||
DumpPacket(pack->pBuffer, 32);
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef EmuTCPCONNECTION_H_
|
||||
#define EmuTCPCONNECTION_H_
|
||||
|
||||
#include "TCPConnection.h"
|
||||
#include "tcp_connection.h"
|
||||
#include "timer.h"
|
||||
|
||||
//moved out of TCPConnection:: to be more exportable
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "debug.h"
|
||||
#include "EmuTCPServer.h"
|
||||
#include "EmuTCPConnection.h"
|
||||
#include "emu_tcp_server.h"
|
||||
#include "emu_tcp_connection.h"
|
||||
|
||||
EmuTCPServer::EmuTCPServer(uint16 iPort, bool iOldFormat)
|
||||
: TCPServer<EmuTCPConnection>(iPort),
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef EmuTCPSERVER_H_
|
||||
#define EmuTCPSERVER_H_
|
||||
|
||||
#include "TCPServer.h"
|
||||
#include "tcp_server.h"
|
||||
|
||||
class EmuTCPConnection;
|
||||
struct EmuTCPNetPacket_Struct;
|
||||
+595
-284
@@ -21,97 +21,311 @@
|
||||
#include "skills.h"
|
||||
|
||||
/*
|
||||
** Item attributes
|
||||
** Item attributes
|
||||
**
|
||||
** (There are no grepwin hits other than these declarations... Do they have a use?)
|
||||
*/
|
||||
enum ItemAttrib
|
||||
enum ItemAttributes : uint32
|
||||
{
|
||||
ItemAttribLore = (1 << 0),
|
||||
ItemAttribArtifact = (1 << 1),
|
||||
ItemAttribSummoned = (1 << 2),
|
||||
ItemAttribMagic = (1 << 3),
|
||||
ItemAttribAugment = (1 << 4),
|
||||
ItemAttribPendingLore = (1 << 5),
|
||||
ItemAttribNone = 0,
|
||||
ItemAttribUnknown = 0xFFFFFFFF
|
||||
ItemAttrNone = 0x00000000,
|
||||
ItemAttrLore = 0x00000001,
|
||||
ItemAttrArtifact = 0x00000002,
|
||||
ItemAttrSummoned = 0x00000004,
|
||||
ItemAttrMagic = 0x00000008,
|
||||
ItemAttrAugment = 0x00000010,
|
||||
ItemAttrPendingLore = 0x00000020,
|
||||
ItemAttrUnknown = 0xFFFFFFFF
|
||||
};
|
||||
|
||||
/*
|
||||
** Item types
|
||||
** Item class types
|
||||
**
|
||||
*/
|
||||
enum ItemClass
|
||||
enum ItemClassTypes
|
||||
{
|
||||
ItemClassCommon = 0,
|
||||
ItemClassContainer = 1,
|
||||
ItemClassBook = 2
|
||||
ItemClassCommon = 0,
|
||||
ItemClassContainer,
|
||||
ItemClassBook,
|
||||
_ItemClassCount
|
||||
};
|
||||
|
||||
/*
|
||||
** Item uses
|
||||
** Item use types
|
||||
**
|
||||
** (ref: database and eqstr_us.txt)
|
||||
**
|
||||
** (Looking at a recent database, it's possible that some of the item values may be off [10-27-2013] -U)
|
||||
*/
|
||||
enum ItemTypes
|
||||
enum ItemUseTypes : uint8
|
||||
{
|
||||
ItemType1HS = 0,
|
||||
ItemType2HS = 1,
|
||||
ItemTypePierce = 2,
|
||||
ItemType1HB = 3,
|
||||
ItemType2HB = 4,
|
||||
ItemTypeBow = 5,
|
||||
//6
|
||||
ItemTypeThrowing = 7,
|
||||
ItemTypeShield = 8,
|
||||
//9
|
||||
ItemTypeArmor = 10,
|
||||
ItemTypeUnknon = 11, //A lot of random crap has this item use.
|
||||
ItemTypeLockPick = 12,
|
||||
ItemTypeFood = 14,
|
||||
ItemTypeDrink = 15,
|
||||
ItemTypeLightSource = 16,
|
||||
ItemTypeStackable = 17, //Not all stackable items are this use...
|
||||
ItemTypeBandage = 18,
|
||||
ItemTypeThrowingv2 = 19,
|
||||
ItemTypeSpell = 20, //spells and tomes
|
||||
ItemTypePotion = 21,
|
||||
ItemTypeWindInstr = 23,
|
||||
ItemTypeStringInstr = 24,
|
||||
ItemTypeBrassInstr = 25,
|
||||
ItemTypeDrumInstr = 26,
|
||||
ItemTypeArrow = 27,
|
||||
ItemTypeJewlery = 29,
|
||||
ItemTypeSkull = 30,
|
||||
ItemTypeTome = 31,
|
||||
ItemTypeNote = 32,
|
||||
ItemTypeKey = 33,
|
||||
ItemTypeCoin = 34,
|
||||
ItemType2HPierce = 35,
|
||||
ItemTypeFishingPole = 36,
|
||||
ItemTypeFishingBait = 37,
|
||||
ItemTypeAlcohol = 38,
|
||||
ItemTypeCompass = 40,
|
||||
ItemTypePoison = 42, //might be wrong, but includes poisons
|
||||
ItemTypeHand2Hand = 45,
|
||||
ItemUseSinging = 50,
|
||||
ItemUseAllInstruments = 51,
|
||||
ItemTypeCharm = 52,
|
||||
ItemTypeAugment = 54,
|
||||
ItemTypeAugmentSolvent = 55,
|
||||
ItemTypeAugmentDistill = 56
|
||||
/*9138*/ ItemType1HSlash = 0,
|
||||
/*9141*/ ItemType2HSlash,
|
||||
/*9140*/ ItemType1HPiercing,
|
||||
/*9139*/ ItemType1HBlunt,
|
||||
/*9142*/ ItemType2HBlunt,
|
||||
/*5504*/ ItemTypeBow,
|
||||
/*----*/ ItemTypeUnknown1,
|
||||
/*----*/ ItemTypeLargeThrowing,
|
||||
/*5505*/ ItemTypeShield,
|
||||
/*5506*/ ItemTypeScroll,
|
||||
/*5507*/ ItemTypeArmor,
|
||||
/*5508*/ ItemTypeMisc, // a lot of random crap has this item use.
|
||||
/*7564*/ ItemTypeLockPick,
|
||||
/*----*/ ItemTypeUnknown2,
|
||||
/*5509*/ ItemTypeFood,
|
||||
/*5510*/ ItemTypeDrink,
|
||||
/*5511*/ ItemTypeLight,
|
||||
/*5512*/ ItemTypeCombinable, // not all stackable items are this use...
|
||||
/*5513*/ ItemTypeBandage,
|
||||
/*----*/ ItemTypeSmallThrowing,
|
||||
/*----*/ ItemTypeSpell, // spells and tomes
|
||||
/*5514*/ ItemTypePotion,
|
||||
/*----*/ ItemTypeUnknown3,
|
||||
/*0406*/ ItemTypeWindInstrument,
|
||||
/*0407*/ ItemTypeStringedInstrument,
|
||||
/*0408*/ ItemTypeBrassInstrument,
|
||||
/*0405*/ ItemTypePercussionInstrument,
|
||||
/*5515*/ ItemTypeArrow,
|
||||
/*----*/ ItemTypeUnknown4,
|
||||
/*5521*/ ItemTypeJewelry,
|
||||
/*----*/ ItemTypeSkull,
|
||||
/*5516*/ ItemTypeBook, // skill-up tomes/books? (would probably need a pp flag if true...)
|
||||
/*5517*/ ItemTypeNote,
|
||||
/*5518*/ ItemTypeKey,
|
||||
/*----*/ ItemTypeCoin,
|
||||
/*5520*/ ItemType2HPiercing,
|
||||
/*----*/ ItemTypeFishingPole,
|
||||
/*----*/ ItemTypeFishingBait,
|
||||
/*5519*/ ItemTypeAlcohol,
|
||||
/*----*/ ItemTypeKey2, // keys and satchels?? (questable keys?)
|
||||
/*----*/ ItemTypeCompass,
|
||||
/*----*/ ItemTypeUnknown5,
|
||||
/*----*/ ItemTypePoison, // might be wrong, but includes poisons
|
||||
/*----*/ ItemTypeUnknown6,
|
||||
/*----*/ ItemTypeUnknown7,
|
||||
/*5522*/ ItemTypeMartial,
|
||||
/*----*/ ItemTypeUnknown8,
|
||||
/*----*/ ItemTypeUnknown9,
|
||||
/*----*/ ItemTypeUnknown10,
|
||||
/*----*/ ItemTypeUnknown11,
|
||||
/*----*/ ItemTypeSinging,
|
||||
/*5750*/ ItemTypeAllInstrumentTypes,
|
||||
/*5776*/ ItemTypeCharm,
|
||||
/*----*/ ItemTypeDye,
|
||||
/*----*/ ItemTypeAugmentation,
|
||||
/*----*/ ItemTypeAugmentationSolvent,
|
||||
/*----*/ ItemTypeAugmentationDistiller,
|
||||
/*----*/ ItemTypeUnknown12,
|
||||
/*----*/ ItemTypeFellowshipKit,
|
||||
/*----*/ ItemTypeUnknown13,
|
||||
/*----*/ ItemTypeRecipe,
|
||||
/*----*/ ItemTypeAdvancedRecipe,
|
||||
/*----*/ ItemTypeJournal, // only one(1) database entry
|
||||
/*----*/ ItemTypeAltCurrency, // alt-currency (as opposed to coinage)
|
||||
/*5881*/ ItemTypePerfectedAugmentationDistiller,
|
||||
/*----*/ _ItemTypeCount
|
||||
|
||||
/*
|
||||
Unknowns:
|
||||
|
||||
Mounts?
|
||||
Ornamentations?
|
||||
GuildBanners?
|
||||
Collectible?
|
||||
Placeable?
|
||||
(others?)
|
||||
*/
|
||||
};
|
||||
|
||||
/*
|
||||
Bag types
|
||||
** Augmentation use type bitmasks (1-based)
|
||||
**
|
||||
** (ref: dbstr_us.txt)
|
||||
**
|
||||
*/
|
||||
enum {
|
||||
bagTypeSmallBag = 0,
|
||||
bagTypeLargeBag = 1,
|
||||
bagTypeQuiver = 2,
|
||||
bagTypeBeltPouch = 3,
|
||||
bagTypeBandolier = 8
|
||||
//... there are 50 types
|
||||
enum AugmentationUseTypeBitmasks : uint32 {
|
||||
AugUseNone = 0x00000000,
|
||||
AugUseGeneralSingleStat = 0x00000001, /*1^16^1 (General: Single Stat)^0*/
|
||||
AugUseGeneralMultipleStat = 0x00000002, /*2^16^2 (General: Multiple Stat)^0*/
|
||||
AugUseGeneralSpellEffect = 0x00000004, /*3^16^3 (General: Spell Effect)^0*/
|
||||
AugUseWeaponGeneral = 0x00000008, /*4^16^4 (Weapon: General)^0*/
|
||||
AugUseWeaponElemDamage = 0x00000010, /*5^16^5 (Weapon: Elem Damage)^0*/
|
||||
AugUseWeaponBaseDamage = 0x00000020, /*6^16^6 (Weapon: Base Damage)^0*/
|
||||
AugUseGeneralGroup = 0x00000040, /*7^16^7 (General: Group)^0*/
|
||||
AugUseGeneralRaid = 0x00000080, /*8^16^8 (General: Raid)^0*/
|
||||
AugUseGeneralDragonsPoints = 0x00000100, /*9^16^9 (General: Dragons Points)^0*/
|
||||
AugUseCraftedCommon = 0x00000200, /*10^16^10 (Crafted: Common)^0*/
|
||||
AugUseCraftedGroup1 = 0x00000400, /*11^16^11 (Crafted: Group)^0*/
|
||||
AugUseCraftedRaid1 = 0x00000800, /*12^16^12 (Crafted: Raid)^0*/
|
||||
AugUseEnergeiacGroup = 0x00001000, /*13^16^13 (Energeiac: Group)^0*/
|
||||
AugUseEnergeiacRaid = 0x00002000, /*14^16^14 (Energeiac: Raid)^0*/
|
||||
AugUseEmblem = 0x00004000, /*15^16^15 (Emblem)^0*/
|
||||
AugUseCraftedGroup2 = 0x00008000, /*16^16^16 (Crafted: Group)^0*/
|
||||
AugUseCraftedRaid2 = 0x00010000, /*17^16^17 (Crafted: Raid)^0*/
|
||||
AugUseUnknown1 = 0x00020000, /*18^16^18^0*/
|
||||
AugUseUnknown2 = 0x00040000, /*19^16^19^0*/
|
||||
AugUseOrnamentation = 0x00080000, /*20^16^20 (Ornamentation)^0*/
|
||||
AugUseSpecialOrnamentation = 0x00100000, /*21^16^21 (Special Ornamentation)^0*/
|
||||
AugUseUnknown3 = 0x00200000, /*22^16^22^0*/
|
||||
AugUseUnknown4 = 0x00400000, /*23^16^23^0*/
|
||||
AugUseUnknown5 = 0x00800000, /*24^16^24^0*/
|
||||
AugUseUnknown6 = 0x01000000, /*25^16^25^0*/
|
||||
AugUseUnknown7 = 0x02000000, /*26^16^26^0*/
|
||||
AugUseUnknown8 = 0x04000000, /*27^16^27^0*/
|
||||
AugUseUnknown9 = 0x08000000, /*28^16^28^0*/
|
||||
AugUseUnknown10 = 0x10000000, /*29^16^29^0*/
|
||||
AugUseEpic25 = 0x20000000, /*30^16^30^0*/
|
||||
AugUseTest = 0x40000000, /*31^16^Test^0*/ // listed as 31^16^31^0 in 5-10 client
|
||||
AugUseAll = 0xFFFFFFFF
|
||||
};
|
||||
|
||||
/*
|
||||
** Augmentation use types (enumerated)
|
||||
**
|
||||
*/
|
||||
enum AugmentationUseTypes : uint8 {
|
||||
AugTypeNone = 0,
|
||||
AugTypeGeneralSingleStat,
|
||||
AugTypeGeneralMultipleStat,
|
||||
AugTypeGeneralSpellEffect,
|
||||
AugTypeWeaponGeneral,
|
||||
AugTypeWeaponElemDamage,
|
||||
AugTypeWeaponBaseDamage,
|
||||
AugTypeGeneralGroup,
|
||||
AugTypeGeneralRaid,
|
||||
AugTypeGeneralDragonsPoints,
|
||||
AugTypeCraftedCommon,
|
||||
AugTypeCraftedGroup1,
|
||||
AugTypeCraftedRaid1,
|
||||
AugTypeEnergeiacGroup,
|
||||
AugTypeEnergeiacRaid,
|
||||
AugTypeEmblem,
|
||||
AugTypeCraftedGroup2,
|
||||
AugTypeCraftedRaid2,
|
||||
AugTypeUnknown1,
|
||||
AugTypeUnknown2,
|
||||
AugTypeOrnamentation,
|
||||
AugTypeSpecialOrnamentation,
|
||||
AugTypeUnknown3,
|
||||
AugTypeUnknown4,
|
||||
AugTypeUnknown5,
|
||||
AugTypeUnknown6,
|
||||
AugTypeUnknown7,
|
||||
AugTypeUnknown8,
|
||||
AugTypeUnknown9,
|
||||
AugTypeUnknown10,
|
||||
AugTypeEpic25,
|
||||
AugTypeTest,
|
||||
_AugTypeCount,
|
||||
AugTypeAll = 255
|
||||
};
|
||||
|
||||
/*
|
||||
** Augmentation restriction types (in-work)
|
||||
**
|
||||
** (ref: eqstr_us.txt)
|
||||
**
|
||||
*/
|
||||
enum AugmentationRestrictionTypes : uint8 {
|
||||
/*4690*/ AugRestrAny = 0,
|
||||
/*9134*/ AugRestrArmor,
|
||||
/*9135*/ AugRestrWeapons,
|
||||
/*9136*/ AugRestr1HWeapons,
|
||||
/*9137*/ AugRestr2HWeapons,
|
||||
/*9138*/ AugRestr1HSlash,
|
||||
/*9139*/ AugRestr1HBlunt,
|
||||
/*9140*/ AugRestrPiercing,
|
||||
/*9148*/ AugRestrHandToHand,
|
||||
/*9141*/ AugRestr2HSlash,
|
||||
/*9142*/ AugRestr2HBlunt,
|
||||
/*9143*/ AugRestr2HPierce,
|
||||
/*9144*/ AugRestrBows,
|
||||
/*9145*/ AugRestrShields,
|
||||
/*8052*/ AugRestr1HSlash1HBluntOrHandToHand,
|
||||
/*9200*/ AugRestr1HBluntOrHandToHand, // no listed peq entries
|
||||
|
||||
// these three appear to be post-RoF (12-10-2012) and can not be verified until RoF (05-10-2013) is supported
|
||||
/*????*/ AugRestrUnknown1,
|
||||
/*????*/ AugRestrUnknown2,
|
||||
/*????*/ AugRestrUnknown3, // last value in peq entries
|
||||
_AugRestrCount
|
||||
|
||||
/*4687*/ //AugTypeAllItems, // ?? unknown atm
|
||||
/*4688*/ //AugTypePrestige, // ?? unknown atm
|
||||
/*4689*/ //AugTypeNonPrestige, // ?? unknown atm
|
||||
};
|
||||
|
||||
/*
|
||||
** Container use types
|
||||
**
|
||||
** This correlates to world 'object.type' (object.h/Object.cpp) as well as Item_Struct.BagType
|
||||
**
|
||||
** (ref: database, web forums and eqstr_us.txt)
|
||||
*/
|
||||
enum ContainerUseTypes : uint8
|
||||
{
|
||||
/*3400*/ BagTypeSmallBag = 0,
|
||||
/*3401*/ BagTypeLargeBag,
|
||||
/*3402*/ BagTypeQuiver,
|
||||
/*3403*/ BagTypeBeltPouch,
|
||||
/*3404*/ BagTypeWristPouch,
|
||||
/*3405*/ BagTypeBackPack,
|
||||
/*3406*/ BagTypeSmallChest,
|
||||
/*3407*/ BagTypeLargeChest,
|
||||
/*----*/ BagTypeBandolier, // <*Database Reference Only>
|
||||
/*3408*/ BagTypeMedicineBag,
|
||||
/*3409*/ BagTypeToolBox,
|
||||
/*3410*/ BagTypeLexicon,
|
||||
/*3411*/ BagTypeMortar,
|
||||
/*3412*/ BagTypeSelfDusting, // Quest container (Auto-clear contents?)
|
||||
/*3413*/ BagTypeMixingBowl,
|
||||
/*3414*/ BagTypeOven,
|
||||
/*3415*/ BagTypeSewingKit,
|
||||
/*3416*/ BagTypeForge,
|
||||
/*3417*/ BagTypeFletchingKit,
|
||||
/*3418*/ BagTypeBrewBarrel,
|
||||
/*3419*/ BagTypeJewelersKit,
|
||||
/*3420*/ BagTypePotteryWheel,
|
||||
/*3421*/ BagTypeKiln,
|
||||
/*3422*/ BagTypeKeymaker, // (no database entries as of peq rev 69)
|
||||
/*3423*/ BagTypeWizardsLexicon,
|
||||
/*3424*/ BagTypeMagesLexicon,
|
||||
/*3425*/ BagTypeNecromancersLexicon,
|
||||
/*3426*/ BagTypeEnchantersLexicon,
|
||||
/*----*/ BagTypeUnknown1, // (a coin pouch/purse?) (no database entries as of peq rev 69)
|
||||
/*----*/ BagTypeConcordanceofResearch, // <*Database Reference Only>
|
||||
/*3427*/ BagTypeAlwaysWorks, // Quest container (Never-fail combines?)
|
||||
/*3428*/ BagTypeKoadaDalForge, // High Elf
|
||||
/*3429*/ BagTypeTeirDalForge, // Dark Elf
|
||||
/*3430*/ BagTypeOggokForge, // Ogre
|
||||
/*3431*/ BagTypeStormguardForge, // Dwarf
|
||||
/*3432*/ BagTypeAkanonForge, // Gnome
|
||||
/*3433*/ BagTypeNorthmanForge, // Barbarian
|
||||
/*----*/ BagTypeUnknown2, // (no database entries as of peq rev 69)
|
||||
/*3434*/ BagTypeCabilisForge, // Iksar
|
||||
/*3435*/ BagTypeFreeportForge, // Human 1
|
||||
/*3436*/ BagTypeRoyalQeynosForge, // Human 2
|
||||
/*3439*/ BagTypeHalflingTailoringKit,
|
||||
/*3438*/ BagTypeErudTailoringKit,
|
||||
/*3440*/ BagTypeFierDalTailoringKit, // Wood Elf
|
||||
/*3441*/ BagTypeFierDalFletchingKit, // Wood Elf
|
||||
/*3437*/ BagTypeIksarPotteryWheel,
|
||||
/*3442*/ BagTypeTackleBox,
|
||||
/*3443*/ BagTypeTrollForge,
|
||||
/*3445*/ BagTypeFierDalForge, // Wood Elf
|
||||
/*3444*/ BagTypeValeForge, // Halfling
|
||||
/*3446*/ BagTypeErudForge,
|
||||
/*----*/ BagTypeTradersSatchel, // <*Database Reference Only> (db: Yellow Trader's Satchel Token?)
|
||||
/*5785*/ BagTypeGuktaForge, // Froglok (no database entries as of peq rev 69)
|
||||
/*3359*/ BagTypeAugmentationSealer,
|
||||
/*----*/ BagTypeIceCreamChurn, // <*Database Reference Only>
|
||||
/*6325*/ BagTypeTransformationmold, // Ornamentation
|
||||
/*6340*/ BagTypeDetransformationmold, // Ornamentation Stripper
|
||||
/*5400*/ BagTypeUnattuner,
|
||||
/*7684*/ BagTypeTradeskillBag,
|
||||
/*7692*/ BagTypeCollectibleBag,
|
||||
/*----*/ _BagTypeCount
|
||||
};
|
||||
|
||||
/*
|
||||
** Item Effect Types
|
||||
@@ -170,30 +384,6 @@ typedef enum {
|
||||
_eaMaxAppearance
|
||||
} EmuAppearance;
|
||||
|
||||
/*
|
||||
** Diety List
|
||||
*/
|
||||
#define DEITY_UNKNOWN 0
|
||||
#define DEITY_AGNOSTIC 396
|
||||
#define DEITY_BRELL 202
|
||||
#define DEITY_CAZIC 203
|
||||
#define DEITY_EROL 204
|
||||
#define DEITY_BRISTLE 205
|
||||
#define DEITY_INNY 206
|
||||
#define DEITY_KARANA 207
|
||||
#define DEITY_MITH 208
|
||||
#define DEITY_PREXUS 209
|
||||
#define DEITY_QUELLIOUS 210
|
||||
#define DEITY_RALLOS 211
|
||||
#define DEITY_SOLUSEK 213
|
||||
#define DEITY_TRIBUNAL 214
|
||||
#define DEITY_TUNARE 215
|
||||
|
||||
//Guessed:
|
||||
#define DEITY_BERT 201
|
||||
#define DEITY_RODCET 212
|
||||
#define DEITY_VEESHAN 216
|
||||
|
||||
// msg_type's for custom usercolors
|
||||
#define MT_Say 256
|
||||
#define MT_Tell 257
|
||||
@@ -435,31 +625,34 @@ typedef enum {
|
||||
#define STAT_HASTE 19
|
||||
#define STAT_DAMAGE_SHIELD 20
|
||||
|
||||
/**
|
||||
* Recast timer types. Used as an off set to charProfileStruct timers.
|
||||
/*
|
||||
** Recast timer types. Used as an off set to charProfileStruct timers.
|
||||
**
|
||||
** (Another orphaned enumeration...)
|
||||
*/
|
||||
enum RecastTypes
|
||||
enum RecastTimerTypes
|
||||
{
|
||||
RecastTimer0 = 0,
|
||||
RecastTimer1,
|
||||
WeaponHealClickTimer, // 2
|
||||
MuramiteBaneNukeClickTimer, // 3
|
||||
RecastTimer4,
|
||||
DispellClickTimer, // 5 (also click heal orbs?)
|
||||
EpicTimer, // 6
|
||||
OoWBPClickTimer, // 7
|
||||
VishQuestClassItemTimer, // 8
|
||||
HealPotionTimer, // 9
|
||||
RecastTimer10,
|
||||
RecastTimer11,
|
||||
RecastTimer12,
|
||||
RecastTimer13,
|
||||
RecastTimer14,
|
||||
RecastTimer15,
|
||||
RecastTimer16,
|
||||
RecastTimer17,
|
||||
RecastTimer18,
|
||||
ModRodTimer // 19
|
||||
RecTimer_0 = 0,
|
||||
RecTimer_1,
|
||||
RecTimer_WeaponHealClick, // 2
|
||||
RecTimer_MuramiteBaneNukeClick, // 3
|
||||
RecTimer_4,
|
||||
RecTimer_DispellClick, // 5 (also click heal orbs?)
|
||||
RecTimer_Epic, // 6
|
||||
RecTimer_OoWBPClick, // 7
|
||||
RecTimer_VishQuestClassItem, // 8
|
||||
RecTimer_HealPotion, // 9
|
||||
RecTimer_10,
|
||||
RecTimer_11,
|
||||
RecTimer_12,
|
||||
RecTimer_13,
|
||||
RecTimer_14,
|
||||
RecTimer_15,
|
||||
RecTimer_16,
|
||||
RecTimer_17,
|
||||
RecTimer_18,
|
||||
RecTimer_ModRod, // 19
|
||||
_RecTimerCount
|
||||
};
|
||||
|
||||
enum GroupUpdateAction
|
||||
@@ -472,189 +665,307 @@ enum GroupUpdateAction
|
||||
GUA_Started = 9
|
||||
};
|
||||
|
||||
//0x1c is something...
|
||||
static const uint8 FallingDamageType = 0xFC;
|
||||
static const uint8 SpellDamageType = 0xe7;
|
||||
static const uint8 DamageTypeUnknown = 0xFF;
|
||||
static const uint8 DamageTypeSomething = 0x1C; //0x1c is something...
|
||||
static const uint8 DamageTypeFalling = 0xFC;
|
||||
static const uint8 DamageTypeSpell = 0xE7;
|
||||
static const uint8 DamageTypeUnknown = 0xFF;
|
||||
|
||||
//indexed by 'SkillType'
|
||||
static const uint8 SkillDamageTypes[HIGHEST_SKILL+1] = {
|
||||
/* _1H_BLUNT */ 0,
|
||||
/* _1H_SLASHING */ 1,
|
||||
/* _2H_BLUNT */ 0,
|
||||
/* _2H_SLASHING */ 1,
|
||||
/* ABJURE */ SpellDamageType,
|
||||
/* ALTERATION */ SpellDamageType,
|
||||
/* APPLY_POISON */ DamageTypeUnknown,
|
||||
/* ARCHERY */ 7,
|
||||
/* BACKSTAB */ 8,
|
||||
/* BIND_WOUND */ DamageTypeUnknown,
|
||||
/* BASH */ 10,
|
||||
/* BLOCKSKILL */ DamageTypeUnknown,
|
||||
/* BRASS_INSTRUMENTS */ SpellDamageType,
|
||||
/* CHANNELING */ DamageTypeUnknown,
|
||||
/* CONJURATION */ SpellDamageType,
|
||||
/* DEFENSE */ DamageTypeUnknown,
|
||||
/* DISARM */ DamageTypeUnknown,
|
||||
/* DISARM_TRAPS */ DamageTypeUnknown,
|
||||
/* DIVINATION */ SpellDamageType,
|
||||
/* DODGE */ DamageTypeUnknown,
|
||||
/* DOUBLE_ATTACK */ DamageTypeUnknown,
|
||||
/* DRAGON_PUNCH */ 21,
|
||||
/* DUAL_WIELD */ DamageTypeUnknown,
|
||||
/* EAGLE_STRIKE */ 23,
|
||||
/* EVOCATION */ SpellDamageType,
|
||||
/* FEIGN_DEATH */ 4,
|
||||
/* FLYING_KICK */ 30,
|
||||
/* FORAGE */ DamageTypeUnknown,
|
||||
/* HAND_TO_HAND */ 4,
|
||||
/* HIDE */ DamageTypeUnknown,
|
||||
/* KICK */ 30,
|
||||
/* MEDITATE */ DamageTypeUnknown,
|
||||
/* MEND */ DamageTypeUnknown,
|
||||
/* OFFENSE */ DamageTypeUnknown,
|
||||
/* PARRY */ DamageTypeUnknown,
|
||||
/* PICK_LOCK */ DamageTypeUnknown,
|
||||
/* PIERCING */ 36,
|
||||
/* RIPOSTE */ DamageTypeUnknown,
|
||||
/* ROUND_KICK */ 30,
|
||||
/* SAFE_FALL */ DamageTypeUnknown,
|
||||
/* SENSE_HEADING */ DamageTypeUnknown,
|
||||
/* SINGING */ SpellDamageType,
|
||||
/* SNEAK */ DamageTypeUnknown,
|
||||
/* SPECIALIZE_ABJURE */ DamageTypeUnknown,
|
||||
/* SPECIALIZE_ALTERATION */ DamageTypeUnknown,
|
||||
/* SPECIALIZE_CONJURATION */ DamageTypeUnknown,
|
||||
/* SPECIALIZE_DIVINATION */ DamageTypeUnknown,
|
||||
/* SPECIALIZE_EVOCATION */ DamageTypeUnknown,
|
||||
/* PICK_POCKETS */ DamageTypeUnknown,
|
||||
/* STRINGED_INSTRUMENTS */ SpellDamageType,
|
||||
/* SWIMMING */ DamageTypeUnknown,
|
||||
/* THROWING */ 51,
|
||||
/* TIGER_CLAW */ 23,
|
||||
/* TRACKING */ DamageTypeUnknown,
|
||||
/* WIND_INSTRUMENTS */ SpellDamageType,
|
||||
/* FISHING */ DamageTypeUnknown,
|
||||
/* MAKE_POISON */ DamageTypeUnknown,
|
||||
/* TINKERING */ DamageTypeUnknown,
|
||||
/* RESEARCH */ DamageTypeUnknown,
|
||||
/* ALCHEMY */ DamageTypeUnknown,
|
||||
/* BAKING */ DamageTypeUnknown,
|
||||
/* TAILORING */ DamageTypeUnknown,
|
||||
/* SENSE_TRAPS */ DamageTypeUnknown,
|
||||
/* BLACKSMITHING */ DamageTypeUnknown,
|
||||
/* FLETCHING */ DamageTypeUnknown,
|
||||
/* BREWING */ DamageTypeUnknown,
|
||||
/* ALCOHOL_TOLERANCE */ DamageTypeUnknown,
|
||||
/* BEGGING */ DamageTypeUnknown,
|
||||
/* JEWELRY_MAKING */ DamageTypeUnknown,
|
||||
/* POTTERY */ DamageTypeUnknown,
|
||||
/* PERCUSSION_INSTRUMENTS */ SpellDamageType,
|
||||
/* INTIMIDATION */ DamageTypeUnknown,
|
||||
/* BERSERKING */ DamageTypeUnknown,
|
||||
/* TAUNT */ DamageTypeUnknown,
|
||||
/* FRENZY */ 74
|
||||
/*
|
||||
** Skill damage types
|
||||
**
|
||||
** (indexed by 'Skill' of SkillUseTypes)
|
||||
*/
|
||||
static const uint8 SkillDamageTypes[HIGHEST_SKILL + 1] = // change to _SkillServerArraySize once activated
|
||||
{
|
||||
/*1HBlunt*/ 0,
|
||||
/*1HSlashing*/ 1,
|
||||
/*2HBlunt*/ 0,
|
||||
/*2HSlashing*/ 1,
|
||||
/*Abjuration*/ DamageTypeSpell,
|
||||
/*Alteration*/ DamageTypeSpell,
|
||||
/*ApplyPoison*/ DamageTypeUnknown,
|
||||
/*Archery*/ 7,
|
||||
/*Backstab*/ 8,
|
||||
/*BindWound*/ DamageTypeUnknown,
|
||||
/*Bash*/ 10,
|
||||
/*Block*/ DamageTypeUnknown,
|
||||
/*BrassInstruments*/ DamageTypeSpell,
|
||||
/*Channeling*/ DamageTypeUnknown,
|
||||
/*Conjuration*/ DamageTypeSpell,
|
||||
/*Defense*/ DamageTypeUnknown,
|
||||
/*Disarm*/ DamageTypeUnknown,
|
||||
/*DisarmTraps*/ DamageTypeUnknown,
|
||||
/*Divination*/ DamageTypeSpell,
|
||||
/*Dodge*/ DamageTypeUnknown,
|
||||
/*DoubleAttack*/ DamageTypeUnknown,
|
||||
/*DragonPunch*/ 21,
|
||||
/*DualWield*/ DamageTypeUnknown,
|
||||
/*EagleStrike*/ 23,
|
||||
/*Evocation*/ DamageTypeSpell,
|
||||
/*FeignDeath*/ 4,
|
||||
/*FlyingKick*/ 30,
|
||||
/*Forage*/ DamageTypeUnknown,
|
||||
/*HandtoHand*/ 4,
|
||||
/*Hide*/ DamageTypeUnknown,
|
||||
/*Kick*/ 30,
|
||||
/*Meditate*/ DamageTypeUnknown,
|
||||
/*Mend*/ DamageTypeUnknown,
|
||||
/*Offense*/ DamageTypeUnknown,
|
||||
/*Parry*/ DamageTypeUnknown,
|
||||
/*PickLock*/ DamageTypeUnknown,
|
||||
/*1HPiercing*/ 36,
|
||||
/*Riposte*/ DamageTypeUnknown,
|
||||
/*RoundKick*/ 30,
|
||||
/*SafeFall*/ DamageTypeUnknown,
|
||||
/*SsenseHeading*/ DamageTypeUnknown,
|
||||
/*Singing*/ DamageTypeSpell,
|
||||
/*Sneak*/ DamageTypeUnknown,
|
||||
/*SpecializeAbjure*/ DamageTypeUnknown,
|
||||
/*SpecializeAlteration*/ DamageTypeUnknown,
|
||||
/*SpecializeConjuration*/ DamageTypeUnknown,
|
||||
/*SpecializeDivination*/ DamageTypeUnknown,
|
||||
/*SpecializeEvocation*/ DamageTypeUnknown,
|
||||
/*PickPockets*/ DamageTypeUnknown,
|
||||
/*StringedInstruments*/ DamageTypeSpell,
|
||||
/*Swimming*/ DamageTypeUnknown,
|
||||
/*Throwing*/ 51,
|
||||
/*TigerClaw*/ 23,
|
||||
/*Tracking*/ DamageTypeUnknown,
|
||||
/*WindInstruments*/ DamageTypeSpell,
|
||||
/*Fishing*/ DamageTypeUnknown,
|
||||
/*MakePoison*/ DamageTypeUnknown,
|
||||
/*Tinkering*/ DamageTypeUnknown,
|
||||
/*Research*/ DamageTypeUnknown,
|
||||
/*Alchemy*/ DamageTypeUnknown,
|
||||
/*Baking*/ DamageTypeUnknown,
|
||||
/*Tailoring*/ DamageTypeUnknown,
|
||||
/*SenseTraps*/ DamageTypeUnknown,
|
||||
/*Blacksmithing*/ DamageTypeUnknown,
|
||||
/*Fletching*/ DamageTypeUnknown,
|
||||
/*Brewing*/ DamageTypeUnknown,
|
||||
/*AlcoholTolerance*/ DamageTypeUnknown,
|
||||
/*Begging*/ DamageTypeUnknown,
|
||||
/*JewelryMaking*/ DamageTypeUnknown,
|
||||
/*Pottery*/ DamageTypeUnknown,
|
||||
/*PercussionInstruments*/ DamageTypeSpell,
|
||||
/*Intimidation*/ DamageTypeUnknown,
|
||||
/*Berserking*/ DamageTypeUnknown,
|
||||
/*Taunt*/ DamageTypeUnknown,
|
||||
/*Frenzy*/ 74 //,
|
||||
// /*RemoveTrap*/ DamageTypeUnknown, // Needs research (set for SenseTrap value)
|
||||
// /*TripleAttack*/ DamageTypeUnknown, // Needs research (set for DoubleAttack value)
|
||||
// /*2HPiercing*/ 36 // Needs research (set for 1HPiercing value - similar to slash/blunt)
|
||||
};
|
||||
|
||||
// Indexing positions into item material arrays
|
||||
#define MATERIAL_HEAD 0
|
||||
#define MATERIAL_CHEST 1
|
||||
#define MATERIAL_ARMS 2
|
||||
#define MATERIAL_BRACER 3
|
||||
#define MATERIAL_HANDS 4
|
||||
#define MATERIAL_LEGS 5
|
||||
#define MATERIAL_FEET 6
|
||||
#define MATERIAL_PRIMARY 7
|
||||
#define MATERIAL_SECONDARY 8
|
||||
#define MAX_MATERIALS 9 //number of equipables
|
||||
/*
|
||||
** Material use slots
|
||||
**
|
||||
*/
|
||||
enum MaterialUseSlots : uint8
|
||||
{
|
||||
MaterialHead = 0,
|
||||
MaterialChest,
|
||||
MaterialArms,
|
||||
MaterialWrist,
|
||||
MaterialHands,
|
||||
MaterialLegs,
|
||||
MaterialFeet,
|
||||
MaterialPrimary,
|
||||
MaterialSecondary,
|
||||
_MaterialCount,
|
||||
_MaterialInvalid = 255
|
||||
};
|
||||
|
||||
/*
|
||||
// Used for worn NPC inventory tracking. NPCs don't use
|
||||
// augments, so only the basic slots need to be kept track of.
|
||||
#define MAX_WORN_INVENTORY 22
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
** Inventory Slot Equipment Enum
|
||||
** Mostly used for third-party tools to reference inventory slots
|
||||
** Inventory Slot Equipment Enum
|
||||
** Mostly used for third-party tools to reference inventory slots
|
||||
**
|
||||
** NOTE: Numbering for personal inventory goes top to bottom, then left to right
|
||||
** [pre-HoT]
|
||||
** NOTE: Numbering for personal inventory goes top to bottom, then left to right
|
||||
** It's the opposite for inside bags: left to right, then top to bottom
|
||||
** Example:
|
||||
** inventory: containers:
|
||||
** 1 6 1 2
|
||||
** 2 7 3 4
|
||||
** 3 8 5 6
|
||||
** 4 9 7 8
|
||||
** 5 10 9 10
|
||||
** Inventory: Containers:
|
||||
** 1 5 1 2
|
||||
** 2 6 3 4
|
||||
** 3 7 5 6
|
||||
** 4 8 7 8
|
||||
** - - 9 10
|
||||
**
|
||||
** [HoT and Higher]
|
||||
** Note: Numbering for inventory and bags goes left to right, then top to bottom
|
||||
** Example:
|
||||
** Inventory: Containers:
|
||||
** 1 2 1 2
|
||||
** 3 4 3 4
|
||||
** 5 6 5 6
|
||||
** 7 8 7 8
|
||||
** 9 10 9 10
|
||||
** - - 11 12 [Note: Additional slots are only available in RoF and higher]
|
||||
**
|
||||
*/
|
||||
enum InventorySlot
|
||||
{
|
||||
////////////////////////
|
||||
// Equip slots
|
||||
////////////////////////
|
||||
|
||||
SLOT_CHARM = 0,
|
||||
SLOT_EAR01 = 1,
|
||||
SLOT_HEAD = 2,
|
||||
SLOT_FACE = 3,
|
||||
SLOT_EAR02 = 4,
|
||||
SLOT_NECK = 5,
|
||||
SLOT_SHOULDER = 6,
|
||||
SLOT_ARMS = 7,
|
||||
SLOT_BACK = 8,
|
||||
SLOT_BRACER01 = 9,
|
||||
SLOT_BRACER02 = 10,
|
||||
SLOT_RANGE = 11,
|
||||
SLOT_HANDS = 12,
|
||||
SLOT_PRIMARY = 13,
|
||||
SLOT_SECONDARY = 14,
|
||||
SLOT_RING01 = 15,
|
||||
SLOT_RING02 = 16,
|
||||
SLOT_CHEST = 17,
|
||||
SLOT_LEGS = 18,
|
||||
SLOT_FEET = 19,
|
||||
SLOT_WAIST = 20,
|
||||
SLOT_AMMO = 21,
|
||||
|
||||
////////////////////////
|
||||
// All other slots
|
||||
////////////////////////
|
||||
SLOT_PERSONAL_BEGIN = 22,
|
||||
SLOT_PERSONAL_END = 29,
|
||||
|
||||
SLOT_CURSOR = 30,
|
||||
|
||||
SLOT_CURSOR_END = (int16)0xFFFE, // Last item on cursor queue
|
||||
// Cursor bag slots are 331->340 (10 slots)
|
||||
|
||||
// Personal Inventory Slots
|
||||
// Slots 1 through 8 are slots 22->29
|
||||
// Inventory bag slots are 251->330 (10 slots per bag)
|
||||
|
||||
// Tribute slots are 400-404? (upper bound unknown)
|
||||
// storing these in worn item's map
|
||||
|
||||
// Bank slots
|
||||
// Bank slots 1 through 16 are slots 2000->2015
|
||||
// Bank bag slots are 2031->2190
|
||||
|
||||
// Shared bank slots
|
||||
// Shared bank slots 1 through 2 are slots 2500->2501
|
||||
// Shared bank bag slots are 2531->2550
|
||||
|
||||
// Trade session slots
|
||||
// Trade slots 1 through 8 are slots 3000->3007
|
||||
// Trade bag slots are technically 0->79 when passed to client,
|
||||
// but in our code, we treat them as slots 3100->3179
|
||||
|
||||
// Slot used in OP_TradeSkillCombine for world tradeskill containers
|
||||
SLOT_TRADESKILL = 1000,
|
||||
SLOT_AUGMENT = 1001,
|
||||
// SLOT_POWER_SOURCE = 9999,
|
||||
// Value recognized by client for destroying an item
|
||||
SLOT_INVALID = (int16)0xFFFF
|
||||
enum InventoryMapTypes : int16 {
|
||||
MapPossessions = 0,
|
||||
MapBank,
|
||||
MapSharedBank,
|
||||
MapTrade,
|
||||
MapWorld,
|
||||
MapLimbo,
|
||||
MapTribute,
|
||||
MapTrophyTribute,
|
||||
MapGuildTribute,
|
||||
MapMerchant,
|
||||
MapDeleted,
|
||||
MapCorpse,
|
||||
MapBazaar,
|
||||
MapInspect,
|
||||
MapRealEstate,
|
||||
MapViewMODPC,
|
||||
MapViewMODBank,
|
||||
MapViewMODSharedBank,
|
||||
MapViewMODLimbo,
|
||||
MapAltStorage,
|
||||
MapArchived,
|
||||
MapMail,
|
||||
MapGuildTrophyTribute,
|
||||
MapKrono,
|
||||
MapOther,
|
||||
_MapCount
|
||||
};
|
||||
|
||||
enum InventoryMainTypes : int16 {
|
||||
MainCharm = 0,
|
||||
MainEar1,
|
||||
MainHead,
|
||||
MainFace,
|
||||
MainEar2,
|
||||
MainNeck,
|
||||
MainShoulders,
|
||||
MainArms,
|
||||
MainBack,
|
||||
MainWrist1,
|
||||
MainWrist2,
|
||||
MainRange,
|
||||
MainHands,
|
||||
MainPrimary,
|
||||
MainSecondary,
|
||||
MainFinger1,
|
||||
MainFinger2,
|
||||
MainChest,
|
||||
MainLegs,
|
||||
MainFeet,
|
||||
MainWaist,
|
||||
MainPowerSource = 9999, // temp
|
||||
MainAmmo = 21, // temp
|
||||
MainGeneral1,
|
||||
MainGeneral2,
|
||||
MainGeneral3,
|
||||
MainGeneral4,
|
||||
MainGeneral5,
|
||||
MainGeneral6,
|
||||
MainGeneral7,
|
||||
MainGeneral8,
|
||||
//MainGeneral9,
|
||||
//MainGeneral10,
|
||||
MainCursor,
|
||||
_MainCount
|
||||
};
|
||||
|
||||
#define INVALID_INDEX -1
|
||||
#define NOT_USED 0
|
||||
#define NO_ITEM 0
|
||||
|
||||
// yes..these are redundant... but, they help to identify and define what is actually being performed
|
||||
// plus, since they're pre-op's, they don't affect the actual binary size
|
||||
#define MAP_BEGIN 0
|
||||
#define MAIN_BEGIN 0
|
||||
#define SUB_BEGIN 0
|
||||
#define AUG_BEGIN 0
|
||||
|
||||
namespace legacy {
|
||||
// this is for perl and other legacy systems
|
||||
|
||||
typedef enum {
|
||||
SLOT_CHARM = 0,
|
||||
SLOT_EAR01 = 1,
|
||||
SLOT_HEAD = 2,
|
||||
SLOT_FACE = 3,
|
||||
SLOT_EAR02 = 4,
|
||||
SLOT_NECK = 5,
|
||||
SLOT_SHOULDER = 6,
|
||||
SLOT_ARMS = 7,
|
||||
SLOT_BACK = 8,
|
||||
SLOT_BRACER01 = 9,
|
||||
SLOT_BRACER02 = 10,
|
||||
SLOT_RANGE = 11,
|
||||
SLOT_HANDS = 12,
|
||||
SLOT_PRIMARY = 13,
|
||||
SLOT_SECONDARY = 14,
|
||||
SLOT_RING01 = 15,
|
||||
SLOT_RING02 = 16,
|
||||
SLOT_CHEST = 17,
|
||||
SLOT_LEGS = 18,
|
||||
SLOT_FEET = 19,
|
||||
SLOT_WAIST = 20,
|
||||
SLOT_POWER_SOURCE = 9999,
|
||||
SLOT_AMMO = 21,
|
||||
SLOT_GENERAL_1 = 22,
|
||||
SLOT_GENERAL_2 = 23,
|
||||
SLOT_GENERAL_3 = 24,
|
||||
SLOT_GENERAL_4 = 25,
|
||||
SLOT_GENERAL_5 = 26,
|
||||
SLOT_GENERAL_6 = 27,
|
||||
SLOT_GENERAL_7 = 28,
|
||||
SLOT_GENERAL_8 = 29,
|
||||
//SLOT_GENERAL_9 = not supported
|
||||
//SLOT_GENERAL_10 = not supported
|
||||
SLOT_CURSOR = 30,
|
||||
SLOT_CURSOR_END = (int16)0xFFFE, // I hope no one is using this...
|
||||
SLOT_TRADESKILL = 1000,
|
||||
SLOT_AUGMENT = 1001,
|
||||
SLOT_INVALID = (int16)0xFFFF,
|
||||
|
||||
SLOT_POSSESSIONS_BEGIN = 0,
|
||||
SLOT_POSSESSIONS_END = 30,
|
||||
|
||||
SLOT_EQUIPMENT_BEGIN = 0,
|
||||
SLOT_EQUIPMENT_END = 21,
|
||||
|
||||
SLOT_PERSONAL_BEGIN = 22,
|
||||
SLOT_PERSONAL_END = 29,
|
||||
SLOT_PERSONAL_BAGS_BEGIN = 251,
|
||||
SLOT_PERSONAL_BAGS_END = 330,
|
||||
|
||||
SLOT_CURSOR_BAG_BEGIN = 331,
|
||||
SLOT_CURSOR_BAG_END = 340,
|
||||
|
||||
SLOT_TRIBUTE_BEGIN = 400,
|
||||
SLOT_TRIBUTE_END = 404,
|
||||
|
||||
SLOT_BANK_BEGIN = 2000,
|
||||
SLOT_BANK_END = 2023,
|
||||
SLOT_BANK_BAGS_BEGIN = 2031,
|
||||
SLOT_BANK_BAGS_END = 2270,
|
||||
|
||||
SLOT_SHARED_BANK_BEGIN = 2500,
|
||||
SLOT_SHARED_BANK_END = 2501,
|
||||
SLOT_SHARED_BANK_BAGS_BEGIN = 2531,
|
||||
SLOT_SHARED_BANK_BAGS_END = 2550,
|
||||
|
||||
SLOT_TRADE_BEGIN = 3000,
|
||||
SLOT_TRADE_END = 3007,
|
||||
SLOT_TRADE_BAGS_BEGIN = 3031,
|
||||
SLOT_TRADE_BAGS_END = 3110,
|
||||
|
||||
SLOT_WORLD_BEGIN = 4000,
|
||||
SLOT_WORLD_END = 4009
|
||||
} InventorySlot;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,210 @@
|
||||
/*
|
||||
EQEMu: Everquest Server Emulator
|
||||
|
||||
Copyright (C) 2001-2014 EQEMu Development Team (http://eqemulator.net)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY except by those people which sell it, which
|
||||
are required to give you total support for your newly bought product;
|
||||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
*/
|
||||
|
||||
#ifndef EQ_DICTIONARY_H
|
||||
#define EQ_DICTIONARY_H
|
||||
|
||||
#include "types.h"
|
||||
#include "eq_constants.h"
|
||||
#include "clientversions.h"
|
||||
#include <string>
|
||||
#include "../common/patches/client62_constants.h"
|
||||
#include "../common/patches/titanium_constants.h"
|
||||
#include "../common/patches/sof_constants.h"
|
||||
#include "../common/patches/sod_constants.h"
|
||||
#include "../common/patches/underfoot_constants.h"
|
||||
#include "../common/patches/rof_constants.h"
|
||||
//#include "../common/patches/rof2_constants.h"
|
||||
|
||||
// *** DO NOT CHANGE without a full understanding of the consequences..the server is set up to use these settings explicitly!! ***
|
||||
// *** You will cause compilation failures and corrupt your database if partial or incorrect attempts to change them are made!! ***
|
||||
|
||||
// Hard-coded values usually indicate that further research is needed and the values given are from the old (known) system
|
||||
|
||||
// (future use)
|
||||
//using namespace RoF2::maps; // server inventory maps enumeration (code and database sync'd to reference)
|
||||
//using namespace RoF::slots; // server possessions slots enumeration (code and database sync'd to reference)
|
||||
|
||||
class EmuConstants {
|
||||
// an immutable value is required to initialize arrays, etc... use this class as a repository for those
|
||||
public:
|
||||
// database
|
||||
static const EQClientVersion CHARACTER_CREATION_CLIENT = EQClientRoF; // adjust according to starting item placement and target client
|
||||
|
||||
// inventory
|
||||
static uint16 InventoryMapSize(int16 map);
|
||||
//static std::string InventoryLocationName(Location_Struct location);
|
||||
static std::string InventoryMapName(int16 map);
|
||||
static std::string InventoryMainName(int16 main);
|
||||
static std::string InventorySubName(int16 sub);
|
||||
static std::string InventoryAugName(int16 aug);
|
||||
|
||||
// these are currently hard-coded for existing inventory system..do not use in place of special client version handlers until ready
|
||||
static const uint16 MAP_POSSESSIONS_SIZE = _MainCount;
|
||||
static const uint16 MAP_BANK_SIZE = 24;
|
||||
static const uint16 MAP_SHARED_BANK_SIZE = 2;
|
||||
static const uint16 MAP_TRADE_SIZE = 8;
|
||||
static const uint16 MAP_WORLD_SIZE = 10;
|
||||
static const uint16 MAP_LIMBO_SIZE = 36;
|
||||
static const uint16 MAP_TRIBUTE_SIZE = 5; // (need client values)
|
||||
static const uint16 MAP_TROPHY_TRIBUTE_SIZE = 0;
|
||||
static const uint16 MAP_GUILD_TRIBUTE_SIZE = 0;
|
||||
static const uint16 MAP_MERCHANT_SIZE = 0;
|
||||
static const uint16 MAP_DELETED_SIZE = 0;
|
||||
static const uint16 MAP_CORPSE_SIZE = _MainCount; // no bitmask use..limits to size of client corpse window (see EQLimits::InventoryMapSize(MapCorpse, <EQClientVersion))
|
||||
static const uint16 MAP_BAZAAR_SIZE = 80;
|
||||
static const uint16 MAP_INSPECT_SIZE = 22;
|
||||
static const uint16 MAP_REAL_ESTATE_SIZE = 0;
|
||||
static const uint16 MAP_VIEW_MOD_PC_SIZE = NOT_USED;
|
||||
static const uint16 MAP_VIEW_MOD_BANK_SIZE = NOT_USED;
|
||||
static const uint16 MAP_VIEW_MOD_SHARED_BANK_SIZE = NOT_USED;
|
||||
static const uint16 MAP_VIEW_MOD_LIMBO_SIZE = NOT_USED;
|
||||
static const uint16 MAP_ALT_STORAGE_SIZE = 0;
|
||||
static const uint16 MAP_ARCHIVED_SIZE = 0;
|
||||
static const uint16 MAP_MAIL_SIZE = 0;
|
||||
static const uint16 MAP_GUILD_TROPHY_TRIBUTE_SIZE = 0;
|
||||
static const uint16 MAP_KRONO_SIZE = 0;
|
||||
static const uint16 MAP_OTHER_SIZE = 0;
|
||||
|
||||
// most of these definitions will go away with the structure-based system..this maintains compatibility for now
|
||||
// (these are mainly to assign specific values to constants used in conversions and to identify per-client ranges/offsets)
|
||||
static const int16 EQUIPMENT_BEGIN = MainCharm;
|
||||
static const int16 EQUIPMENT_END = MainAmmo;
|
||||
static const uint16 EQUIPMENT_SIZE = 22; // does not account for 'Power Source' - used mainly for npc equipment arrays
|
||||
|
||||
static const int16 GENERAL_BEGIN = MainGeneral1;
|
||||
static const int16 GENERAL_END = MainGeneral8;
|
||||
static const uint16 GENERAL_SIZE = 8;
|
||||
static const int16 GENERAL_BAGS_BEGIN = 251;
|
||||
static const int16 GENERAL_BAGS_END_OFFSET = 79;
|
||||
static const int16 GENERAL_BAGS_END = GENERAL_BAGS_BEGIN + GENERAL_BAGS_END_OFFSET;
|
||||
|
||||
static const int16 CURSOR_BAG_BEGIN = 331;
|
||||
static const int16 CURSOR_BAG_END_OFFSET = 9;
|
||||
static const int16 CURSOR_BAG_END = CURSOR_BAG_BEGIN + CURSOR_BAG_END_OFFSET;
|
||||
|
||||
static const int16 BANK_BEGIN = 2000;
|
||||
static const int16 BANK_END = 2023;
|
||||
static const int16 BANK_BAGS_BEGIN = 2031;
|
||||
static const int16 BANK_BAGS_END_OFFSET = 239;
|
||||
static const int16 BANK_BAGS_END = BANK_BAGS_BEGIN + BANK_BAGS_END_OFFSET;
|
||||
|
||||
static const int16 SHARED_BANK_BEGIN = 2500;
|
||||
static const int16 SHARED_BANK_END = 2501;
|
||||
static const int16 SHARED_BANK_BAGS_BEGIN = 2531;
|
||||
static const int16 SHARED_BANK_BAGS_END_OFFSET = 19;
|
||||
static const int16 SHARED_BANK_BAGS_END = SHARED_BANK_BAGS_BEGIN + SHARED_BANK_BAGS_END_OFFSET;
|
||||
|
||||
static const int16 TRADE_BEGIN = 3000;
|
||||
static const int16 TRADE_END = 3007;
|
||||
static const int16 TRADE_NPC_END = 3003;
|
||||
static const int16 TRADE_BAGS_BEGIN = 3031;
|
||||
static const int16 TRADE_BAGS_END_OFFSET = 79;
|
||||
static const int16 TRADE_BAGS_END = TRADE_BAGS_BEGIN + TRADE_BAGS_END_OFFSET;
|
||||
|
||||
static const int16 WORLD_BEGIN = 4000;
|
||||
static const int16 WORLD_END = 4009;
|
||||
static const int16 WORLD_SIZE = MAP_WORLD_SIZE;
|
||||
|
||||
static const int16 TRIBUTE_BEGIN = 400;
|
||||
static const int16 TRIBUTE_END = 404;
|
||||
static const int16 TRIBUTE_SIZE = MAP_TRIBUTE_SIZE;
|
||||
|
||||
static const int16 CORPSE_BEGIN = 22;
|
||||
//static const int16 CORPSE_END = RoF::consts::CORPSE_END; // not ready for use
|
||||
|
||||
static const int16 MATERIAL_BEGIN = MaterialHead;
|
||||
static const int16 MATERIAL_END = MaterialSecondary;
|
||||
static const int16 MATERIAL_TINT_END = MaterialFeet;
|
||||
static const int16 MATERIAL_SIZE = _MaterialCount;
|
||||
|
||||
// items
|
||||
// common and container sizes will not increase until the new 'location' struct is implemented
|
||||
static const uint16 ITEM_COMMON_SIZE = Underfoot::consts::ITEM_COMMON_SIZE;
|
||||
static const uint16 ITEM_CONTAINER_SIZE = Underfoot::consts::ITEM_CONTAINER_SIZE;
|
||||
|
||||
// player profile
|
||||
//static const uint32 CLASS_BITMASK = 0; // needs value
|
||||
//static const uint32 RACE_BITMASK = 0; // needs value
|
||||
|
||||
// BANDOLIERS_COUNT sets maximum limit..active limit will need to be handled by the appropriate AA
|
||||
static const uint32 BANDOLIERS_COUNT = Titanium::consts::BANDOLIERS_COUNT; // count = number of bandolier instances
|
||||
static const uint32 BANDOLIER_SIZE = Titanium::consts::BANDOLIER_SIZE; // size = number of equipment slots in bandolier instance
|
||||
static const uint32 POTION_BELT_SIZE = Titanium::consts::POTION_BELT_SIZE;
|
||||
|
||||
// legacy-related functions
|
||||
//static int ServerToPerlSlot(int slot); // encode
|
||||
//static int PerlToServerSlot(int slot); // decode
|
||||
};
|
||||
|
||||
class EQLimits {
|
||||
// values should default to a non-beneficial value..unless value conflicts with intended operation
|
||||
//
|
||||
// EmuConstants may be used as references..but, not every reference needs to be in EmuConstants (i.e., AllowsEmptyBagInBag(), CoinHasWeight(), etc...)
|
||||
public:
|
||||
// client version validation (checks to avoid crashing zone server when accessing reference arrays)
|
||||
// use this inside of class Client (limits to actual clients)
|
||||
static bool IsValidClientVersion(uint32 version);
|
||||
static uint32 ValidateClientVersion(uint32 version);
|
||||
static EQClientVersion ValidateClientVersion(EQClientVersion version);
|
||||
|
||||
// basically..any non-client classes - do not when setting a valid client
|
||||
static bool IsValidNPCVersion(uint32 version);
|
||||
static uint32 ValidateNPCVersion(uint32 version);
|
||||
static EQClientVersion ValidateNPCVersion(EQClientVersion version);
|
||||
|
||||
// these are 'universal' - do not when setting a valid client
|
||||
static bool IsValidMobVersion(uint32 version);
|
||||
static uint32 ValidateMobVersion(uint32 version);
|
||||
static EQClientVersion ValidateMobVersion(EQClientVersion version);
|
||||
|
||||
// inventory
|
||||
static uint16 InventoryMapSize(int16 map, uint32 version);
|
||||
static uint64 PossessionsBitmask(uint32 version);
|
||||
static uint64 EquipmentBitmask(uint32 version);
|
||||
static uint64 GeneralBitmask(uint32 version);
|
||||
static uint64 CursorBitmask(uint32 version);
|
||||
|
||||
static bool AllowsEmptyBagInBag(uint32 version);
|
||||
|
||||
// items
|
||||
static uint16 ItemCommonSize(uint32 version);
|
||||
static uint16 ItemContainerSize(uint32 version);
|
||||
|
||||
// player profile
|
||||
static bool CoinHasWeight(uint32 version);
|
||||
|
||||
static uint32 BandoliersCount(uint32 version);
|
||||
static uint32 BandolierSize(uint32 version);
|
||||
|
||||
static uint32 PotionBeltSize(uint32 version);
|
||||
};
|
||||
|
||||
#endif /* EQ_LIMITS_H */
|
||||
|
||||
/*
|
||||
Working Notes:
|
||||
--------------
|
||||
|
||||
- full review of client_packet.cpp and client translators needed
|
||||
|
||||
|
||||
*/
|
||||
@@ -19,10 +19,10 @@
|
||||
#include <stdio.h>
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include "EQPacket.h"
|
||||
#include "eq_packet.h"
|
||||
#include "misc.h"
|
||||
#include "op_codes.h"
|
||||
#include "CRC16.h"
|
||||
#include "crc16.h"
|
||||
#include "platform.h"
|
||||
#ifndef STATIC_OPCODE
|
||||
#include "opcodemgr.h"
|
||||
@@ -343,7 +343,7 @@ bool valid=false;
|
||||
uint16 packet_crc=ntohs(*(const uint16 *)(buffer+length-2));
|
||||
#ifdef EQN_DEBUG
|
||||
if (packet_crc && comp_crc != packet_crc) {
|
||||
cout << "CRC mismatch: comp=" << hex << comp_crc << ", packet=" << packet_crc << dec << endl;
|
||||
std::cout << "CRC mismatch: comp=" << std::hex << comp_crc << ", packet=" << packet_crc << std::dec << std::endl;
|
||||
}
|
||||
#endif
|
||||
valid = (!packet_crc || comp_crc == packet_crc);
|
||||
@@ -476,7 +476,7 @@ EQRawApplicationPacket::EQRawApplicationPacket(const unsigned char *buf, const u
|
||||
const unsigned char *packet_start = (buf + 3);
|
||||
const int32 packet_length = len - 3;
|
||||
safe_delete_array(pBuffer);
|
||||
if(len >= 0)
|
||||
if(packet_length >= 0)
|
||||
{
|
||||
size = packet_length;
|
||||
pBuffer = new unsigned char[size];
|
||||
@@ -18,8 +18,8 @@
|
||||
#ifndef _EQPACKET_H
|
||||
#define _EQPACKET_H
|
||||
|
||||
#include "BasePacket.h"
|
||||
#include "EQStreamType.h"
|
||||
#include "base_packet.h"
|
||||
#include "eq_stream_type.h"
|
||||
#include "op_codes.h"
|
||||
#include "platform.h"
|
||||
|
||||
+98
-33
@@ -32,7 +32,8 @@ static const uint32 MAX_MERC_GRADES = 10;
|
||||
static const uint32 MAX_MERC_STANCES = 10;
|
||||
static const uint32 BLOCKED_BUFF_COUNT = 20;
|
||||
|
||||
#include "eq_constants.h"
|
||||
//#include "eq_constants.h"
|
||||
#include "eq_dictionary.h"
|
||||
|
||||
/*
|
||||
** Compiler override to ensure
|
||||
@@ -270,7 +271,7 @@ struct Spawn_Struct {
|
||||
/*0225*/ uint32 equip_primary; // Equipment: Primary Visual
|
||||
/*0229*/ uint32 equip_secondary; // Equipment: Secondary Visual
|
||||
} equip;
|
||||
/*0197*/ uint32 equipment[MAX_MATERIALS]; // Array elements correspond to struct equipment above
|
||||
/*0197*/ uint32 equipment[_MaterialCount]; // Array elements correspond to struct equipment above
|
||||
};
|
||||
/*0233*/ float runspeed; // Speed when running
|
||||
/*0036*/ uint8 afk; // 0=no, 1=afk
|
||||
@@ -316,7 +317,7 @@ union
|
||||
/*0376*/ Color_Struct color_primary; // Color of primary item
|
||||
/*0380*/ Color_Struct color_secondary; // Color of secondary item
|
||||
} equipment_colors;
|
||||
/*0348*/ Color_Struct colors[MAX_MATERIALS]; // Array elements correspond to struct equipment_colors above
|
||||
/*0348*/ Color_Struct colors[_MaterialCount]; // Array elements correspond to struct equipment_colors above
|
||||
};
|
||||
/*0384*/ uint8 lfg; // 0=off, 1=lfg on
|
||||
/*0385*/
|
||||
@@ -380,7 +381,11 @@ struct NewZone_Struct {
|
||||
/*0404*/ float fog_maxclip[4];
|
||||
/*0420*/ float gravity;
|
||||
/*0424*/ uint8 time_type;
|
||||
/*0425*/ uint8 unknown360[49];
|
||||
/*0425*/ uint8 rain_chance[4];
|
||||
/*0429*/ uint8 rain_duration[4];
|
||||
/*0433*/ uint8 snow_chance[4];
|
||||
/*0437*/ uint8 snow_duration[4];
|
||||
/*0441*/ uint8 unknown360[33];
|
||||
/*0474*/ uint8 sky; // Sky Type
|
||||
/*0475*/ uint8 unknown331[13]; // ***Placeholder
|
||||
/*0488*/ float zone_exp_multiplier; // Experience Multiplier
|
||||
@@ -716,12 +721,8 @@ struct Disciplines_Struct {
|
||||
uint32 values[MAX_PP_DISCIPLINES];
|
||||
};
|
||||
|
||||
static const uint32 TRIBUTE_SLOT_START = 400;
|
||||
static const uint32 MAX_PLAYER_TRIBUTES = 5;
|
||||
static const uint32 MAX_PLAYER_BANDOLIER = 4;
|
||||
static const uint32 MAX_PLAYER_BANDOLIER_ITEMS = 4;
|
||||
static const uint32 MAX_POTIONS_IN_BELT = 4;
|
||||
static const uint32 TRIBUTE_NONE = 0xFFFFFFFF;
|
||||
|
||||
struct Tribute_Struct {
|
||||
uint32 tribute;
|
||||
uint32 tier;
|
||||
@@ -743,10 +744,10 @@ enum { //bandolier item positions
|
||||
};
|
||||
struct Bandolier_Struct {
|
||||
char name[32];
|
||||
BandolierItem_Struct items[MAX_PLAYER_BANDOLIER_ITEMS];
|
||||
BandolierItem_Struct items[EmuConstants::BANDOLIER_SIZE];
|
||||
};
|
||||
struct PotionBelt_Struct {
|
||||
BandolierItem_Struct items[MAX_POTIONS_IN_BELT];
|
||||
BandolierItem_Struct items[EmuConstants::POTION_BELT_SIZE];
|
||||
};
|
||||
|
||||
struct MovePotionToBelt_Struct {
|
||||
@@ -787,7 +788,7 @@ struct SuspendedMinion_Struct
|
||||
/*002*/ uint32 HP;
|
||||
/*006*/ uint32 Mana;
|
||||
/*010*/ SpellBuff_Struct Buffs[BUFF_COUNT];
|
||||
/*510*/ uint32 Items[MAX_MATERIALS];
|
||||
/*510*/ uint32 Items[_MaterialCount];
|
||||
/*546*/ char Name[64];
|
||||
/*610*/
|
||||
};
|
||||
@@ -802,7 +803,7 @@ struct SuspendedMinion_Struct
|
||||
static const uint32 MAX_PP_LANGUAGE = 28;
|
||||
static const uint32 MAX_PP_SPELLBOOK = 480; // Increased to 480 to support SoF
|
||||
static const uint32 MAX_PP_MEMSPELL = 9;
|
||||
static const uint32 MAX_PP_SKILL = 75;
|
||||
static const uint32 MAX_PP_SKILL = _SkillPacketArraySize; // 100 - actual skills buffer size
|
||||
static const uint32 MAX_PP_AA_ARRAY = 240;
|
||||
static const uint32 MAX_GROUP_MEMBERS = 6;
|
||||
static const uint32 MAX_RECAST_TYPES = 20;
|
||||
@@ -892,9 +893,9 @@ struct PlayerProfile_Struct
|
||||
/*0304*/ uint8 ability_time_minutes;
|
||||
/*0305*/ uint8 ability_time_hours; //place holder
|
||||
/*0306*/ uint8 unknown0306[6]; // @bp Spacer/Flag?
|
||||
/*0312*/ uint32 item_material[MAX_MATERIALS]; // Item texture/material of worn/held items
|
||||
/*0312*/ uint32 item_material[_MaterialCount]; // Item texture/material of worn/held items
|
||||
/*0348*/ uint8 unknown0348[44];
|
||||
/*0392*/ Color_Struct item_tint[MAX_MATERIALS];
|
||||
/*0392*/ Color_Struct item_tint[_MaterialCount];
|
||||
/*0428*/ AA_Array aa_array[MAX_PP_AA_ARRAY];
|
||||
/*2348*/ float unknown2384; //seen ~128, ~47
|
||||
/*2352*/ char servername[32]; // length probably not right
|
||||
@@ -940,9 +941,9 @@ struct PlayerProfile_Struct
|
||||
/*4760*/ int32 silver_cursor; // Silver on cursor
|
||||
/*4764*/ int32 copper_cursor; // Copper on cursor
|
||||
/*4768*/ int32 platinum_shared; // Platinum shared between characters
|
||||
/*4772*/ uint8 unknown4808[24]; // @bp unknown skills?
|
||||
/*4796*/ uint32 skills[MAX_PP_SKILL];
|
||||
/*5096*/ uint8 unknown5132[284]; // @bp unknown skills?
|
||||
/*4772*/ uint8 unknown4808[24];
|
||||
/*4796*/ uint32 skills[MAX_PP_SKILL]; // [400] List of skills // 100 dword buffer
|
||||
/*5196*/ uint8 unknown5132[184];
|
||||
/*5380*/ uint32 pvp2; //
|
||||
/*5384*/ uint32 unknown5420; //
|
||||
/*5388*/ uint32 pvptype; //
|
||||
@@ -995,7 +996,7 @@ struct PlayerProfile_Struct
|
||||
/*7212*/ uint32 tribute_points;
|
||||
/*7216*/ uint32 unknown7252;
|
||||
/*7220*/ uint32 tribute_active; //1=active
|
||||
/*7224*/ Tribute_Struct tributes[MAX_PLAYER_TRIBUTES];
|
||||
/*7224*/ Tribute_Struct tributes[EmuConstants::TRIBUTE_SIZE];
|
||||
/*7264*/ Disciplines_Struct disciplines;
|
||||
/*7664*/ uint32 recastTimers[MAX_RECAST_TYPES]; // Timers (GMT of last use)
|
||||
/*7744*/ char unknown7780[160];
|
||||
@@ -1022,7 +1023,7 @@ struct PlayerProfile_Struct
|
||||
/*12800*/ uint32 expAA;
|
||||
/*12804*/ uint32 aapoints; //avaliable, unspent
|
||||
/*12808*/ uint8 unknown12844[36];
|
||||
/*12844*/ Bandolier_Struct bandoliers[MAX_PLAYER_BANDOLIER];
|
||||
/*12844*/ Bandolier_Struct bandoliers[EmuConstants::BANDOLIERS_COUNT];
|
||||
/*14124*/ uint8 unknown14160[4506];
|
||||
/*18630*/ SuspendedMinion_Struct SuspendedMinion; // No longer in use
|
||||
/*19240*/ uint32 timeentitledonaccount;
|
||||
@@ -1465,6 +1466,16 @@ struct MoveItem_Struct
|
||||
/*0008*/ uint32 number_in_stack;
|
||||
};
|
||||
|
||||
// both MoveItem_Struct/DeleteItem_Struct server structures will be changing to a structure-based slot format..this will
|
||||
// be used for handling SoF/SoD/etc... time stamps sent using the MoveItem_Struct format. (nothing will be done with this
|
||||
// info at the moment..but, it forwards it on to the server for handling/future use)
|
||||
struct ClientTimeStamp_Struct
|
||||
{
|
||||
/*0000*/ uint32 from_slot;
|
||||
/*0004*/ uint32 to_slot;
|
||||
/*0008*/ uint32 number_in_stack;
|
||||
};
|
||||
|
||||
//
|
||||
// from_slot/to_slot
|
||||
// -1 - destroy
|
||||
@@ -2013,7 +2024,7 @@ struct Illusion_Struct { //size: 256 - SoF
|
||||
/*092*/ uint32 drakkin_heritage; //
|
||||
/*096*/ uint32 drakkin_tattoo; //
|
||||
/*100*/ uint32 drakkin_details; //
|
||||
/*104*/ uint32 armor_tint[MAX_MATERIALS]; //
|
||||
/*104*/ uint32 armor_tint[_MaterialCount]; //
|
||||
/*140*/ uint8 eyecolor1; // Field Not Identified in any Illusion Struct
|
||||
/*141*/ uint8 eyecolor2; // Field Not Identified in any Illusion Struct
|
||||
/*142*/ uint8 unknown138[114]; //
|
||||
@@ -2276,10 +2287,13 @@ struct Stun_Struct { // 4 bytes total
|
||||
};
|
||||
|
||||
struct AugmentItem_Struct {
|
||||
/*00*/ int16 container_slot;
|
||||
/*02*/ char unknown02[2];
|
||||
/*04*/ int32 augment_slot;
|
||||
/*08*/
|
||||
/*00*/ uint32 container_index;
|
||||
/*04*/ int32 container_slot;
|
||||
/*08*/ uint32 augment_index;
|
||||
/*12*/ int32 augment_slot;
|
||||
/*16*/ uint32 dest_inst_id; // The unique serial number for the item instance that is being augmented
|
||||
/*20*/ int32 augment_action; // Guessed - 0 = augment, 1 = remove with distiller, 3 = delete aug
|
||||
/*24*/
|
||||
};
|
||||
|
||||
// OP_Emote
|
||||
@@ -2415,7 +2429,8 @@ struct BookRequest_Struct {
|
||||
*/
|
||||
struct Object_Struct {
|
||||
/*00*/ uint32 linked_list_addr[2];// <Zaphod> They are, get this, prev and next, ala linked list
|
||||
/*08*/ uint16 unknown008[2]; //
|
||||
/*08*/ uint16 unknown008; //
|
||||
/*10*/ uint16 unknown010; //
|
||||
/*12*/ uint32 drop_id; // Unique object id for zone
|
||||
/*16*/ uint16 zone_id; // Redudant, but: Zone the object appears in
|
||||
/*18*/ uint16 zone_instance; //
|
||||
@@ -2879,7 +2894,7 @@ struct LogServer_Struct {
|
||||
/*260*/ uint8 enable_petition_wnd;
|
||||
/*261*/ uint8 enablevoicemacros;
|
||||
/*262*/ uint8 enablemail;
|
||||
/*263*/ uint8 disable_tutorial_go_home;
|
||||
/*263*/ uint8 disable_tutorial_go_home; // This appears valid on Ti and RoF..other clients need verification
|
||||
/*264*/
|
||||
};
|
||||
|
||||
@@ -3158,6 +3173,26 @@ struct GuildUpdateURLAndChannel_Struct
|
||||
/*4176*/
|
||||
};
|
||||
|
||||
//Case 5 in Rain of Fear and higher clients for guild permissions.
|
||||
//RankID is the internal guild rank. There are 8 in Rain of Fear as opposed to the 3 in Titanium.
|
||||
//PermissionID is the type of permission. There are 32 total, with some unused. Live May 2014 sends and uses 26 of them. Varies through client version.
|
||||
//Permission value is a char that is either 0 or 1. Enabled for that rank/disabled for that rank.
|
||||
//The client sends this struct on changing a guild rank. The server sends each rank in 32 or less packets upon zonein if you are in a guild.
|
||||
struct GuildUpdateRanks_Struct
|
||||
{
|
||||
/*0000*/ uint32 Action; // 0 = Update URL, 1 = Update Channel, 5 = RoF Ranks
|
||||
/*0004*/ uint32 Unknown0004; //Seen 00 00 00 00
|
||||
/*0008*/ uint32 Unknown0008; //Seen 96 29 00 00
|
||||
/*0008*/ char Unknown0012[64]; //Seen "CharacterName"
|
||||
/*0076*/ uint32 GuildID; //Guild ID of "CharacterName"
|
||||
/*0080*/ uint32 RankID;
|
||||
/*0084*/ uint32 PermissionID;
|
||||
/*0088*/ char PermissionVal;
|
||||
/*0089*/ char Unknown0089[3]; //Seen 2c 01 00 ?
|
||||
/*0092*/
|
||||
};
|
||||
|
||||
|
||||
struct GuildStatus_Struct
|
||||
{
|
||||
/*000*/ char Name[64];
|
||||
@@ -3256,7 +3291,7 @@ struct DyeStruct
|
||||
struct Color_Struct secondary; // or this
|
||||
}
|
||||
dyes;
|
||||
struct Color_Struct dye[MAX_MATERIALS];
|
||||
struct Color_Struct dye[_MaterialCount];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -3317,8 +3352,8 @@ struct SelectTributeReply_Struct {
|
||||
|
||||
struct TributeInfo_Struct {
|
||||
uint32 active; //0 == inactive, 1 == active
|
||||
uint32 tributes[MAX_PLAYER_TRIBUTES]; //-1 == NONE
|
||||
uint32 tiers[MAX_PLAYER_TRIBUTES]; //all 00's
|
||||
uint32 tributes[EmuConstants::TRIBUTE_SIZE]; //-1 == NONE
|
||||
uint32 tiers[EmuConstants::TRIBUTE_SIZE]; //all 00's
|
||||
uint32 tribute_master_id;
|
||||
};
|
||||
|
||||
@@ -3427,15 +3462,19 @@ struct LevelAppearance_Struct { //Sends a little graphic on level up
|
||||
uint32 value5b;
|
||||
/*64*/
|
||||
};
|
||||
struct MerchantList{
|
||||
|
||||
struct MerchantList {
|
||||
uint32 id;
|
||||
uint32 slot;
|
||||
uint32 item;
|
||||
int16 faction_required;
|
||||
int8 level_required;
|
||||
uint16 alt_currency_cost;
|
||||
uint32 classes_required;
|
||||
uint8 probability;
|
||||
};
|
||||
struct TempMerchantList{
|
||||
|
||||
struct TempMerchantList {
|
||||
uint32 npcid;
|
||||
uint32 slot;
|
||||
uint32 item;
|
||||
@@ -3482,7 +3521,7 @@ struct MobRename_Struct {
|
||||
};
|
||||
|
||||
struct PlayMP3_Struct {
|
||||
char filename[128];
|
||||
char filename[0];
|
||||
};
|
||||
|
||||
//this is for custom title display in the skill window
|
||||
@@ -4425,6 +4464,14 @@ struct GuildBankPromote_Struct
|
||||
/*12*/ uint32 Slot2; // Always appears to be the same as Slot for Action code 3
|
||||
};
|
||||
|
||||
struct GuildPromoteStruct {
|
||||
/*000*/ char target[64];
|
||||
/*064*/ char name[64];
|
||||
/*128*/ uint32 rank;
|
||||
/*132*/ uint32 myrank;
|
||||
/*136*/
|
||||
};
|
||||
|
||||
struct GuildBankPermissions_Struct
|
||||
{
|
||||
/*00*/ uint32 Action; // 6
|
||||
@@ -5072,6 +5119,24 @@ struct ServerLootItem_Struct {
|
||||
uint8 maxlevel;
|
||||
};
|
||||
|
||||
//Found in client near a ref to the string:
|
||||
//"Got a broadcast message for ... %s ...\n"
|
||||
struct ClientMarqueeMessage_Struct {
|
||||
uint32 type;
|
||||
uint32 unk04; // no idea, didn't notice a change when altering it.
|
||||
//According to asm the following are hard coded values: 2, 4, 5, 6, 7, 10, 12, 13, 14, 15, 16, 18, 20
|
||||
//There is also a non-hardcoded fall through but to be honest i don't know enough about what it does yet
|
||||
uint32 priority; //needs a better name but it does:
|
||||
//opacity = (priority / 255) - floor(priority / 255)
|
||||
//# of fade in/out blinks = (int)((priority - 1) / 255)
|
||||
//so 510 would have 100% opacity and 1 extra blink at end
|
||||
uint32 fade_in_time; //The fade in time, in ms
|
||||
uint32 fade_out_time; //The fade out time, in ms
|
||||
uint32 duration; //in ms
|
||||
char msg[1]; //message plus null terminator
|
||||
|
||||
};
|
||||
|
||||
typedef std::list<ServerLootItem_Struct*> ItemList;
|
||||
|
||||
// Restore structure packing to default
|
||||
|
||||
@@ -17,12 +17,13 @@
|
||||
*/
|
||||
|
||||
#include "debug.h"
|
||||
#include "EQPacket.h"
|
||||
#include "EQStream.h"
|
||||
#include "eq_packet.h"
|
||||
#include "eq_stream.h"
|
||||
#include "misc.h"
|
||||
#include "Mutex.h"
|
||||
#include "mutex.h"
|
||||
#include "op_codes.h"
|
||||
#include "CRC16.h"
|
||||
#include "crc16.h"
|
||||
#include "platform.h"
|
||||
|
||||
#include <string>
|
||||
#include <iomanip>
|
||||
@@ -30,13 +31,6 @@
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
|
||||
#if defined(ZONE) || defined(WORLD)
|
||||
#define RETRANSMITS
|
||||
#endif
|
||||
#ifdef RETRANSMITS
|
||||
#include "rulesys.h"
|
||||
#endif
|
||||
|
||||
#ifdef _WINDOWS
|
||||
#include <time.h>
|
||||
#else
|
||||
@@ -75,17 +69,20 @@ void EQStream::init() {
|
||||
BytesWritten=0;
|
||||
SequencedBase = 0;
|
||||
NextSequencedSend = 0;
|
||||
#ifdef RETRANSMITS
|
||||
retransmittimer = Timer::GetCurrentTime();
|
||||
retransmittimeout = 500 * RuleR(EQStream, RetransmitTimeoutMult); //use 500ms as base before we have connection stats
|
||||
#endif
|
||||
|
||||
if(GetExecutablePlatform() == ExePlatformWorld || GetExecutablePlatform() == ExePlatformZone) {
|
||||
retransmittimer = Timer::GetCurrentTime();
|
||||
retransmittimeout = 500 * RETRANSMIT_TIMEOUT_MULT;
|
||||
}
|
||||
|
||||
OpMgr = nullptr;
|
||||
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
|
||||
_log(NET__ERROR, _L "init Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
||||
}
|
||||
if(NextSequencedSend > SequencedQueue.size()) {
|
||||
_log(NET__ERROR, _L "init Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size());
|
||||
}
|
||||
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
|
||||
_log(NET__ERROR, _L "init Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
||||
}
|
||||
|
||||
if(NextSequencedSend > SequencedQueue.size()) {
|
||||
_log(NET__ERROR, _L "init Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size());
|
||||
}
|
||||
}
|
||||
|
||||
EQRawApplicationPacket *EQStream::MakeApplicationPacket(EQProtocolPacket *p)
|
||||
@@ -118,7 +115,7 @@ EQProtocolPacket *EQStream::MakeProtocolPacket(const unsigned char *buf, uint32
|
||||
|
||||
void EQStream::ProcessPacket(EQProtocolPacket *p)
|
||||
{
|
||||
uint32 processed=0,subpacket_length=0;
|
||||
uint32 processed=0, subpacket_length=0;
|
||||
if (p == nullptr)
|
||||
return;
|
||||
// Raw Application packet
|
||||
@@ -304,9 +301,10 @@ uint32 processed=0,subpacket_length=0;
|
||||
#ifndef COLLECTOR
|
||||
uint16 seq=ntohs(*(uint16 *)(p->pBuffer));
|
||||
AckPackets(seq);
|
||||
#ifdef RETRANSMITS
|
||||
retransmittimer = Timer::GetCurrentTime();
|
||||
#endif
|
||||
|
||||
if(GetExecutablePlatform() == ExePlatformWorld || GetExecutablePlatform() == ExePlatformZone) {
|
||||
retransmittimer = Timer::GetCurrentTime();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
@@ -328,7 +326,7 @@ uint32 processed=0,subpacket_length=0;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
//cout << "Got OP_SessionRequest" << endl;
|
||||
//std::cout << "Got OP_SessionRequest" << std::endl;
|
||||
init();
|
||||
OutboundQueueClear();
|
||||
SessionRequest *Request=(SessionRequest *)p->pBuffer;
|
||||
@@ -409,44 +407,51 @@ uint32 processed=0,subpacket_length=0;
|
||||
uint16 seq=ntohs(*(uint16 *)(p->pBuffer));
|
||||
MOutboundQueue.lock();
|
||||
|
||||
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
|
||||
_log(NET__ERROR, _L "Pre-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
||||
}
|
||||
if(NextSequencedSend > SequencedQueue.size()) {
|
||||
_log(NET__ERROR, _L "Pre-OOA Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size());
|
||||
}
|
||||
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
|
||||
_log(NET__ERROR, _L "Pre-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
||||
}
|
||||
|
||||
if(NextSequencedSend > SequencedQueue.size()) {
|
||||
_log(NET__ERROR, _L "Pre-OOA Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size());
|
||||
}
|
||||
//if the packet they got out of order is between our last acked packet and the last sent packet, then its valid.
|
||||
if (CompareSequence(SequencedBase,seq) != SeqPast && CompareSequence(NextOutSeq,seq) == SeqPast) {
|
||||
_log(NET__NET_TRACE, _L "Received OP_OutOfOrderAck for sequence %d, starting retransmit at the start of our unacked buffer (seq %d, was %d)." __L,
|
||||
seq, SequencedBase, SequencedBase+NextSequencedSend);
|
||||
#ifdef RETRANSMITS
|
||||
if (!RuleB(EQStream, RetransmitAckedPackets)) {
|
||||
#endif
|
||||
|
||||
bool retransmit_acked_packets = false;
|
||||
if(GetExecutablePlatform() == ExePlatformWorld || GetExecutablePlatform() == ExePlatformZone) {
|
||||
retransmit_acked_packets = RETRANSMIT_ACKED_PACKETS;
|
||||
}
|
||||
|
||||
if(!retransmit_acked_packets) {
|
||||
uint16 sqsize = SequencedQueue.size();
|
||||
uint16 index = seq - SequencedBase;
|
||||
_log(NET__NET_TRACE, _L " OP_OutOfOrderAck marking packet acked in queue (queue index = %d, queue size = %d)." __L, index, sqsize);
|
||||
_log(NET__NET_TRACE, _L "OP_OutOfOrderAck marking packet acked in queue (queue index = %d, queue size = %d)." __L, index, sqsize);
|
||||
if (index < sqsize) {
|
||||
std::deque<EQProtocolPacket *>::iterator sitr;
|
||||
sitr = SequencedQueue.begin();
|
||||
sitr += index;
|
||||
(*sitr)->acked = true;
|
||||
}
|
||||
#ifdef RETRANSMITS
|
||||
}
|
||||
if (RuleR(EQStream, RetransmitTimeoutMult)) { // only choose new behavior if multiplier is set
|
||||
|
||||
if(RETRANSMIT_TIMEOUT_MULT) {
|
||||
retransmittimer = Timer::GetCurrentTime();
|
||||
}
|
||||
#endif
|
||||
|
||||
NextSequencedSend = 0;
|
||||
} else {
|
||||
_log(NET__NET_TRACE, _L "Received OP_OutOfOrderAck for out-of-window %d. Window (%d->%d)." __L, seq, SequencedBase, NextOutSeq);
|
||||
}
|
||||
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
|
||||
_log(NET__ERROR, _L "Post-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
||||
}
|
||||
if(NextSequencedSend > SequencedQueue.size()) {
|
||||
_log(NET__ERROR, _L "Post-OOA Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size());
|
||||
}
|
||||
|
||||
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
|
||||
_log(NET__ERROR, _L "Post-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
||||
}
|
||||
|
||||
if(NextSequencedSend > SequencedQueue.size()) {
|
||||
_log(NET__ERROR, _L "Post-OOA Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size());
|
||||
}
|
||||
MOutboundQueue.unlock();
|
||||
#endif
|
||||
}
|
||||
@@ -468,19 +473,21 @@ if(NextSequencedSend > SequencedQueue.size()) {
|
||||
Stats->packets_sent=x;
|
||||
NonSequencedPush(new EQProtocolPacket(OP_SessionStatResponse,p->pBuffer,p->size));
|
||||
AdjustRates(ntohl(Stats->average_delta));
|
||||
#ifdef RETRANSMITS
|
||||
if (RuleR(EQStream, RetransmitTimeoutMult) && ntohl(Stats->average_delta)) {
|
||||
//recalculate retransmittimeout using the larger of the last rtt or average rtt, which is multiplied by the rule value
|
||||
if((ntohl(Stats->last_local_delta) + ntohl(Stats->last_remote_delta)) > (ntohl(Stats->average_delta) * 2)) {
|
||||
retransmittimeout = (ntohl(Stats->last_local_delta) + ntohl(Stats->last_remote_delta)) * RuleR(EQStream, RetransmitTimeoutMult);
|
||||
} else {
|
||||
retransmittimeout = ntohl(Stats->average_delta) * 2 * RuleR(EQStream, RetransmitTimeoutMult);
|
||||
|
||||
if(GetExecutablePlatform() == ExePlatformWorld || GetExecutablePlatform() == ExePlatformZone) {
|
||||
if(RETRANSMIT_TIMEOUT_MULT && ntohl(Stats->average_delta)) {
|
||||
//recalculate retransmittimeout using the larger of the last rtt or average rtt, which is multiplied by the rule value
|
||||
if((ntohl(Stats->last_local_delta) + ntohl(Stats->last_remote_delta)) > (ntohl(Stats->average_delta) * 2)) {
|
||||
retransmittimeout = (ntohl(Stats->last_local_delta) + ntohl(Stats->last_remote_delta))
|
||||
* RETRANSMIT_TIMEOUT_MULT;
|
||||
} else {
|
||||
retransmittimeout = ntohl(Stats->average_delta) * 2 * RETRANSMIT_TIMEOUT_MULT;
|
||||
}
|
||||
if(retransmittimeout > RETRANSMIT_TIMEOUT_MAX)
|
||||
retransmittimeout = RETRANSMIT_TIMEOUT_MAX;
|
||||
_log(NET__NET_TRACE, _L "Retransmit timeout recalculated to %dms" __L, retransmittimeout);
|
||||
}
|
||||
if(retransmittimeout > RuleI(EQStream, RetransmitTimeoutMax))
|
||||
retransmittimeout = RuleI(EQStream, RetransmitTimeoutMax);
|
||||
_log(NET__NET_TRACE, _L "Retransmit timeout recalculated to %dms" __L, retransmittimeout);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
@@ -527,17 +534,7 @@ void EQStream::FastQueuePacket(EQApplicationPacket **p, bool ack_req)
|
||||
|
||||
uint16 opcode = (*OpMgr)->EmuToEQ(pack->emu_opcode);
|
||||
|
||||
//make sure this packet is compatible with this stream
|
||||
/* if(StreamType == UnknownStream || StreamType == ChatOrMailStream) {
|
||||
_log(NET__DEBUG, _L "Stream type undetermined (%s), packet ignored" __L, StreamTypeString(StreamType));
|
||||
return;
|
||||
}
|
||||
if(pack->GetPacketType() != StreamType) {
|
||||
_log(NET__ERROR, _L "Trying to queue a packet of type %s into a stream of type %s, dropping it." __L, StreamTypeString(pack->GetPacketType()), StreamTypeString(StreamType));
|
||||
return;
|
||||
}*/
|
||||
|
||||
_log(NET__APP_TRACE, "Queueing %sacked packet with opcode 0x%x (%s) and length %d", ack_req?"":"non-", opcode, OpcodeManager::EmuToName(pack->emu_opcode), pack->size);
|
||||
//_log(NET__APP_TRACE, "Queueing %sacked packet with opcode 0x%x (%s) and length %d", ack_req?"":"non-", opcode, OpcodeManager::EmuToName(pack->emu_opcode), pack->size);
|
||||
|
||||
if (!ack_req) {
|
||||
NonSequencedPush(new EQProtocolPacket(opcode, pack->pBuffer, pack->size));
|
||||
@@ -549,8 +546,8 @@ void EQStream::FastQueuePacket(EQApplicationPacket **p, bool ack_req)
|
||||
|
||||
void EQStream::SendPacket(uint16 opcode, EQApplicationPacket *p)
|
||||
{
|
||||
uint32 chunksize,used;
|
||||
uint32 length;
|
||||
uint32 chunksize,used;
|
||||
uint32 length;
|
||||
|
||||
// Convert the EQApplicationPacket to 1 or more EQProtocolPackets
|
||||
if (p->size>(MaxLen-8)) { // proto-op(2), seq(2), app-op(2) ... data ... crc(2)
|
||||
@@ -648,16 +645,16 @@ uint16 Seq=htons(seq);
|
||||
|
||||
void EQStream::Write(int eq_fd)
|
||||
{
|
||||
std::queue<EQProtocolPacket *> ReadyToSend;
|
||||
bool SeqEmpty=false,NonSeqEmpty=false;
|
||||
std::deque<EQProtocolPacket *>::iterator sitr;
|
||||
std::queue<EQProtocolPacket *> ReadyToSend;
|
||||
bool SeqEmpty=false, NonSeqEmpty=false;
|
||||
std::deque<EQProtocolPacket *>::iterator sitr;
|
||||
|
||||
// Check our rate to make sure we can send more
|
||||
MRate.lock();
|
||||
int32 threshold=RateThreshold;
|
||||
MRate.unlock();
|
||||
if (BytesWritten > threshold) {
|
||||
//cout << "Over threshold: " << BytesWritten << " > " << threshold << endl;
|
||||
//std::cout << "Over threshold: " << BytesWritten << " > " << threshold << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -673,14 +670,16 @@ std::deque<EQProtocolPacket *>::iterator sitr;
|
||||
// Place to hold the base packet t combine into
|
||||
EQProtocolPacket *p=nullptr;
|
||||
|
||||
#ifdef RETRANSMITS
|
||||
// if we have a timeout defined and we have not received an ack recently enough, retransmit from beginning of queue
|
||||
if (RuleR(EQStream, RetransmitTimeoutMult) && !SequencedQueue.empty() && NextSequencedSend && (GetState()==ESTABLISHED) && ((retransmittimer+retransmittimeout) < Timer::GetCurrentTime())) {
|
||||
_log(NET__NET_TRACE, _L "Timeout since last ack received, starting retransmit at the start of our unacked buffer (seq %d, was %d)." __L, SequencedBase, SequencedBase+NextSequencedSend);
|
||||
NextSequencedSend = 0;
|
||||
retransmittimer = Timer::GetCurrentTime(); // don't want to endlessly retransmit the first packet
|
||||
if(GetExecutablePlatform() == ExePlatformWorld || GetExecutablePlatform() == ExePlatformZone) {
|
||||
// if we have a timeout defined and we have not received an ack recently enough, retransmit from beginning of queue
|
||||
if (RETRANSMIT_TIMEOUT_MULT && !SequencedQueue.empty() && NextSequencedSend &&
|
||||
(GetState()==ESTABLISHED) && ((retransmittimer+retransmittimeout) < Timer::GetCurrentTime())) {
|
||||
_log(NET__NET_TRACE, _L "Timeout since last ack received, starting retransmit at the start of our unacked "
|
||||
"buffer (seq %d, was %d)." __L, SequencedBase, SequencedBase+NextSequencedSend);
|
||||
NextSequencedSend = 0;
|
||||
retransmittimer = Timer::GetCurrentTime(); // don't want to endlessly retransmit the first packet
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Find the next sequenced packet to send from the "queue"
|
||||
sitr = SequencedQueue.begin();
|
||||
@@ -723,65 +722,87 @@ std::deque<EQProtocolPacket *>::iterator sitr;
|
||||
}
|
||||
|
||||
if (sitr!=SequencedQueue.end()) {
|
||||
//_log(NET__NET_COMBINE, _L "Send Seq with %d seq packets starting at seq %d, next send %d, and %d non-seq packets." __L,
|
||||
// SequencedQueue.size(), SequencedBase, NextSequencedSend, NonSequencedQueue.size());
|
||||
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
|
||||
_log(NET__ERROR, _L "Pre-Send Seq NSS=%d Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, NextSequencedSend, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
||||
}
|
||||
if(NextSequencedSend > SequencedQueue.size()) {
|
||||
_log(NET__ERROR, _L "Pre-Send Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size());
|
||||
}
|
||||
uint16 seq_send = SequencedBase + NextSequencedSend; //just for logging...
|
||||
if(SequencedQueue.empty()) {
|
||||
_log(NET__ERROR, _L "Tried to write a packet with an empty queue (%d is past next out %d)" __L, seq_send, NextOutSeq);
|
||||
SeqEmpty=true;
|
||||
continue;
|
||||
}
|
||||
/*if(CompareSequence(NextOutSeq, seq_send) == SeqFuture) {
|
||||
_log(NET__ERROR, _L "Tried to write a packet beyond the end of the queue! (%d is past next out %d)" __L, seq_send, NextOutSeq);
|
||||
sitr=SequencedQueue.end();
|
||||
continue;
|
||||
}*/
|
||||
#ifdef RETRANSMITS
|
||||
if (!RuleB(EQStream, RetransmitAckedPackets) && (*sitr)->acked) {
|
||||
_log(NET__NET_TRACE, _L "Not retransmitting seq packet %d because already marked as acked" __L, seq_send);
|
||||
sitr++;
|
||||
NextSequencedSend++;
|
||||
} else if (!p) {
|
||||
#else
|
||||
if (!p) {
|
||||
#endif
|
||||
// If we don't have a packet to try to combine into, use this one as the base
|
||||
// Copy it first as it will still live until it is acked
|
||||
p=(*sitr)->Copy();
|
||||
_log(NET__NET_COMBINE, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size);
|
||||
sitr++;
|
||||
NextSequencedSend++;
|
||||
} else if (!p->combine(*sitr)) {
|
||||
// Trying to combine this packet with the base didn't work (too big maybe)
|
||||
// So just send the base packet (we'll try this packet again later)
|
||||
_log(NET__NET_COMBINE, _L "Combined packet full at len %d, next seq packet %d is len %d" __L, p->size, seq_send, (*sitr)->size);
|
||||
ReadyToSend.push(p);
|
||||
BytesWritten+=p->size;
|
||||
p=nullptr;
|
||||
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
|
||||
_log(NET__ERROR, _L "Pre-Send Seq NSS=%d Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, NextSequencedSend, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
||||
}
|
||||
|
||||
if (BytesWritten > threshold) {
|
||||
// Sent enough this round, lets stop to be fair
|
||||
_log(NET__RATES, _L "Exceeded write threshold in seq (%d > %d)" __L, BytesWritten, threshold);
|
||||
break;
|
||||
if(NextSequencedSend > SequencedQueue.size()) {
|
||||
_log(NET__ERROR, _L "Pre-Send Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size());
|
||||
}
|
||||
uint16 seq_send = SequencedBase + NextSequencedSend; //just for logging...
|
||||
|
||||
if(SequencedQueue.empty()) {
|
||||
_log(NET__ERROR, _L "Tried to write a packet with an empty queue (%d is past next out %d)" __L, seq_send, NextOutSeq);
|
||||
SeqEmpty=true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if(GetExecutablePlatform() == ExePlatformWorld || GetExecutablePlatform() == ExePlatformZone) {
|
||||
if (!RETRANSMIT_ACKED_PACKETS && (*sitr)->acked) {
|
||||
_log(NET__NET_TRACE, _L "Not retransmitting seq packet %d because already marked as acked" __L, seq_send);
|
||||
sitr++;
|
||||
NextSequencedSend++;
|
||||
} else if (!p) {
|
||||
// If we don't have a packet to try to combine into, use this one as the base
|
||||
// Copy it first as it will still live until it is acked
|
||||
p=(*sitr)->Copy();
|
||||
_log(NET__NET_COMBINE, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size);
|
||||
++sitr;
|
||||
NextSequencedSend++;
|
||||
} else if (!p->combine(*sitr)) {
|
||||
// Trying to combine this packet with the base didn't work (too big maybe)
|
||||
// So just send the base packet (we'll try this packet again later)
|
||||
_log(NET__NET_COMBINE, _L "Combined packet full at len %d, next seq packet %d is len %d" __L, p->size, seq_send, (*sitr)->size);
|
||||
ReadyToSend.push(p);
|
||||
BytesWritten+=p->size;
|
||||
p=nullptr;
|
||||
|
||||
if (BytesWritten > threshold) {
|
||||
// Sent enough this round, lets stop to be fair
|
||||
_log(NET__RATES, _L "Exceeded write threshold in seq (%d > %d)" __L, BytesWritten, threshold);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
// Combine worked
|
||||
_log(NET__NET_COMBINE, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size);
|
||||
++sitr;
|
||||
NextSequencedSend++;
|
||||
}
|
||||
} else {
|
||||
// Combine worked
|
||||
_log(NET__NET_COMBINE, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size);
|
||||
sitr++;
|
||||
NextSequencedSend++;
|
||||
if (!p) {
|
||||
// If we don't have a packet to try to combine into, use this one as the base
|
||||
// Copy it first as it will still live until it is acked
|
||||
p=(*sitr)->Copy();
|
||||
_log(NET__NET_COMBINE, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size);
|
||||
++sitr;
|
||||
NextSequencedSend++;
|
||||
} else if (!p->combine(*sitr)) {
|
||||
// Trying to combine this packet with the base didn't work (too big maybe)
|
||||
// So just send the base packet (we'll try this packet again later)
|
||||
_log(NET__NET_COMBINE, _L "Combined packet full at len %d, next seq packet %d is len %d" __L, p->size, seq_send, (*sitr)->size);
|
||||
ReadyToSend.push(p);
|
||||
BytesWritten+=p->size;
|
||||
p=nullptr;
|
||||
|
||||
if (BytesWritten > threshold) {
|
||||
// Sent enough this round, lets stop to be fair
|
||||
_log(NET__RATES, _L "Exceeded write threshold in seq (%d > %d)" __L, BytesWritten, threshold);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
// Combine worked
|
||||
_log(NET__NET_COMBINE, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size);
|
||||
++sitr;
|
||||
NextSequencedSend++;
|
||||
}
|
||||
}
|
||||
|
||||
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
|
||||
_log(NET__ERROR, _L "Post send Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
||||
}
|
||||
if(NextSequencedSend > SequencedQueue.size()) {
|
||||
_log(NET__ERROR, _L "Post send Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size());
|
||||
}
|
||||
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
|
||||
_log(NET__ERROR, _L "Post send Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
||||
}
|
||||
if(NextSequencedSend > SequencedQueue.size()) {
|
||||
_log(NET__ERROR, _L "Post send Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size());
|
||||
}
|
||||
} else {
|
||||
// No more sequenced packets
|
||||
SeqEmpty=true;
|
||||
@@ -827,15 +848,15 @@ sockaddr_in address;
|
||||
address.sin_port=remote_port;
|
||||
#ifdef NOWAY
|
||||
uint32 ip=address.sin_addr.s_addr;
|
||||
cout << "Sending to: "
|
||||
std::cout << "Sending to: "
|
||||
<< (int)*(unsigned char *)&ip
|
||||
<< "." << (int)*((unsigned char *)&ip+1)
|
||||
<< "." << (int)*((unsigned char *)&ip+2)
|
||||
<< "." << (int)*((unsigned char *)&ip+3)
|
||||
<< "," << (int)ntohs(address.sin_port) << "(" << p->size << ")" << endl;
|
||||
<< "," << (int)ntohs(address.sin_port) << "(" << p->size << ")" << std::endl;
|
||||
|
||||
p->DumpRaw();
|
||||
cout << "-------------" << endl;
|
||||
std::cout << "-------------" << std::endl;
|
||||
#endif
|
||||
length=p->serialize(buffer);
|
||||
if (p->opcode!=OP_SessionRequest && p->opcode!=OP_SessionResponse) {
|
||||
@@ -886,7 +907,7 @@ char temp[15];
|
||||
*((unsigned char *)&ip+2),
|
||||
*((unsigned char *)&ip+3),
|
||||
ntohs(from->sin_port));
|
||||
//cout << timestamp() << "Data from: " << temp << " OpCode 0x" << hex << setw(2) << setfill('0') << (int)p->opcode << dec << endl;
|
||||
//std::cout << timestamp() << "Data from: " << temp << " OpCode 0x" << std::hex << std::setw(2) << std::setfill('0') << (int)p->opcode << std::dec << std::endl;
|
||||
//dump_message(p->pBuffer,p->size,timestamp());
|
||||
|
||||
}
|
||||
@@ -965,7 +986,7 @@ EQRawApplicationPacket *p=nullptr;
|
||||
EmuOpcode emu_op = (*OpMgr)->EQToEmu(p->opcode);
|
||||
#if EQDEBUG >= 4
|
||||
if(emu_op == OP_Unknown) {
|
||||
LogFile->write(EQEMuLog::Debug, "Unable to convert EQ opcode 0x%.4x to an Application opcode.", p->opcode);
|
||||
_log(NET__ERROR, "Unable to convert EQ opcode 0x%.4x to an Application opcode.", p->opcode);
|
||||
}
|
||||
#endif
|
||||
p->SetOpcode(emu_op);
|
||||
@@ -1026,7 +1047,7 @@ EQApplicationPacket *p=nullptr;
|
||||
MInboundQueue.lock();
|
||||
if (!InboundQueue.empty()) {
|
||||
std::vector<EQRawApplicationPacket *>::iterator itr;
|
||||
for(itr=InboundQueue.begin();itr!=InboundQueue.end();itr++) {
|
||||
for(itr=InboundQueue.begin();itr!=InboundQueue.end();++itr) {
|
||||
p=*itr;
|
||||
delete p;
|
||||
}
|
||||
@@ -1073,7 +1094,7 @@ EQProtocolPacket *p=nullptr;
|
||||
}
|
||||
if(!SequencedQueue.empty()) {
|
||||
std::deque<EQProtocolPacket *>::iterator itr;
|
||||
for(itr=SequencedQueue.begin();itr!=SequencedQueue.end();itr++) {
|
||||
for(itr=SequencedQueue.begin();itr!=SequencedQueue.end();++itr) {
|
||||
p=*itr;
|
||||
delete p;
|
||||
}
|
||||
@@ -1098,7 +1119,7 @@ EQProtocolPacket *p=nullptr;
|
||||
|
||||
if(!PacketQueue.empty()) {
|
||||
std::map<unsigned short,EQProtocolPacket *>::iterator itr;
|
||||
for(itr=PacketQueue.begin();itr!=PacketQueue.end();itr++) {
|
||||
for(itr=PacketQueue.begin();itr!=PacketQueue.end();++itr) {
|
||||
p=itr->second;
|
||||
delete p;
|
||||
}
|
||||
@@ -1379,20 +1400,27 @@ void EQStream::Decay()
|
||||
|
||||
void EQStream::AdjustRates(uint32 average_delta)
|
||||
{
|
||||
#ifdef RETRANSMITS
|
||||
if (average_delta && (average_delta <= RuleI(EQStream, AverageDeltaMax))) {
|
||||
#else
|
||||
if (average_delta) {
|
||||
#endif
|
||||
MRate.lock();
|
||||
RateThreshold=RATEBASE/average_delta;
|
||||
DecayRate=DECAYBASE/average_delta;
|
||||
_log(NET__RATES, _L "Adjusting data rate to thresh %d, decay %d based on avg delta %d" __L, RateThreshold, DecayRate, average_delta);
|
||||
MRate.unlock();
|
||||
#ifdef RETRANSMITS
|
||||
if(GetExecutablePlatform() == ExePlatformWorld || GetExecutablePlatform() == ExePlatformZone) {
|
||||
if (average_delta && (average_delta <= AVERAGE_DELTA_MAX)) {
|
||||
MRate.lock();
|
||||
RateThreshold=RATEBASE/average_delta;
|
||||
DecayRate=DECAYBASE/average_delta;
|
||||
_log(NET__RATES, _L "Adjusting data rate to thresh %d, decay %d based on avg delta %d" __L,
|
||||
RateThreshold, DecayRate, average_delta);
|
||||
MRate.unlock();
|
||||
} else {
|
||||
_log(NET__RATES, _L "Not adjusting data rate because avg delta over max (%d > %d)" __L,
|
||||
average_delta, AVERAGE_DELTA_MAX);
|
||||
}
|
||||
} else {
|
||||
_log(NET__RATES, _L "Not adjusting data rate because avg delta over max (%d > %d)" __L, average_delta, RuleI(EQStream, AverageDeltaMax));
|
||||
#endif
|
||||
if (average_delta) {
|
||||
MRate.lock();
|
||||
RateThreshold=RATEBASE/average_delta;
|
||||
DecayRate=DECAYBASE/average_delta;
|
||||
_log(NET__RATES, _L "Adjusting data rate to thresh %d, decay %d based on avg delta %d" __L,
|
||||
RateThreshold, DecayRate, average_delta);
|
||||
MRate.unlock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,20 +9,41 @@
|
||||
#ifndef WIN32
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
#include "EQStreamType.h"
|
||||
#include "EQPacket.h"
|
||||
#include "EQStreamIntf.h"
|
||||
#include "Mutex.h"
|
||||
#include "eq_stream_type.h"
|
||||
#include "eq_packet.h"
|
||||
#include "eq_stream_intf.h"
|
||||
#include "mutex.h"
|
||||
#include "../common/opcodemgr.h"
|
||||
#include "../common/misc.h"
|
||||
#include "../common/Condition.h"
|
||||
#include "../common/condition.h"
|
||||
#include "../common/timer.h"
|
||||
|
||||
#define FLAG_COMPRESSED 0x01
|
||||
#define FLAG_ENCODED 0x04
|
||||
|
||||
#define RATEBASE 1048576 // 1 MB
|
||||
#define DECAYBASE 78642 // RATEBASE/10
|
||||
#ifndef RATEBASE
|
||||
#define RATEBASE 1048576
|
||||
#endif
|
||||
|
||||
#ifndef DECAYBASE
|
||||
#define DECAYBASE 78642
|
||||
#endif
|
||||
|
||||
#ifndef RETRANSMIT_TIMEOUT_MULT
|
||||
#define RETRANSMIT_TIMEOUT_MULT 3.0
|
||||
#endif
|
||||
|
||||
#ifndef RETRANSMIT_TIMEOUT_MAX
|
||||
#define RETRANSMIT_TIMEOUT_MAX 5000
|
||||
#endif
|
||||
|
||||
#ifndef AVERAGE_DELTA_MAX
|
||||
#define AVERAGE_DELTA_MAX 2500
|
||||
#endif
|
||||
|
||||
#ifndef RETRANSMIT_ACKED_PACKETS
|
||||
#define RETRANSMIT_ACKED_PACKETS true
|
||||
#endif
|
||||
|
||||
#pragma pack(1)
|
||||
struct SessionRequest {
|
||||
@@ -57,9 +78,6 @@ struct SessionStats {
|
||||
#pragma pack()
|
||||
|
||||
class OpcodeManager;
|
||||
//extern OpcodeManager *EQNetworkOpcodeManager;
|
||||
|
||||
//class EQStreamFactory;
|
||||
class EQStreamPair;
|
||||
class EQRawApplicationPacket;
|
||||
|
||||
@@ -137,8 +155,6 @@ class EQStream : public EQStreamInterface {
|
||||
|
||||
OpcodeManager **OpMgr;
|
||||
|
||||
// EQStreamFactory *const Factory;
|
||||
|
||||
EQRawApplicationPacket *MakeApplicationPacket(EQProtocolPacket *p);
|
||||
EQRawApplicationPacket *MakeApplicationPacket(const unsigned char *buf, uint32 len);
|
||||
EQProtocolPacket *MakeProtocolPacket(const unsigned char *buf, uint32 len);
|
||||
@@ -162,8 +178,6 @@ class EQStream : public EQStreamInterface {
|
||||
void SetSession(uint32 s) { Session=s; }
|
||||
|
||||
void ProcessPacket(EQProtocolPacket *p);
|
||||
// virtual void DispatchPacket(EQApplicationPacket *p) { p->DumpRaw(); }
|
||||
|
||||
|
||||
bool Stale(uint32 now, uint32 timeout=30) { return (LastPacket && (now-LastPacket) > timeout); }
|
||||
|
||||
@@ -185,7 +199,6 @@ class EQStream : public EQStreamInterface {
|
||||
EQStream() { init(); remote_ip = 0; remote_port = 0; State=UNESTABLISHED; StreamType=UnknownStream; compressed=true; encoded=false; app_opcode_size=2; bytes_sent=0; bytes_recv=0; create_time=Timer::GetTimeSeconds(); }
|
||||
EQStream(sockaddr_in addr) { init(); remote_ip=addr.sin_addr.s_addr; remote_port=addr.sin_port; State=UNESTABLISHED; StreamType=UnknownStream; compressed=true; encoded=false; app_opcode_size=2; bytes_sent=0; bytes_recv=0; create_time=Timer::GetTimeSeconds(); }
|
||||
virtual ~EQStream() { RemoveData(); SetState(CLOSED); }
|
||||
// inline void SetFactory(EQStreamFactory *f) { Factory=f; }
|
||||
void SetMaxLen(uint32 length) { MaxLen=length; }
|
||||
|
||||
//interface used by application (EQStreamInterface)
|
||||
@@ -214,10 +227,8 @@ class EQStream : public EQStreamInterface {
|
||||
|
||||
inline EQStreamState GetState() { EQStreamState s; MState.lock(); s=State; MState.unlock(); return s; }
|
||||
|
||||
// static EQProtocolPacket *Read(int eq_fd, sockaddr_in *from);
|
||||
static SeqOrder CompareSequence(uint16 expected_seq , uint16 seq);
|
||||
|
||||
// void Close() { SendDisconnect(); }
|
||||
bool CheckActive() { return GetState()==ESTABLISHED; }
|
||||
bool CheckClosed() { return GetState()==CLOSED; }
|
||||
void SetOpcodeSize(uint8 s) { app_opcode_size = s; }
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "debug.h"
|
||||
#include "EQStreamFactory.h"
|
||||
#include "eq_stream_factory.h"
|
||||
#ifdef _WINDOWS
|
||||
#include <winsock.h>
|
||||
#include <process.h>
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <iostream>
|
||||
#include "op_codes.h"
|
||||
#include "EQStream.h"
|
||||
#include "eq_stream.h"
|
||||
#include "logsys.h"
|
||||
|
||||
ThreadReturnType EQStreamFactoryReaderLoop(void *eqfs)
|
||||
@@ -104,8 +104,8 @@ struct sockaddr_in address;
|
||||
fcntl(sock, F_SETFL, O_NONBLOCK);
|
||||
#endif
|
||||
//moved these because on windows the output was delayed and causing the console window to look bad
|
||||
//cout << "Starting factory Reader" << endl;
|
||||
//cout << "Starting factory Writer" << endl;
|
||||
//std::cout << "Starting factory Reader" << std::endl;
|
||||
//std::cout << "Starting factory Writer" << std::endl;
|
||||
#ifdef _WINDOWS
|
||||
_beginthread(EQStreamFactoryReaderLoop,0, this);
|
||||
_beginthread(EQStreamFactoryWriterLoop,0, this);
|
||||
@@ -119,7 +119,7 @@ struct sockaddr_in address;
|
||||
EQStream *EQStreamFactory::Pop()
|
||||
{
|
||||
EQStream *s=nullptr;
|
||||
//cout << "Pop():Locking MNewStreams" << endl;
|
||||
//std::cout << "Pop():Locking MNewStreams" << std::endl;
|
||||
MNewStreams.lock();
|
||||
if (NewStreams.size()) {
|
||||
s=NewStreams.front();
|
||||
@@ -127,24 +127,24 @@ EQStream *s=nullptr;
|
||||
s->PutInUse();
|
||||
}
|
||||
MNewStreams.unlock();
|
||||
//cout << "Pop(): Unlocking MNewStreams" << endl;
|
||||
//std::cout << "Pop(): Unlocking MNewStreams" << std::endl;
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
void EQStreamFactory::Push(EQStream *s)
|
||||
{
|
||||
//cout << "Push():Locking MNewStreams" << endl;
|
||||
//std::cout << "Push():Locking MNewStreams" << std::endl;
|
||||
MNewStreams.lock();
|
||||
NewStreams.push(s);
|
||||
MNewStreams.unlock();
|
||||
//cout << "Push(): Unlocking MNewStreams" << endl;
|
||||
//std::cout << "Push(): Unlocking MNewStreams" << std::endl;
|
||||
}
|
||||
|
||||
void EQStreamFactory::ReaderLoop()
|
||||
{
|
||||
fd_set readset;
|
||||
std::map<std::string,EQStream *>::iterator stream_itr;
|
||||
std::map<std::pair<uint32, uint16>,EQStream *>::iterator stream_itr;
|
||||
int num;
|
||||
int length;
|
||||
unsigned char buffer[2048];
|
||||
@@ -183,14 +183,13 @@ timeval sleep_time;
|
||||
{
|
||||
// What do we wanna do?
|
||||
} else {
|
||||
char temp[25];
|
||||
sprintf(temp,"%u.%d",ntohl(from.sin_addr.s_addr),ntohs(from.sin_port));
|
||||
MStreams.lock();
|
||||
if ((stream_itr=Streams.find(temp))==Streams.end()) {
|
||||
stream_itr=Streams.find(std::make_pair(from.sin_addr.s_addr, from.sin_port));
|
||||
if (stream_itr == Streams.end()) {
|
||||
if (buffer[1]==OP_SessionRequest) {
|
||||
EQStream *s = new EQStream(from);
|
||||
s->SetStreamType(StreamType);
|
||||
Streams[temp]=s;
|
||||
Streams[std::make_pair(from.sin_addr.s_addr, from.sin_port)]=s;
|
||||
WriterWork.Signal();
|
||||
Push(s);
|
||||
s->AddBytesRecv(length);
|
||||
@@ -225,7 +224,7 @@ void EQStreamFactory::CheckTimeout()
|
||||
MStreams.lock();
|
||||
|
||||
unsigned long now=Timer::GetCurrentTime();
|
||||
std::map<std::string,EQStream *>::iterator stream_itr;
|
||||
std::map<std::pair<uint32, uint16>,EQStream *>::iterator stream_itr;
|
||||
|
||||
for(stream_itr=Streams.begin();stream_itr!=Streams.end();) {
|
||||
EQStream *s = stream_itr->second;
|
||||
@@ -240,9 +239,9 @@ void EQStreamFactory::CheckTimeout()
|
||||
//give it a little time for everybody to finish with it
|
||||
} else {
|
||||
//everybody is done, we can delete it now
|
||||
//cout << "Removing connection" << endl;
|
||||
std::map<std::string,EQStream *>::iterator temp=stream_itr;
|
||||
stream_itr++;
|
||||
//std::cout << "Removing connection" << std::endl;
|
||||
std::map<std::pair<uint32, uint16>,EQStream *>::iterator temp=stream_itr;
|
||||
++stream_itr;
|
||||
//let whoever has the stream outside delete it
|
||||
delete temp->second;
|
||||
Streams.erase(temp);
|
||||
@@ -250,14 +249,14 @@ void EQStreamFactory::CheckTimeout()
|
||||
}
|
||||
}
|
||||
|
||||
stream_itr++;
|
||||
++stream_itr;
|
||||
}
|
||||
MStreams.unlock();
|
||||
}
|
||||
|
||||
void EQStreamFactory::WriterLoop()
|
||||
{
|
||||
std::map<std::string,EQStream *>::iterator stream_itr;
|
||||
std::map<std::pair<uint32, uint16>,EQStream *>::iterator stream_itr;
|
||||
bool havework=true;
|
||||
std::vector<EQStream *> wants_write;
|
||||
std::vector<EQStream *>::iterator cur,end;
|
||||
@@ -285,14 +284,14 @@ Timer DecayTimer(20);
|
||||
//copy streams into a seperate list so we dont have to keep
|
||||
//MStreams locked while we are writting
|
||||
MStreams.lock();
|
||||
for(stream_itr=Streams.begin();stream_itr!=Streams.end();stream_itr++) {
|
||||
for(stream_itr=Streams.begin();stream_itr!=Streams.end();++stream_itr) {
|
||||
// If it's time to decay the bytes sent, then let's do it before we try to write
|
||||
if (decay)
|
||||
stream_itr->second->Decay();
|
||||
|
||||
//bullshit checking, to see if this is really happening, GDB seems to think so...
|
||||
if(stream_itr->second == nullptr) {
|
||||
fprintf(stderr, "ERROR: nullptr Stream encountered in EQStreamFactory::WriterLoop for: %s", stream_itr->first.c_str());
|
||||
fprintf(stderr, "ERROR: nullptr Stream encountered in EQStreamFactory::WriterLoop for: %i", stream_itr->first.first, stream_itr->first.second);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -307,7 +306,7 @@ Timer DecayTimer(20);
|
||||
//do the actual writes
|
||||
cur = wants_write.begin();
|
||||
end = wants_write.end();
|
||||
for(; cur != end; cur++) {
|
||||
for(; cur != end; ++cur) {
|
||||
(*cur)->Write(sock);
|
||||
(*cur)->ReleaseFromUse();
|
||||
}
|
||||
@@ -318,9 +317,9 @@ Timer DecayTimer(20);
|
||||
stream_count=Streams.size();
|
||||
MStreams.unlock();
|
||||
if (!stream_count) {
|
||||
//cout << "No streams, waiting on condition" << endl;
|
||||
//std::cout << "No streams, waiting on condition" << std::endl;
|
||||
WriterWork.Wait();
|
||||
//cout << "Awake from condition, must have a stream now" << endl;
|
||||
//std::cout << "Awake from condition, must have a stream now" << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
#include <queue>
|
||||
#include <map>
|
||||
#include "../common/EQStream.h"
|
||||
#include "../common/Condition.h"
|
||||
#include "../common/eq_stream.h"
|
||||
#include "../common/condition.h"
|
||||
#include "../common/timeoutmgr.h"
|
||||
#include "../common/opcodemgr.h"
|
||||
#include "../common/timer.h"
|
||||
@@ -27,7 +27,7 @@ class EQStreamFactory : private Timeoutable {
|
||||
std::queue<EQStream *> NewStreams;
|
||||
Mutex MNewStreams;
|
||||
|
||||
std::map<std::string,EQStream *> Streams;
|
||||
std::map<std::pair<uint32, uint16>,EQStream *> Streams;
|
||||
Mutex MStreams;
|
||||
|
||||
virtual void CheckTimeout();
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "debug.h"
|
||||
#include "EQStreamIdent.h"
|
||||
#include "EQStreamProxy.h"
|
||||
#include "eq_stream_ident.h"
|
||||
#include "eq_stream_proxy.h"
|
||||
#include "logsys.h"
|
||||
|
||||
EQStreamIdentifier::~EQStreamIdentifier() {
|
||||
@@ -11,7 +11,7 @@ EQStreamIdentifier::~EQStreamIdentifier() {
|
||||
std::vector<Record *>::iterator cur, end;
|
||||
cur = m_streams.begin();
|
||||
end = m_streams.end();
|
||||
for(; cur != end; cur++) {
|
||||
for(; cur != end; ++cur) {
|
||||
Record *r = *cur;
|
||||
r->stream->ReleaseFromUse();
|
||||
delete r;
|
||||
@@ -19,7 +19,7 @@ EQStreamIdentifier::~EQStreamIdentifier() {
|
||||
std::vector<Patch *>::iterator curp, endp;
|
||||
curp = m_patches.begin();
|
||||
endp = m_patches.end();
|
||||
for(; curp != endp; curp++) {
|
||||
for(; curp != endp; ++curp) {
|
||||
delete *curp;
|
||||
}
|
||||
}
|
||||
@@ -56,6 +56,7 @@ void EQStreamIdentifier::Process() {
|
||||
//if stream hasn't finished initializing then continue;
|
||||
if(r->stream->GetState() == UNESTABLISHED)
|
||||
{
|
||||
++cur;
|
||||
continue;
|
||||
}
|
||||
if(r->stream->GetState() != ESTABLISHED) {
|
||||
@@ -93,7 +94,7 @@ void EQStreamIdentifier::Process() {
|
||||
//foreach possbile patch...
|
||||
curp = m_patches.begin();
|
||||
endp = m_patches.end();
|
||||
for(; !found_one && curp != endp; curp++) {
|
||||
for(; !found_one && curp != endp; ++curp) {
|
||||
Patch *p = *curp;
|
||||
|
||||
//ask the stream to see if it matches the supplied signature
|
||||
@@ -136,7 +137,7 @@ void EQStreamIdentifier::Process() {
|
||||
delete r;
|
||||
cur = m_streams.erase(cur);
|
||||
} else {
|
||||
cur++;
|
||||
++cur;
|
||||
}
|
||||
} //end foreach stream
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef EQSTREAMIDENT_H_
|
||||
#define EQSTREAMIDENT_H_
|
||||
|
||||
#include "EQStream.h"
|
||||
#include "eq_stream.h"
|
||||
#include "timer.h"
|
||||
#include <vector>
|
||||
#include <string>
|
||||
@@ -138,7 +138,7 @@ public:
|
||||
iterator cur, end;
|
||||
cur = streams.begin();
|
||||
end = streams.end();
|
||||
for(; cur != end; cur++) {
|
||||
for(; cur != end; ++cur) {
|
||||
if(cur->second == it) {
|
||||
streams.erase(cur);
|
||||
//lazy recursive delete for now, since we have to redo
|
||||
@@ -1,8 +1,8 @@
|
||||
|
||||
#include "debug.h"
|
||||
#include "EQStreamProxy.h"
|
||||
#include "EQStream.h"
|
||||
#include "StructStrategy.h"
|
||||
#include "eq_stream_proxy.h"
|
||||
#include "eq_stream.h"
|
||||
#include "struct_strategy.h"
|
||||
|
||||
|
||||
EQStreamProxy::EQStreamProxy(EQStream *&stream, const StructStrategy *structs, OpcodeManager **opcodes)
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
|
||||
#include "types.h"
|
||||
#include "EQStreamIntf.h"
|
||||
#include "eq_stream_intf.h"
|
||||
|
||||
class EQStream;
|
||||
class StructStrategy;
|
||||
@@ -16,7 +16,7 @@
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "debug.h"
|
||||
#include "EQDB.h"
|
||||
#include "eqdb.h"
|
||||
#include "database.h"
|
||||
#include <mysql.h>
|
||||
#include <cstring>
|
||||
@@ -22,7 +22,7 @@
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include "types.h"
|
||||
#include "EQDBRes.h"
|
||||
#include "eqdb_res.h"
|
||||
#include <mysql.h>
|
||||
|
||||
//this is the main object exported to perl.
|
||||
@@ -16,7 +16,7 @@
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "debug.h"
|
||||
#include "EQDBRes.h"
|
||||
#include "eqdb_res.h"
|
||||
#include <mysql.h>
|
||||
|
||||
std::vector<std::string> EQDBRes::fetch_row_array() {
|
||||
@@ -16,8 +16,8 @@
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "../common/debug.h"
|
||||
#include "EQEmuConfig.h"
|
||||
#include "MiscFunctions.h"
|
||||
#include "eqemu_config.h"
|
||||
#include "misc_functions.h"
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#ifndef __EQEmuConfig_H
|
||||
#define __EQEmuConfig_H
|
||||
|
||||
#include "XMLParser.h"
|
||||
#include "xml_parser.h"
|
||||
#include "linked_list.h"
|
||||
|
||||
struct LoginConfig {
|
||||
@@ -112,14 +112,14 @@ protected:
|
||||
|
||||
#define ELEMENT(name) \
|
||||
void do_##name(TiXmlElement *ele);
|
||||
#include "EQEmuConfig_elements.h"
|
||||
#include "eqemu_config_elements.h"
|
||||
|
||||
|
||||
EQEmuConfig() {
|
||||
// import the needed handler prototypes
|
||||
#define ELEMENT(name) \
|
||||
Handlers[#name]=(ElementHandler)&EQEmuConfig::do_##name;
|
||||
#include "EQEmuConfig_elements.h"
|
||||
#include "eqemu_config_elements.h"
|
||||
|
||||
// Set sane defaults
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
#ifdef _WINDOWS
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#include "EQEMuError.h"
|
||||
#include "eqemu_error.h"
|
||||
#include "linked_list.h"
|
||||
#include "Mutex.h"
|
||||
#include "MiscFunctions.h"
|
||||
#include "mutex.h"
|
||||
#include "misc_functions.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#ifdef _WINDOWS
|
||||
+2
-2
@@ -144,7 +144,7 @@ bool EQTime::saveFile(const char *filename)
|
||||
return false;
|
||||
}
|
||||
//Enable for debugging
|
||||
//cout << "SAVE: day=" << (long)eqTime.start_eqtime.day << ";hour=" << (long)eqTime.start_eqtime.hour << ";min=" << (long)eqTime.start_eqtime.minute << ";mon=" << (long)eqTime.start_eqtime.month << ";yr=" << eqTime.start_eqtime.year << ";timet=" << eqTime.start_realtime << endl;
|
||||
//std::cout << "SAVE: day=" << (long)eqTime.start_eqtime.day << ";hour=" << (long)eqTime.start_eqtime.hour << ";min=" << (long)eqTime.start_eqtime.minute << ";mon=" << (long)eqTime.start_eqtime.month << ";yr=" << eqTime.start_eqtime.year << ";timet=" << eqTime.start_realtime << std::endl;
|
||||
of << EQT_VERSION << std::endl;
|
||||
of << (long)eqTime.start_eqtime.day << std::endl;
|
||||
of << (long)eqTime.start_eqtime.hour << std::endl;
|
||||
@@ -194,7 +194,7 @@ bool EQTime::loadFile(const char *filename)
|
||||
in.ignore(80, '\n');
|
||||
in >> eqTime.start_realtime;
|
||||
//Enable for debugging...
|
||||
//cout << "LOAD: day=" << (long)eqTime.start_eqtime.day << ";hour=" << (long)eqTime.start_eqtime.hour << ";min=" << (long)eqTime.start_eqtime.minute << ";mon=" << (long)eqTime.start_eqtime.month << ";yr=" << eqTime.start_eqtime.year << ";timet=" << eqTime.start_realtime << endl;
|
||||
//std::cout << "LOAD: day=" << (long)eqTime.start_eqtime.day << ";hour=" << (long)eqTime.start_eqtime.hour << ";min=" << (long)eqTime.start_eqtime.minute << ";mon=" << (long)eqTime.start_eqtime.month << ";yr=" << eqTime.start_eqtime.year << ";timet=" << eqTime.start_realtime << std::endl;
|
||||
in.close();
|
||||
return true;
|
||||
}
|
||||
|
||||
+2
-2
@@ -19,7 +19,7 @@
|
||||
#define EXTENDED_PROFILE_H
|
||||
|
||||
#include "eq_packet_structs.h"
|
||||
#include "Item.h"
|
||||
#include "item.h"
|
||||
|
||||
|
||||
#pragma pack(1)
|
||||
@@ -41,7 +41,7 @@ struct ExtendedProfile_Struct {
|
||||
uint16 old_pet_hp;
|
||||
uint16 old_pet_mana;
|
||||
SpellBuff_Struct pet_buffs[BUFF_COUNT];
|
||||
uint32 pet_items[MAX_MATERIALS];
|
||||
uint32 pet_items[_MaterialCount];
|
||||
char merc_name[64];
|
||||
|
||||
uint32 aa_effects;
|
||||
|
||||
+3
-19
@@ -51,12 +51,6 @@ Core Zone features
|
||||
//this seems to make perl very unhappy on reload, and crashes
|
||||
#define EMBPERL_IO_CAPTURE
|
||||
|
||||
//enable perl-based in-game command, pretty useless without EMBPERL_XS_CLASSES
|
||||
#define EMBPERL_COMMANDS
|
||||
|
||||
//enable #plugin and #peval, which requires IO::Stringy
|
||||
//#define EMBPERL_EVAL_COMMANDS
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -89,8 +83,8 @@ Zone extensions and features
|
||||
#ifdef QUEST_SCRIPTS_BYNAME
|
||||
//extends byname system to look in a templates directory
|
||||
//independant of zone name
|
||||
#define QUEST_TEMPLATES_BYNAME
|
||||
#define QUEST_TEMPLATES_DIRECTORY "templates"
|
||||
#define QUEST_GLOBAL_BYNAME
|
||||
#define QUEST_GLOBAL_DIRECTORY "global"
|
||||
#endif
|
||||
|
||||
//the min ratio at which a mob's speed is reduced
|
||||
@@ -111,9 +105,6 @@ Zone extensions and features
|
||||
//uncomment to allow perl commands to override compiled commands
|
||||
#define COMMANDS_PERL_OVERRIDE
|
||||
|
||||
//enable logging of commands used
|
||||
#define COMMANDS_LOGGING
|
||||
|
||||
//only log commands which require this minimum status or more
|
||||
#define COMMANDS_LOGGING_MIN_STATUS 1
|
||||
|
||||
@@ -123,18 +114,11 @@ Zone extensions and features
|
||||
//New aggro system to reduce overhead.
|
||||
#define REVERSE_AGGRO
|
||||
|
||||
//Enable spacial queue to manage NPC update packets
|
||||
//#define PACKET_UPDATE_MANAGER
|
||||
//#define MANAGE_HP_UPDATES
|
||||
|
||||
//The highest you can #setskill / #setallskill
|
||||
#define HIGHEST_CAN_SET_SKILL 400
|
||||
|
||||
#define SKILL_MAX_LEVEL 75
|
||||
|
||||
//#define MIN_RANGED_ATK_RANGE 25
|
||||
//replaced the above define with RuleI(Combat, MinRangedAttackDist)
|
||||
|
||||
/*
|
||||
|
||||
Zone Numerical configuration
|
||||
@@ -175,7 +159,7 @@ enum { //timer settings, all in milliseconds
|
||||
AItarget_check_duration = 500,
|
||||
AIClientScanarea_delay = 750, //used in REVERSE_AGGRO
|
||||
AIassistcheck_delay = 3000, //now often a fighting NPC will yell for help
|
||||
ClientProximity_interval = 1000,
|
||||
ClientProximity_interval = 150,
|
||||
CombatEventTimer_expire = 12000,
|
||||
Tribute_duration = 600000,
|
||||
ZoneTimerResolution = 3, //sleep time between zone main loop runs (milliseconds)
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2005 - 2013 G-Truc Creation
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
@@ -0,0 +1,40 @@
|
||||
set(NAME glm_dummy)
|
||||
|
||||
file(GLOB ROOT_SOURCE *.cpp)
|
||||
file(GLOB ROOT_INLINE *.inl)
|
||||
file(GLOB ROOT_HEADER *.hpp)
|
||||
file(GLOB ROOT_TEXT ../*.txt)
|
||||
|
||||
file(GLOB_RECURSE CORE_SOURCE ./detail/*.cpp)
|
||||
file(GLOB_RECURSE CORE_INLINE ./detail/*.inl)
|
||||
file(GLOB_RECURSE CORE_HEADER ./detail/*.hpp)
|
||||
|
||||
file(GLOB_RECURSE GTC_SOURCE ./gtc/*.cpp)
|
||||
file(GLOB_RECURSE GTC_INLINE ./gtc/*.inl)
|
||||
file(GLOB_RECURSE GTC_HEADER ./gtc/*.hpp)
|
||||
|
||||
file(GLOB_RECURSE GTX_SOURCE ./gtx/*.cpp)
|
||||
file(GLOB_RECURSE GTX_INLINE ./gtx/*.inl)
|
||||
file(GLOB_RECURSE GTX_HEADER ./gtx/*.hpp)
|
||||
|
||||
source_group("Text Files" FILES ${ROOT_TEXT})
|
||||
source_group("Core Files" FILES ${CORE_SOURCE})
|
||||
source_group("Core Files" FILES ${CORE_INLINE})
|
||||
source_group("Core Files" FILES ${CORE_HEADER})
|
||||
source_group("GTC Files" FILES ${GTC_SOURCE})
|
||||
source_group("GTC Files" FILES ${GTC_INLINE})
|
||||
source_group("GTC Files" FILES ${GTC_HEADER})
|
||||
source_group("GTX Files" FILES ${GTX_SOURCE})
|
||||
source_group("GTX Files" FILES ${GTX_INLINE})
|
||||
source_group("GTX Files" FILES ${GTX_HEADER})
|
||||
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
|
||||
|
||||
add_executable(${NAME} ${ROOT_TEXT}
|
||||
${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER}
|
||||
${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER}
|
||||
${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER}
|
||||
${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER})
|
||||
|
||||
#add_library(glm STATIC glm.cpp)
|
||||
#add_library(glm_shared SHARED glm.cpp)
|
||||
@@ -0,0 +1,34 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/common.hpp
|
||||
/// @date 2013-12-24 / 2013-12-24
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef GLM_COMMON_INCLUDED
|
||||
#define GLM_COMMON_INCLUDED
|
||||
|
||||
#include "detail/func_common.hpp"
|
||||
|
||||
#endif//GLM_COMMON_INCLUDED
|
||||
@@ -0,0 +1,427 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/_features.hpp
|
||||
/// @date 2013-02-20 / 2013-02-20
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef glm_core_features
|
||||
#define glm_core_features
|
||||
|
||||
// #define GLM_CXX98_EXCEPTIONS
|
||||
// #define GLM_CXX98_RTTI
|
||||
|
||||
// #define GLM_CXX11_RVALUE_REFERENCES
|
||||
// Rvalue references - GCC 4.3
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2118.html
|
||||
|
||||
// GLM_CXX11_TRAILING_RETURN
|
||||
// Rvalue references for *this - GCC not supported
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2439.htm
|
||||
|
||||
// GLM_CXX11_NONSTATIC_MEMBER_INIT
|
||||
// Initialization of class objects by rvalues - GCC any
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1610.html
|
||||
|
||||
// GLM_CXX11_NONSTATIC_MEMBER_INIT
|
||||
// Non-static data member initializers - GCC 4.7
|
||||
// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2756.htm
|
||||
|
||||
// #define GLM_CXX11_VARIADIC_TEMPLATE
|
||||
// Variadic templates - GCC 4.3
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2242.pdf
|
||||
|
||||
//
|
||||
// Extending variadic template template parameters - GCC 4.4
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf
|
||||
|
||||
// #define GLM_CXX11_GENERALIZED_INITIALIZERS
|
||||
// Initializer lists - GCC 4.4
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm
|
||||
|
||||
// #define GLM_CXX11_STATIC_ASSERT
|
||||
// Static assertions - GCC 4.3
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.html
|
||||
|
||||
// #define GLM_CXX11_AUTO_TYPE
|
||||
// auto-typed variables - GCC 4.4
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1984.pdf
|
||||
|
||||
// #define GLM_CXX11_AUTO_TYPE
|
||||
// Multi-declarator auto - GCC 4.4
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1737.pdf
|
||||
|
||||
// #define GLM_CXX11_AUTO_TYPE
|
||||
// Removal of auto as a storage-class specifier - GCC 4.4
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2546.htm
|
||||
|
||||
// #define GLM_CXX11_AUTO_TYPE
|
||||
// New function declarator syntax - GCC 4.4
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2541.htm
|
||||
|
||||
// #define GLM_CXX11_LAMBDAS
|
||||
// New wording for C++0x lambdas - GCC 4.5
|
||||
// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2927.pdf
|
||||
|
||||
// #define GLM_CXX11_DECLTYPE
|
||||
// Declared type of an expression - GCC 4.3
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf
|
||||
|
||||
//
|
||||
// Right angle brackets - GCC 4.3
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html
|
||||
|
||||
//
|
||||
// Default template arguments for function templates DR226 GCC 4.3
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#226
|
||||
|
||||
//
|
||||
// Solving the SFINAE problem for expressions DR339 GCC 4.4
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2634.html
|
||||
|
||||
// #define GLM_CXX11_ALIAS_TEMPLATE
|
||||
// Template aliases N2258 GCC 4.7
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf
|
||||
|
||||
//
|
||||
// Extern templates N1987 Yes
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1987.htm
|
||||
|
||||
// #define GLM_CXX11_NULLPTR
|
||||
// Null pointer constant N2431 GCC 4.6
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf
|
||||
|
||||
// #define GLM_CXX11_STRONG_ENUMS
|
||||
// Strongly-typed enums N2347 GCC 4.4
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf
|
||||
|
||||
//
|
||||
// Forward declarations for enums N2764 GCC 4.6
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2764.pdf
|
||||
|
||||
//
|
||||
// Generalized attributes N2761 GCC 4.8
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf
|
||||
|
||||
//
|
||||
// Generalized constant expressions N2235 GCC 4.6
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf
|
||||
|
||||
//
|
||||
// Alignment support N2341 GCC 4.8
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf
|
||||
|
||||
// #define GLM_CXX11_DELEGATING_CONSTRUCTORS
|
||||
// Delegating constructors N1986 GCC 4.7
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf
|
||||
|
||||
//
|
||||
// Inheriting constructors N2540 GCC 4.8
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2540.htm
|
||||
|
||||
// #define GLM_CXX11_EXPLICIT_CONVERSIONS
|
||||
// Explicit conversion operators N2437 GCC 4.5
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf
|
||||
|
||||
//
|
||||
// New character types N2249 GCC 4.4
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2249.html
|
||||
|
||||
//
|
||||
// Unicode string literals N2442 GCC 4.5
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm
|
||||
|
||||
//
|
||||
// Raw string literals N2442 GCC 4.5
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm
|
||||
|
||||
//
|
||||
// Universal character name literals N2170 GCC 4.5
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2170.html
|
||||
|
||||
// #define GLM_CXX11_USER_LITERALS
|
||||
// User-defined literals N2765 GCC 4.7
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2765.pdf
|
||||
|
||||
//
|
||||
// Standard Layout Types N2342 GCC 4.5
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2342.htm
|
||||
|
||||
// #define GLM_CXX11_DEFAULTED_FUNCTIONS
|
||||
// #define GLM_CXX11_DELETED_FUNCTIONS
|
||||
// Defaulted and deleted functions N2346 GCC 4.4
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm
|
||||
|
||||
//
|
||||
// Extended friend declarations N1791 GCC 4.7
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1791.pdf
|
||||
|
||||
//
|
||||
// Extending sizeof N2253 GCC 4.4
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2253.html
|
||||
|
||||
// #define GLM_CXX11_INLINE_NAMESPACES
|
||||
// Inline namespaces N2535 GCC 4.4
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2535.htm
|
||||
|
||||
// #define GLM_CXX11_UNRESTRICTED_UNIONS
|
||||
// Unrestricted unions N2544 GCC 4.6
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf
|
||||
|
||||
// #define GLM_CXX11_LOCAL_TYPE_TEMPLATE_ARGS
|
||||
// Local and unnamed types as template arguments N2657 GCC 4.5
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm
|
||||
|
||||
// #define GLM_CXX11_RANGE_FOR
|
||||
// Range-based for N2930 GCC 4.6
|
||||
// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2930.html
|
||||
|
||||
// #define GLM_CXX11_OVERRIDE_CONTROL
|
||||
// Explicit virtual overrides N2928 N3206 N3272 GCC 4.7
|
||||
// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2928.htm
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3206.htm
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm
|
||||
|
||||
//
|
||||
// Minimal support for garbage collection and reachability-based leak detection N2670 No
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2670.htm
|
||||
|
||||
// #define GLM_CXX11_NOEXCEPT
|
||||
// Allowing move constructors to throw [noexcept] N3050 GCC 4.6 (core language only)
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3050.html
|
||||
|
||||
//
|
||||
// Defining move special member functions N3053 GCC 4.6
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3053.html
|
||||
|
||||
//
|
||||
// Sequence points N2239 Yes
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2239.html
|
||||
|
||||
//
|
||||
// Atomic operations N2427 GCC 4.4
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2239.html
|
||||
|
||||
//
|
||||
// Strong Compare and Exchange N2748 GCC 4.5
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2427.html
|
||||
|
||||
//
|
||||
// Bidirectional Fences N2752 GCC 4.8
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2752.htm
|
||||
|
||||
//
|
||||
// Memory model N2429 GCC 4.8
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2429.htm
|
||||
|
||||
//
|
||||
// Data-dependency ordering: atomics and memory model N2664 GCC 4.4
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2664.htm
|
||||
|
||||
//
|
||||
// Propagating exceptions N2179 GCC 4.4
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html
|
||||
|
||||
//
|
||||
// Abandoning a process and at_quick_exit N2440 GCC 4.8
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2440.htm
|
||||
|
||||
//
|
||||
// Allow atomics use in signal handlers N2547 Yes
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2547.htm
|
||||
|
||||
//
|
||||
// Thread-local storage N2659 GCC 4.8
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2659.htm
|
||||
|
||||
//
|
||||
// Dynamic initialization and destruction with concurrency N2660 GCC 4.3
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2660.htm
|
||||
|
||||
//
|
||||
// __func__ predefined identifier N2340 GCC 4.3
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2340.htm
|
||||
|
||||
//
|
||||
// C99 preprocessor N1653 GCC 4.3
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm
|
||||
|
||||
//
|
||||
// long long N1811 GCC 4.3
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1811.pdf
|
||||
|
||||
//
|
||||
// Extended integral types N1988 Yes
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1988.pdf
|
||||
|
||||
#if(GLM_COMPILER & GLM_COMPILER_GCC)
|
||||
|
||||
# if(GLM_COMPILER >= GLM_COMPILER_GCC43)
|
||||
# define GLM_CXX11_STATIC_ASSERT
|
||||
# endif
|
||||
|
||||
#elif(GLM_COMPILER & GLM_COMPILER_CLANG)
|
||||
# if(__has_feature(cxx_exceptions))
|
||||
# define GLM_CXX98_EXCEPTIONS
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_rtti))
|
||||
# define GLM_CXX98_RTTI
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_access_control_sfinae))
|
||||
# define GLM_CXX11_ACCESS_CONTROL_SFINAE
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_alias_templates))
|
||||
# define GLM_CXX11_ALIAS_TEMPLATE
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_alignas))
|
||||
# define GLM_CXX11_ALIGNAS
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_attributes))
|
||||
# define GLM_CXX11_ATTRIBUTES
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_constexpr))
|
||||
# define GLM_CXX11_CONSTEXPR
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_decltype))
|
||||
# define GLM_CXX11_DECLTYPE
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_default_function_template_args))
|
||||
# define GLM_CXX11_DEFAULT_FUNCTION_TEMPLATE_ARGS
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_defaulted_functions))
|
||||
# define GLM_CXX11_DEFAULTED_FUNCTIONS
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_delegating_constructors))
|
||||
# define GLM_CXX11_DELEGATING_CONSTRUCTORS
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_deleted_functions))
|
||||
# define GLM_CXX11_DELETED_FUNCTIONS
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_explicit_conversions))
|
||||
# define GLM_CXX11_EXPLICIT_CONVERSIONS
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_generalized_initializers))
|
||||
# define GLM_CXX11_GENERALIZED_INITIALIZERS
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_implicit_moves))
|
||||
# define GLM_CXX11_IMPLICIT_MOVES
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_inheriting_constructors))
|
||||
# define GLM_CXX11_INHERITING_CONSTRUCTORS
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_inline_namespaces))
|
||||
# define GLM_CXX11_INLINE_NAMESPACES
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_lambdas))
|
||||
# define GLM_CXX11_LAMBDAS
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_local_type_template_args))
|
||||
# define GLM_CXX11_LOCAL_TYPE_TEMPLATE_ARGS
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_noexcept))
|
||||
# define GLM_CXX11_NOEXCEPT
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_nonstatic_member_init))
|
||||
# define GLM_CXX11_NONSTATIC_MEMBER_INIT
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_nullptr))
|
||||
# define GLM_CXX11_NULLPTR
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_override_control))
|
||||
# define GLM_CXX11_OVERRIDE_CONTROL
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_reference_qualified_functions))
|
||||
# define GLM_CXX11_REFERENCE_QUALIFIED_FUNCTIONS
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_range_for))
|
||||
# define GLM_CXX11_RANGE_FOR
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_raw_string_literals))
|
||||
# define GLM_CXX11_RAW_STRING_LITERALS
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_rvalue_references))
|
||||
# define GLM_CXX11_RVALUE_REFERENCES
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_static_assert))
|
||||
# define GLM_CXX11_STATIC_ASSERT
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_auto_type))
|
||||
# define GLM_CXX11_AUTO_TYPE
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_strong_enums))
|
||||
# define GLM_CXX11_STRONG_ENUMS
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_trailing_return))
|
||||
# define GLM_CXX11_TRAILING_RETURN
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_unicode_literals))
|
||||
# define GLM_CXX11_UNICODE_LITERALS
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_unrestricted_unions))
|
||||
# define GLM_CXX11_UNRESTRICTED_UNIONS
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_user_literals))
|
||||
# define GLM_CXX11_USER_LITERALS
|
||||
# endif
|
||||
|
||||
# if(__has_feature(cxx_variadic_templates))
|
||||
# define GLM_CXX11_VARIADIC_TEMPLATES
|
||||
# endif
|
||||
|
||||
#endif//(GLM_COMPILER & GLM_COMPILER_CLANG)
|
||||
|
||||
#endif//glm_core_features
|
||||
@@ -0,0 +1,55 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/_fixes.hpp
|
||||
/// @date 2011-02-21 / 2011-11-22
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <cmath>
|
||||
|
||||
//! Workaround for compatibility with other libraries
|
||||
#ifdef max
|
||||
#undef max
|
||||
#endif
|
||||
|
||||
//! Workaround for compatibility with other libraries
|
||||
#ifdef min
|
||||
#undef min
|
||||
#endif
|
||||
|
||||
//! Workaround for Android
|
||||
#ifdef isnan
|
||||
#undef isnan
|
||||
#endif
|
||||
|
||||
//! Workaround for Android
|
||||
#ifdef isinf
|
||||
#undef isinf
|
||||
#endif
|
||||
|
||||
//! Workaround for Chrone Native Client
|
||||
#ifdef log2
|
||||
#undef log2
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/_literals.hpp
|
||||
/// @date 2013-05-06 / 2013-05-06
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef glm_core_literals
|
||||
#define glm_core_literals
|
||||
|
||||
namespace glm
|
||||
{
|
||||
#define GLM_CXX11_USER_LITERALS
|
||||
#ifdef GLM_CXX11_USER_LITERALS
|
||||
/*
|
||||
GLM_FUNC_QUALIFIER detail::half operator "" _h(long double const s)
|
||||
{
|
||||
return detail::half(s);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER float operator "" _f(long double const s)
|
||||
{
|
||||
return static_cast<float>(s);
|
||||
}
|
||||
*/
|
||||
#endif//GLM_CXX11_USER_LITERALS
|
||||
|
||||
}//namespace glm
|
||||
|
||||
#endif//glm_core_literals
|
||||
@@ -0,0 +1,130 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/detail/_noise.hpp
|
||||
/// @date 2013-12-24 / 2013-12-24
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef GLM_DETAIL_NOISE_INCLUDED
|
||||
#define GLM_DETAIL_NOISE_INCLUDED
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER T mod289(T const & x)
|
||||
{
|
||||
return x - floor(x * static_cast<T>(1.0) / static_cast<T>(289.0)) * static_cast<T>(289.0);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER T permute(T const & x)
|
||||
{
|
||||
return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> permute(tvec2<T, P> const & x)
|
||||
{
|
||||
return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> permute(tvec3<T, P> const & x)
|
||||
{
|
||||
return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec4<T, P> permute(tvec4<T, P> const & x)
|
||||
{
|
||||
return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
|
||||
}
|
||||
/*
|
||||
template <typename T, precision P, template<typename> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> permute(vecType<T, P> const & x)
|
||||
{
|
||||
return mod289(((x * T(34)) + T(1)) * x);
|
||||
}
|
||||
*/
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER T taylorInvSqrt(T const & r)
|
||||
{
|
||||
return T(1.79284291400159) - T(0.85373472095314) * r;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER detail::tvec2<T, P> taylorInvSqrt(detail::tvec2<T, P> const & r)
|
||||
{
|
||||
return T(1.79284291400159) - T(0.85373472095314) * r;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER detail::tvec3<T, P> taylorInvSqrt(detail::tvec3<T, P> const & r)
|
||||
{
|
||||
return T(1.79284291400159) - T(0.85373472095314) * r;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER detail::tvec4<T, P> taylorInvSqrt(detail::tvec4<T, P> const & r)
|
||||
{
|
||||
return T(1.79284291400159) - T(0.85373472095314) * r;
|
||||
}
|
||||
/*
|
||||
template <typename T, precision P, template<typename> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> taylorInvSqrt(vecType<T, P> const & r)
|
||||
{
|
||||
return T(1.79284291400159) - T(0.85373472095314) * r;
|
||||
}
|
||||
*/
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER detail::tvec2<T, P> fade(detail::tvec2<T, P> const & t)
|
||||
{
|
||||
return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER detail::tvec3<T, P> fade(detail::tvec3<T, P> const & t)
|
||||
{
|
||||
return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER detail::tvec4<T, P> fade(detail::tvec4<T, P> const & t)
|
||||
{
|
||||
return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
|
||||
}
|
||||
/*
|
||||
template <typename T, precision P, template <typename> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> fade(vecType<T, P> const & t)
|
||||
{
|
||||
return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
|
||||
}
|
||||
*/
|
||||
}//namespace detail
|
||||
}//namespace glm
|
||||
|
||||
#endif//GLM_DETAIL_NOISE_INCLUDED
|
||||
|
||||
@@ -0,0 +1,840 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/_swizzle.hpp
|
||||
/// @date 2006-04-20 / 2011-02-16
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef glm_core_swizzle
|
||||
#define glm_core_swizzle
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
// Internal class for implementing swizzle operators
|
||||
template <typename T, int N>
|
||||
struct _swizzle_base0
|
||||
{
|
||||
typedef T value_type;
|
||||
|
||||
protected:
|
||||
GLM_FUNC_QUALIFIER value_type& elem (size_t i) { return (reinterpret_cast<value_type*>(_buffer))[i]; }
|
||||
GLM_FUNC_QUALIFIER const value_type& elem (size_t i) const { return (reinterpret_cast<const value_type*>(_buffer))[i]; }
|
||||
|
||||
// Use an opaque buffer to *ensure* the compiler doesn't call a constructor.
|
||||
// The size 1 buffer is assumed to aligned to the actual members so that the
|
||||
// elem()
|
||||
char _buffer[1];
|
||||
};
|
||||
|
||||
template <typename T, precision P, typename V, int E0, int E1, int E2, int E3, int N>
|
||||
struct _swizzle_base1 : public _swizzle_base0<T, N>
|
||||
{
|
||||
};
|
||||
|
||||
template <typename T, precision P, typename V, int E0, int E1>
|
||||
struct _swizzle_base1<T, P, V,E0,E1,-1,-2,2> : public _swizzle_base0<T, 2>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER V operator ()() const { return V(this->elem(E0), this->elem(E1)); }
|
||||
};
|
||||
|
||||
template <typename T, precision P, typename V, int E0, int E1, int E2>
|
||||
struct _swizzle_base1<T, P, V,E0,E1,E2,-1,3> : public _swizzle_base0<T, 3>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER V operator ()() const { return V(this->elem(E0), this->elem(E1), this->elem(E2)); }
|
||||
};
|
||||
|
||||
template <typename T, precision P, typename V, int E0, int E1, int E2, int E3>
|
||||
struct _swizzle_base1<T, P, V,E0,E1,E2,E3,4> : public _swizzle_base0<T, 4>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER V operator ()() const { return V(this->elem(E0), this->elem(E1), this->elem(E2), this->elem(E3)); }
|
||||
};
|
||||
|
||||
// Internal class for implementing swizzle operators
|
||||
/*
|
||||
Template parameters:
|
||||
|
||||
ValueType = type of scalar values (e.g. float, double)
|
||||
VecType = class the swizzle is applies to (e.g. tvec3<float>)
|
||||
N = number of components in the vector (e.g. 3)
|
||||
E0...3 = what index the n-th element of this swizzle refers to in the unswizzled vec
|
||||
|
||||
DUPLICATE_ELEMENTS = 1 if there is a repeated element, 0 otherwise (used to specialize swizzles
|
||||
containing duplicate elements so that they cannot be used as r-values).
|
||||
*/
|
||||
template <typename ValueType, precision P, typename VecType, int N, int E0, int E1, int E2, int E3, int DUPLICATE_ELEMENTS>
|
||||
struct _swizzle_base2 : public _swizzle_base1<ValueType, P, VecType,E0,E1,E2,E3,N>
|
||||
{
|
||||
typedef VecType vec_type;
|
||||
typedef ValueType value_type;
|
||||
|
||||
GLM_FUNC_QUALIFIER _swizzle_base2& operator= (const ValueType& t)
|
||||
{
|
||||
for (int i = 0; i < N; ++i)
|
||||
(*this)[i] = t;
|
||||
return *this;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER _swizzle_base2& operator= (const VecType& that)
|
||||
{
|
||||
struct op {
|
||||
GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e = t; }
|
||||
};
|
||||
_apply_op(that, op());
|
||||
return *this;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER void operator -= (const VecType& that)
|
||||
{
|
||||
struct op {
|
||||
GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e -= t; }
|
||||
};
|
||||
_apply_op(that, op());
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER void operator += (const VecType& that)
|
||||
{
|
||||
struct op {
|
||||
GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e += t; }
|
||||
};
|
||||
_apply_op(that, op());
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER void operator *= (const VecType& that)
|
||||
{
|
||||
struct op {
|
||||
GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e *= t; }
|
||||
};
|
||||
_apply_op(that, op());
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER void operator /= (const VecType& that)
|
||||
{
|
||||
struct op {
|
||||
GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e /= t; }
|
||||
};
|
||||
_apply_op(that, op());
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER value_type& operator[] (size_t i)
|
||||
{
|
||||
#ifndef __CUDA_ARCH__
|
||||
static
|
||||
#endif
|
||||
const int offset_dst[4] = { E0, E1, E2, E3 };
|
||||
return this->elem(offset_dst[i]);
|
||||
}
|
||||
GLM_FUNC_QUALIFIER value_type operator[] (size_t i) const
|
||||
{
|
||||
#ifndef __CUDA_ARCH__
|
||||
static
|
||||
#endif
|
||||
const int offset_dst[4] = { E0, E1, E2, E3 };
|
||||
return this->elem(offset_dst[i]);
|
||||
}
|
||||
protected:
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER void _apply_op(const VecType& that, T op)
|
||||
{
|
||||
// Make a copy of the data in this == &that.
|
||||
// The copier should optimize out the copy in cases where the function is
|
||||
// properly inlined and the copy is not necessary.
|
||||
ValueType t[N];
|
||||
for (int i = 0; i < N; ++i)
|
||||
t[i] = that[i];
|
||||
for (int i = 0; i < N; ++i)
|
||||
op( (*this)[i], t[i] );
|
||||
}
|
||||
};
|
||||
|
||||
// Specialization for swizzles containing duplicate elements. These cannot be modified.
|
||||
template <typename ValueType, precision P, typename VecType, int N, int E0, int E1, int E2, int E3>
|
||||
struct _swizzle_base2<ValueType, P, VecType,N,E0,E1,E2,E3,1> : public _swizzle_base1<ValueType, P, VecType,E0,E1,E2,E3,N>
|
||||
{
|
||||
typedef VecType vec_type;
|
||||
typedef ValueType value_type;
|
||||
|
||||
struct Stub {};
|
||||
GLM_FUNC_QUALIFIER _swizzle_base2& operator= (Stub const &) { return *this; }
|
||||
|
||||
GLM_FUNC_QUALIFIER value_type operator[] (size_t i) const
|
||||
{
|
||||
#ifndef __CUDA_ARCH__
|
||||
static
|
||||
#endif
|
||||
const int offset_dst[4] = { E0, E1, E2, E3 };
|
||||
return this->elem(offset_dst[i]);
|
||||
}
|
||||
};
|
||||
|
||||
template <int N,typename ValueType, precision P, typename VecType, int E0,int E1,int E2,int E3>
|
||||
struct _swizzle : public _swizzle_base2<ValueType, P, VecType, N,E0,E1,E2,E3,(E0==E1||E0==E2||E0==E3||E1==E2||E1==E3||E2==E3)>
|
||||
{
|
||||
typedef _swizzle_base2<ValueType, P, VecType,N,E0,E1,E2,E3,(E0==E1||E0==E2||E0==E3||E1==E2||E1==E3||E2==E3)> base_type;
|
||||
|
||||
using base_type::operator=;
|
||||
|
||||
GLM_FUNC_QUALIFIER operator VecType () const { return (*this)(); }
|
||||
};
|
||||
|
||||
//
|
||||
// To prevent the C++ syntax from getting entirely overwhelming, define some alias macros
|
||||
//
|
||||
#define _GLM_SWIZZLE_TEMPLATE1 template <int N, typename T, precision P, typename V, int E0, int E1, int E2, int E3>
|
||||
#define _GLM_SWIZZLE_TEMPLATE2 template <int N, typename T, precision P, typename V, int E0, int E1, int E2, int E3, int F0, int F1, int F2, int F3>
|
||||
#define _GLM_SWIZZLE_TYPE1 _swizzle<N, T, P, V, E0, E1, E2, E3>
|
||||
#define _GLM_SWIZZLE_TYPE2 _swizzle<N, T, P, V, F0, F1, F2, F3>
|
||||
|
||||
//
|
||||
// Wrapper for a binary operator (e.g. u.yy + v.zy)
|
||||
//
|
||||
#define _GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(OPERAND) \
|
||||
_GLM_SWIZZLE_TEMPLATE2 \
|
||||
GLM_FUNC_QUALIFIER V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b) \
|
||||
{ \
|
||||
return a() OPERAND b(); \
|
||||
} \
|
||||
_GLM_SWIZZLE_TEMPLATE1 \
|
||||
GLM_FUNC_QUALIFIER V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const V& b) \
|
||||
{ \
|
||||
return a() OPERAND b; \
|
||||
} \
|
||||
_GLM_SWIZZLE_TEMPLATE1 \
|
||||
GLM_FUNC_QUALIFIER V operator OPERAND ( const V& a, const _GLM_SWIZZLE_TYPE1& b) \
|
||||
{ \
|
||||
return a OPERAND b(); \
|
||||
}
|
||||
|
||||
//
|
||||
// Wrapper for a operand between a swizzle and a binary (e.g. 1.0f - u.xyz)
|
||||
//
|
||||
#define _GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(OPERAND) \
|
||||
_GLM_SWIZZLE_TEMPLATE1 \
|
||||
GLM_FUNC_QUALIFIER V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const T& b) \
|
||||
{ \
|
||||
return a() OPERAND b; \
|
||||
} \
|
||||
_GLM_SWIZZLE_TEMPLATE1 \
|
||||
GLM_FUNC_QUALIFIER V operator OPERAND ( const T& a, const _GLM_SWIZZLE_TYPE1& b) \
|
||||
{ \
|
||||
return a OPERAND b(); \
|
||||
}
|
||||
|
||||
//
|
||||
// Macro for wrapping a function taking one argument (e.g. abs())
|
||||
//
|
||||
#define _GLM_SWIZZLE_FUNCTION_1_ARGS(RETURN_TYPE,FUNCTION) \
|
||||
_GLM_SWIZZLE_TEMPLATE1 \
|
||||
GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a) \
|
||||
{ \
|
||||
return FUNCTION(a()); \
|
||||
}
|
||||
|
||||
//
|
||||
// Macro for wrapping a function taking two vector arguments (e.g. dot()).
|
||||
//
|
||||
#define _GLM_SWIZZLE_FUNCTION_2_ARGS(RETURN_TYPE,FUNCTION) \
|
||||
_GLM_SWIZZLE_TEMPLATE2 \
|
||||
GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b) \
|
||||
{ \
|
||||
return FUNCTION(a(), b()); \
|
||||
} \
|
||||
_GLM_SWIZZLE_TEMPLATE1 \
|
||||
GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE1& b) \
|
||||
{ \
|
||||
return FUNCTION(a(), b()); \
|
||||
} \
|
||||
_GLM_SWIZZLE_TEMPLATE1 \
|
||||
GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const typename V& b) \
|
||||
{ \
|
||||
return FUNCTION(a(), b); \
|
||||
} \
|
||||
_GLM_SWIZZLE_TEMPLATE1 \
|
||||
GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const V& a, const _GLM_SWIZZLE_TYPE1& b) \
|
||||
{ \
|
||||
return FUNCTION(a, b()); \
|
||||
}
|
||||
|
||||
//
|
||||
// Macro for wrapping a function take 2 vec arguments followed by a scalar (e.g. mix()).
|
||||
//
|
||||
#define _GLM_SWIZZLE_FUNCTION_2_ARGS_SCALAR(RETURN_TYPE,FUNCTION) \
|
||||
_GLM_SWIZZLE_TEMPLATE2 \
|
||||
GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b, const T& c) \
|
||||
{ \
|
||||
return FUNCTION(a(), b(), c); \
|
||||
} \
|
||||
_GLM_SWIZZLE_TEMPLATE1 \
|
||||
GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE1& b, const T& c) \
|
||||
{ \
|
||||
return FUNCTION(a(), b(), c); \
|
||||
} \
|
||||
_GLM_SWIZZLE_TEMPLATE1 \
|
||||
GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const typename S0::vec_type& b, const T& c)\
|
||||
{ \
|
||||
return FUNCTION(a(), b, c); \
|
||||
} \
|
||||
_GLM_SWIZZLE_TEMPLATE1 \
|
||||
GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const typename V& a, const _GLM_SWIZZLE_TYPE1& b, const T& c) \
|
||||
{ \
|
||||
return FUNCTION(a, b(), c); \
|
||||
}
|
||||
|
||||
}//namespace detail
|
||||
}//namespace glm
|
||||
|
||||
namespace glm
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
_GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(-)
|
||||
_GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(*)
|
||||
_GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(+)
|
||||
_GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(-)
|
||||
_GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(*)
|
||||
_GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(/)
|
||||
}
|
||||
|
||||
//
|
||||
// Swizzles are distinct types from the unswizzled type. The below macros will
|
||||
// provide template specializations for the swizzle types for the given functions
|
||||
// so that the compiler does not have any ambiguity to choosing how to handle
|
||||
// the function.
|
||||
//
|
||||
// The alternative is to use the operator()() when calling the function in order
|
||||
// to explicitly convert the swizzled type to the unswizzled type.
|
||||
//
|
||||
|
||||
//_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, abs);
|
||||
//_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, acos);
|
||||
//_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, acosh);
|
||||
//_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, all);
|
||||
//_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, any);
|
||||
|
||||
//_GLM_SWIZZLE_FUNCTION_2_ARGS(value_type, dot);
|
||||
//_GLM_SWIZZLE_FUNCTION_2_ARGS(vec_type, cross);
|
||||
//_GLM_SWIZZLE_FUNCTION_2_ARGS(vec_type, step);
|
||||
//_GLM_SWIZZLE_FUNCTION_2_ARGS_SCALAR(vec_type, mix);
|
||||
}
|
||||
|
||||
#define _GLM_SWIZZLE2_2_MEMBERS(T, P, V, E0,E1) \
|
||||
struct { _swizzle<2, T, P, V<T, P>, 0,0,-1,-2> E0 ## E0; }; \
|
||||
struct { _swizzle<2, T, P, V<T, P>, 0,1,-1,-2> E0 ## E1; }; \
|
||||
struct { _swizzle<2, T, P, V<T, P>, 1,0,-1,-2> E1 ## E0; }; \
|
||||
struct { _swizzle<2, T, P, V<T, P>, 1,1,-1,-2> E1 ## E1; };
|
||||
|
||||
#define _GLM_SWIZZLE2_3_MEMBERS(T, P, V, E0,E1) \
|
||||
struct { _swizzle<3,T, P, V<T, P>, 0,0,0,-1> E0 ## E0 ## E0; }; \
|
||||
struct { _swizzle<3,T, P, V<T, P>, 0,0,1,-1> E0 ## E0 ## E1; }; \
|
||||
struct { _swizzle<3,T, P, V<T, P>, 0,1,0,-1> E0 ## E1 ## E0; }; \
|
||||
struct { _swizzle<3,T, P, V<T, P>, 0,1,1,-1> E0 ## E1 ## E1; }; \
|
||||
struct { _swizzle<3,T, P, V<T, P>, 1,0,0,-1> E1 ## E0 ## E0; }; \
|
||||
struct { _swizzle<3,T, P, V<T, P>, 1,0,1,-1> E1 ## E0 ## E1; }; \
|
||||
struct { _swizzle<3,T, P, V<T, P>, 1,1,0,-1> E1 ## E1 ## E0; }; \
|
||||
struct { _swizzle<3,T, P, V<T, P>, 1,1,1,-1> E1 ## E1 ## E1; };
|
||||
|
||||
#define _GLM_SWIZZLE2_4_MEMBERS(T, P, V, E0,E1) \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,1,1,1> E1 ## E1 ## E1 ## E1; };
|
||||
|
||||
#define _GLM_SWIZZLE3_2_MEMBERS(T, P, V, E0,E1,E2) \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 0,0,-1,-2> E0 ## E0; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 0,1,-1,-2> E0 ## E1; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 0,2,-1,-2> E0 ## E2; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 1,0,-1,-2> E1 ## E0; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 1,1,-1,-2> E1 ## E1; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 1,2,-1,-2> E1 ## E2; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 2,0,-1,-2> E2 ## E0; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 2,1,-1,-2> E2 ## E1; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 2,2,-1,-2> E2 ## E2; };
|
||||
|
||||
#define _GLM_SWIZZLE3_3_MEMBERS(T, P, V ,E0,E1,E2) \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,0,0,-1> E0 ## E0 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,0,1,-1> E0 ## E0 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,0,2,-1> E0 ## E0 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,1,0,-1> E0 ## E1 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,1,1,-1> E0 ## E1 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,1,2,-1> E0 ## E1 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,2,0,-1> E0 ## E2 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,2,1,-1> E0 ## E2 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,2,2,-1> E0 ## E2 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,0,0,-1> E1 ## E0 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,0,1,-1> E1 ## E0 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,0,2,-1> E1 ## E0 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,1,0,-1> E1 ## E1 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,1,1,-1> E1 ## E1 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,1,2,-1> E1 ## E1 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,2,0,-1> E1 ## E2 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,2,1,-1> E1 ## E2 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,2,2,-1> E1 ## E2 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,0,0,-1> E2 ## E0 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,0,1,-1> E2 ## E0 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,0,2,-1> E2 ## E0 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,1,0,-1> E2 ## E1 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,1,1,-1> E2 ## E1 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,1,2,-1> E2 ## E1 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,2,0,-1> E2 ## E2 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,2,1,-1> E2 ## E2 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,2,2,-1> E2 ## E2 ## E2; };
|
||||
|
||||
#define _GLM_SWIZZLE3_4_MEMBERS(T, P, V, E0,E1,E2) \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,0,0,2> E0 ## E0 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,0,1,2> E0 ## E0 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,0,2,0> E0 ## E0 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,0,2,1> E0 ## E0 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,0,2,2> E0 ## E0 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,1,0,2> E0 ## E1 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,1,1,2> E0 ## E1 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,1,2,0> E0 ## E1 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,1,2,1> E0 ## E1 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,1,2,2> E0 ## E1 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,2,0,0> E0 ## E2 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,2,0,1> E0 ## E2 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,2,0,2> E0 ## E2 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,2,1,0> E0 ## E2 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,2,1,1> E0 ## E2 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,2,1,2> E0 ## E2 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,2,2,0> E0 ## E2 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,2,2,1> E0 ## E2 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 0,2,2,2> E0 ## E2 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,0,0,2> E1 ## E0 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,0,1,2> E1 ## E0 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,0,2,0> E1 ## E0 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,0,2,1> E1 ## E0 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,0,2,2> E1 ## E0 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,1,0,2> E1 ## E1 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,1,1,2> E1 ## E1 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,1,2,0> E1 ## E1 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,1,2,1> E1 ## E1 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,1,2,2> E1 ## E1 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,2,0,0> E1 ## E2 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,2,0,1> E1 ## E2 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,2,0,2> E1 ## E2 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,2,1,0> E1 ## E2 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,2,1,1> E1 ## E2 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,2,1,2> E1 ## E2 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,2,2,0> E1 ## E2 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,2,2,1> E1 ## E2 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 1,2,2,2> E1 ## E2 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,0,0,0> E2 ## E0 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,0,0,1> E2 ## E0 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,0,0,2> E2 ## E0 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,0,1,0> E2 ## E0 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,0,1,1> E2 ## E0 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,0,1,2> E2 ## E0 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,0,2,0> E2 ## E0 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,0,2,1> E2 ## E0 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,0,2,2> E2 ## E0 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,1,0,0> E2 ## E1 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,1,0,1> E2 ## E1 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,1,0,2> E2 ## E1 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,1,1,0> E2 ## E1 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,1,1,1> E2 ## E1 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,1,1,2> E2 ## E1 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,1,2,0> E2 ## E1 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,1,2,1> E2 ## E1 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,1,2,2> E2 ## E1 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,2,0,0> E2 ## E2 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,2,0,1> E2 ## E2 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,2,0,2> E2 ## E2 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,2,1,0> E2 ## E2 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,2,1,1> E2 ## E2 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,2,1,2> E2 ## E2 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,2,2,0> E2 ## E2 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,2,2,1> E2 ## E2 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4,T, P, V<T, P>, 2,2,2,2> E2 ## E2 ## E2 ## E2; };
|
||||
|
||||
#define _GLM_SWIZZLE4_2_MEMBERS(T, P, V, E0,E1,E2,E3) \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 0,0,-1,-2> E0 ## E0; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 0,1,-1,-2> E0 ## E1; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 0,2,-1,-2> E0 ## E2; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 0,3,-1,-2> E0 ## E3; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 1,0,-1,-2> E1 ## E0; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 1,1,-1,-2> E1 ## E1; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 1,2,-1,-2> E1 ## E2; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 1,3,-1,-2> E1 ## E3; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 2,0,-1,-2> E2 ## E0; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 2,1,-1,-2> E2 ## E1; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 2,2,-1,-2> E2 ## E2; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 2,3,-1,-2> E2 ## E3; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 3,0,-1,-2> E3 ## E0; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 3,1,-1,-2> E3 ## E1; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 3,2,-1,-2> E3 ## E2; }; \
|
||||
struct { _swizzle<2,T, P, V<T, P>, 3,3,-1,-2> E3 ## E3; };
|
||||
|
||||
#define _GLM_SWIZZLE4_3_MEMBERS(T,P, V, E0,E1,E2,E3) \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,0,0,-1> E0 ## E0 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,0,1,-1> E0 ## E0 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,0,2,-1> E0 ## E0 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,0,3,-1> E0 ## E0 ## E3; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,1,0,-1> E0 ## E1 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,1,1,-1> E0 ## E1 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,1,2,-1> E0 ## E1 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,1,3,-1> E0 ## E1 ## E3; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,2,0,-1> E0 ## E2 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,2,1,-1> E0 ## E2 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,2,2,-1> E0 ## E2 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,2,3,-1> E0 ## E2 ## E3; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,3,0,-1> E0 ## E3 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,3,1,-1> E0 ## E3 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,3,2,-1> E0 ## E3 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 0,3,3,-1> E0 ## E3 ## E3; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,0,0,-1> E1 ## E0 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,0,1,-1> E1 ## E0 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,0,2,-1> E1 ## E0 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,0,3,-1> E1 ## E0 ## E3; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,1,0,-1> E1 ## E1 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,1,1,-1> E1 ## E1 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,1,2,-1> E1 ## E1 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,1,3,-1> E1 ## E1 ## E3; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,2,0,-1> E1 ## E2 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,2,1,-1> E1 ## E2 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,2,2,-1> E1 ## E2 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,2,3,-1> E1 ## E2 ## E3; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,3,0,-1> E1 ## E3 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,3,1,-1> E1 ## E3 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,3,2,-1> E1 ## E3 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 1,3,3,-1> E1 ## E3 ## E3; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,0,0,-1> E2 ## E0 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,0,1,-1> E2 ## E0 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,0,2,-1> E2 ## E0 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,0,3,-1> E2 ## E0 ## E3; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,1,0,-1> E2 ## E1 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,1,1,-1> E2 ## E1 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,1,2,-1> E2 ## E1 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,1,3,-1> E2 ## E1 ## E3; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,2,0,-1> E2 ## E2 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,2,1,-1> E2 ## E2 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,2,2,-1> E2 ## E2 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,2,3,-1> E2 ## E2 ## E3; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,3,0,-1> E2 ## E3 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,3,1,-1> E2 ## E3 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,3,2,-1> E2 ## E3 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 2,3,3,-1> E2 ## E3 ## E3; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 3,0,0,-1> E3 ## E0 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 3,0,1,-1> E3 ## E0 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 3,0,2,-1> E3 ## E0 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 3,0,3,-1> E3 ## E0 ## E3; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 3,1,0,-1> E3 ## E1 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 3,1,1,-1> E3 ## E1 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 3,1,2,-1> E3 ## E1 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 3,1,3,-1> E3 ## E1 ## E3; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 3,2,0,-1> E3 ## E2 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 3,2,1,-1> E3 ## E2 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 3,2,2,-1> E3 ## E2 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 3,2,3,-1> E3 ## E2 ## E3; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 3,3,0,-1> E3 ## E3 ## E0; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 3,3,1,-1> E3 ## E3 ## E1; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 3,3,2,-1> E3 ## E3 ## E2; }; \
|
||||
struct { _swizzle<3,T,P, V<T, P>, 3,3,3,-1> E3 ## E3 ## E3; };
|
||||
|
||||
#define _GLM_SWIZZLE4_4_MEMBERS(T, P, V, E0,E1,E2,E3) \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,0,0,2> E0 ## E0 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,0,0,3> E0 ## E0 ## E0 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,0,1,2> E0 ## E0 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,0,1,3> E0 ## E0 ## E1 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,0,2,0> E0 ## E0 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,0,2,1> E0 ## E0 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,0,2,2> E0 ## E0 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,0,2,3> E0 ## E0 ## E2 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,0,3,0> E0 ## E0 ## E3 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,0,3,1> E0 ## E0 ## E3 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,0,3,2> E0 ## E0 ## E3 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,0,3,3> E0 ## E0 ## E3 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,1,0,2> E0 ## E1 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,1,0,3> E0 ## E1 ## E0 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,1,1,2> E0 ## E1 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,1,1,3> E0 ## E1 ## E1 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,1,2,0> E0 ## E1 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,1,2,1> E0 ## E1 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,1,2,2> E0 ## E1 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,1,2,3> E0 ## E1 ## E2 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,1,3,0> E0 ## E1 ## E3 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,1,3,1> E0 ## E1 ## E3 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,1,3,2> E0 ## E1 ## E3 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,1,3,3> E0 ## E1 ## E3 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,2,0,0> E0 ## E2 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,2,0,1> E0 ## E2 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,2,0,2> E0 ## E2 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,2,0,3> E0 ## E2 ## E0 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,2,1,0> E0 ## E2 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,2,1,1> E0 ## E2 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,2,1,2> E0 ## E2 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,2,1,3> E0 ## E2 ## E1 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,2,2,0> E0 ## E2 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,2,2,1> E0 ## E2 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,2,2,2> E0 ## E2 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,2,2,3> E0 ## E2 ## E2 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,2,3,0> E0 ## E2 ## E3 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,2,3,1> E0 ## E2 ## E3 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,2,3,2> E0 ## E2 ## E3 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,2,3,3> E0 ## E2 ## E3 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,3,0,0> E0 ## E3 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,3,0,1> E0 ## E3 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,3,0,2> E0 ## E3 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,3,0,3> E0 ## E3 ## E0 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,3,1,0> E0 ## E3 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,3,1,1> E0 ## E3 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,3,1,2> E0 ## E3 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,3,1,3> E0 ## E3 ## E1 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,3,2,0> E0 ## E3 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,3,2,1> E0 ## E3 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,3,2,2> E0 ## E3 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,3,2,3> E0 ## E3 ## E2 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,3,3,0> E0 ## E3 ## E3 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,3,3,1> E0 ## E3 ## E3 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,3,3,2> E0 ## E3 ## E3 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 0,3,3,3> E0 ## E3 ## E3 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,0,0,2> E1 ## E0 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,0,0,3> E1 ## E0 ## E0 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,0,1,2> E1 ## E0 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,0,1,3> E1 ## E0 ## E1 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,0,2,0> E1 ## E0 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,0,2,1> E1 ## E0 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,0,2,2> E1 ## E0 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,0,2,3> E1 ## E0 ## E2 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,0,3,0> E1 ## E0 ## E3 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,0,3,1> E1 ## E0 ## E3 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,0,3,2> E1 ## E0 ## E3 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,0,3,3> E1 ## E0 ## E3 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,1,0,2> E1 ## E1 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,1,0,3> E1 ## E1 ## E0 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,1,1,2> E1 ## E1 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,1,1,3> E1 ## E1 ## E1 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,1,2,0> E1 ## E1 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,1,2,1> E1 ## E1 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,1,2,2> E1 ## E1 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,1,2,3> E1 ## E1 ## E2 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,1,3,0> E1 ## E1 ## E3 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,1,3,1> E1 ## E1 ## E3 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,1,3,2> E1 ## E1 ## E3 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,1,3,3> E1 ## E1 ## E3 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,2,0,0> E1 ## E2 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,2,0,1> E1 ## E2 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,2,0,2> E1 ## E2 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,2,0,3> E1 ## E2 ## E0 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,2,1,0> E1 ## E2 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,2,1,1> E1 ## E2 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,2,1,2> E1 ## E2 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,2,1,3> E1 ## E2 ## E1 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,2,2,0> E1 ## E2 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,2,2,1> E1 ## E2 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,2,2,2> E1 ## E2 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,2,2,3> E1 ## E2 ## E2 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,2,3,0> E1 ## E2 ## E3 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,2,3,1> E1 ## E2 ## E3 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,2,3,2> E1 ## E2 ## E3 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,2,3,3> E1 ## E2 ## E3 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,3,0,0> E1 ## E3 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,3,0,1> E1 ## E3 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,3,0,2> E1 ## E3 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,3,0,3> E1 ## E3 ## E0 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,3,1,0> E1 ## E3 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,3,1,1> E1 ## E3 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,3,1,2> E1 ## E3 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,3,1,3> E1 ## E3 ## E1 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,3,2,0> E1 ## E3 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,3,2,1> E1 ## E3 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,3,2,2> E1 ## E3 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,3,2,3> E1 ## E3 ## E2 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,3,3,0> E1 ## E3 ## E3 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,3,3,1> E1 ## E3 ## E3 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,3,3,2> E1 ## E3 ## E3 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 1,3,3,3> E1 ## E3 ## E3 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,0,0,0> E2 ## E0 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,0,0,1> E2 ## E0 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,0,0,2> E2 ## E0 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,0,0,3> E2 ## E0 ## E0 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,0,1,0> E2 ## E0 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,0,1,1> E2 ## E0 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,0,1,2> E2 ## E0 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,0,1,3> E2 ## E0 ## E1 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,0,2,0> E2 ## E0 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,0,2,1> E2 ## E0 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,0,2,2> E2 ## E0 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,0,2,3> E2 ## E0 ## E2 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,0,3,0> E2 ## E0 ## E3 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,0,3,1> E2 ## E0 ## E3 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,0,3,2> E2 ## E0 ## E3 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,0,3,3> E2 ## E0 ## E3 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,1,0,0> E2 ## E1 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,1,0,1> E2 ## E1 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,1,0,2> E2 ## E1 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,1,0,3> E2 ## E1 ## E0 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,1,1,0> E2 ## E1 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,1,1,1> E2 ## E1 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,1,1,2> E2 ## E1 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,1,1,3> E2 ## E1 ## E1 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,1,2,0> E2 ## E1 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,1,2,1> E2 ## E1 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,1,2,2> E2 ## E1 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,1,2,3> E2 ## E1 ## E2 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,1,3,0> E2 ## E1 ## E3 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,1,3,1> E2 ## E1 ## E3 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,1,3,2> E2 ## E1 ## E3 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,1,3,3> E2 ## E1 ## E3 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,2,0,0> E2 ## E2 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,2,0,1> E2 ## E2 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,2,0,2> E2 ## E2 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,2,0,3> E2 ## E2 ## E0 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,2,1,0> E2 ## E2 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,2,1,1> E2 ## E2 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,2,1,2> E2 ## E2 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,2,1,3> E2 ## E2 ## E1 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,2,2,0> E2 ## E2 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,2,2,1> E2 ## E2 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,2,2,2> E2 ## E2 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,2,2,3> E2 ## E2 ## E2 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,2,3,0> E2 ## E2 ## E3 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,2,3,1> E2 ## E2 ## E3 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,2,3,2> E2 ## E2 ## E3 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,2,3,3> E2 ## E2 ## E3 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,3,0,0> E2 ## E3 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,3,0,1> E2 ## E3 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,3,0,2> E2 ## E3 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,3,0,3> E2 ## E3 ## E0 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,3,1,0> E2 ## E3 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,3,1,1> E2 ## E3 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,3,1,2> E2 ## E3 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,3,1,3> E2 ## E3 ## E1 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,3,2,0> E2 ## E3 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,3,2,1> E2 ## E3 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,3,2,2> E2 ## E3 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,3,2,3> E2 ## E3 ## E2 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,3,3,0> E2 ## E3 ## E3 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,3,3,1> E2 ## E3 ## E3 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,3,3,2> E2 ## E3 ## E3 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 2,3,3,3> E2 ## E3 ## E3 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,0,0,0> E3 ## E0 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,0,0,1> E3 ## E0 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,0,0,2> E3 ## E0 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,0,0,3> E3 ## E0 ## E0 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,0,1,0> E3 ## E0 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,0,1,1> E3 ## E0 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,0,1,2> E3 ## E0 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,0,1,3> E3 ## E0 ## E1 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,0,2,0> E3 ## E0 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,0,2,1> E3 ## E0 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,0,2,2> E3 ## E0 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,0,2,3> E3 ## E0 ## E2 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,0,3,0> E3 ## E0 ## E3 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,0,3,1> E3 ## E0 ## E3 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,0,3,2> E3 ## E0 ## E3 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,0,3,3> E3 ## E0 ## E3 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,1,0,0> E3 ## E1 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,1,0,1> E3 ## E1 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,1,0,2> E3 ## E1 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,1,0,3> E3 ## E1 ## E0 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,1,1,0> E3 ## E1 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,1,1,1> E3 ## E1 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,1,1,2> E3 ## E1 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,1,1,3> E3 ## E1 ## E1 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,1,2,0> E3 ## E1 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,1,2,1> E3 ## E1 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,1,2,2> E3 ## E1 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,1,2,3> E3 ## E1 ## E2 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,1,3,0> E3 ## E1 ## E3 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,1,3,1> E3 ## E1 ## E3 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,1,3,2> E3 ## E1 ## E3 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,1,3,3> E3 ## E1 ## E3 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,2,0,0> E3 ## E2 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,2,0,1> E3 ## E2 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,2,0,2> E3 ## E2 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,2,0,3> E3 ## E2 ## E0 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,2,1,0> E3 ## E2 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,2,1,1> E3 ## E2 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,2,1,2> E3 ## E2 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,2,1,3> E3 ## E2 ## E1 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,2,2,0> E3 ## E2 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,2,2,1> E3 ## E2 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,2,2,2> E3 ## E2 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,2,2,3> E3 ## E2 ## E2 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,2,3,0> E3 ## E2 ## E3 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,2,3,1> E3 ## E2 ## E3 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,2,3,2> E3 ## E2 ## E3 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,2,3,3> E3 ## E2 ## E3 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,3,0,0> E3 ## E3 ## E0 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,3,0,1> E3 ## E3 ## E0 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,3,0,2> E3 ## E3 ## E0 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,3,0,3> E3 ## E3 ## E0 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,3,1,0> E3 ## E3 ## E1 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,3,1,1> E3 ## E3 ## E1 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,3,1,2> E3 ## E3 ## E1 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,3,1,3> E3 ## E3 ## E1 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,3,2,0> E3 ## E3 ## E2 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,3,2,1> E3 ## E3 ## E2 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,3,2,2> E3 ## E3 ## E2 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,3,2,3> E3 ## E3 ## E2 ## E3; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,3,3,0> E3 ## E3 ## E3 ## E0; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,3,3,1> E3 ## E3 ## E3 ## E1; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,3,3,2> E3 ## E3 ## E3 ## E2; }; \
|
||||
struct { _swizzle<4, T, P, V<T, P>, 3,3,3,3> E3 ## E3 ## E3 ## E3; };
|
||||
|
||||
#endif//glm_core_swizzle
|
||||
@@ -0,0 +1,724 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/_swizzle_func.hpp
|
||||
/// @date 2011-10-16 / 2011-10-16
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef glm_core_swizzle_func
|
||||
#define glm_core_swizzle_func
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B) \
|
||||
SWIZZLED_TYPE<TMPL_TYPE, PRECISION> A ## B() CONST \
|
||||
{ \
|
||||
return SWIZZLED_TYPE<TMPL_TYPE, PRECISION>(this->A, this->B); \
|
||||
}
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B, C) \
|
||||
SWIZZLED_TYPE<TMPL_TYPE, PRECISION> A ## B ## C() CONST \
|
||||
{ \
|
||||
return SWIZZLED_TYPE<TMPL_TYPE, PRECISION>(this->A, this->B, this->C); \
|
||||
}
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B, C, D) \
|
||||
SWIZZLED_TYPE<TMPL_TYPE, PRECISION> A ## B ## C ## D() CONST \
|
||||
{ \
|
||||
return SWIZZLED_TYPE<TMPL_TYPE, PRECISION>(this->A, this->B, this->C, this->D); \
|
||||
}
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC2_ENTRY_DEF(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B) \
|
||||
template <typename TMPL_TYPE> \
|
||||
SWIZZLED_TYPE<TMPL_TYPE> CLASS_TYPE<TMPL_TYPE, PRECISION>::A ## B() CONST \
|
||||
{ \
|
||||
return SWIZZLED_TYPE<TMPL_TYPE, PRECISION>(this->A, this->B); \
|
||||
}
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC3_ENTRY_DEF(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B, C) \
|
||||
template <typename TMPL_TYPE> \
|
||||
SWIZZLED_TYPE<TMPL_TYPE> CLASS_TYPE<TMPL_TYPE, PRECISION>::A ## B ## C() CONST \
|
||||
{ \
|
||||
return SWIZZLED_TYPE<TMPL_TYPE, PRECISION>(this->A, this->B, this->C); \
|
||||
}
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC4_ENTRY_DEF(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B, C, D) \
|
||||
template <typename TMPL_TYPE> \
|
||||
SWIZZLED_TYPE<TMPL_TYPE> CLASS_TYPE<TMPL_TYPE, PRECISION>::A ## B ## C ## D() CONST \
|
||||
{ \
|
||||
return SWIZZLED_TYPE<TMPL_TYPE, PRECISION>(this->A, this->B, this->C, this->D); \
|
||||
}
|
||||
|
||||
#define GLM_MUTABLE
|
||||
|
||||
#define GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, A)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_REF_FROM_VEC2(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE) \
|
||||
GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, x, y) \
|
||||
GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, r, g) \
|
||||
GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, s, t)
|
||||
|
||||
//GLM_SWIZZLE_GEN_REF_FROM_VEC2(valType, detail::vec2, detail::ref2)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_REF2_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, B)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_REF3_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, B, A)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_REF3_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC3_TYPE, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_REF2_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, A, B, C)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_REF_FROM_VEC3(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE) \
|
||||
GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, x, y, z) \
|
||||
GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, r, g, b) \
|
||||
GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, s, t, p)
|
||||
|
||||
//GLM_SWIZZLE_GEN_REF_FROM_VEC3(valType, detail::vec3, detail::ref2, detail::ref3)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_REF2_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, D, C)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_REF3_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, C, B)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_REF4_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, C, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, C, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, D, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, D, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, B, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, B, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, C, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, C, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, D, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, D, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, A, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, A, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, B, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, B, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, D, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, D, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, A, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, A, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, C, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, C, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, A, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, B, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, B, C, A)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, A, B, C, D) \
|
||||
GLM_SWIZZLE_GEN_REF2_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, A, B, C, D) \
|
||||
GLM_SWIZZLE_GEN_REF3_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC3_TYPE, A, B, C, D) \
|
||||
GLM_SWIZZLE_GEN_REF4_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC4_TYPE, A, B, C, D)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_REF_FROM_VEC4(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE) \
|
||||
GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, x, y, z, w) \
|
||||
GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, r, g, b, a) \
|
||||
GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, s, t, p, q)
|
||||
|
||||
//GLM_SWIZZLE_GEN_REF_FROM_VEC4(valType, detail::vec4, detail::ref2, detail::ref3, detail::ref4)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC2_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC3_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC4_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, B)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC2_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC3_TYPE, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC4_TYPE, A, B)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC_FROM_VEC2(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE) \
|
||||
GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, x, y) \
|
||||
GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, r, g) \
|
||||
GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, s, t)
|
||||
|
||||
//GLM_SWIZZLE_GEN_VEC_FROM_VEC2(valType, detail::vec2, detail::vec2, detail::vec3, detail::vec4)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC2_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC3_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC4_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, C)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC2_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC3_TYPE, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC4_TYPE, A, B, C)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC_FROM_VEC3(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE) \
|
||||
GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, x, y, z) \
|
||||
GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, r, g, b) \
|
||||
GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, s, t, p)
|
||||
|
||||
//GLM_SWIZZLE_GEN_VEC_FROM_VEC3(valType, detail::vec3, detail::vec2, detail::vec3, detail::vec4)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC2_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC3_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, D)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC4_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, D, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, D, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, D, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, D, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, D, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, D, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, D, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, D, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, D, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, D, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, D, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, D, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, D, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, D, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, D, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, A, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, A, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, A, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, A, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, B, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, B, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, B, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, B, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, C, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, C, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, C, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, D, A) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, D, B) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, D, C) \
|
||||
GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, D, D)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, A, B, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC2_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, A, B, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC3_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC3_TYPE, A, B, C, D) \
|
||||
GLM_SWIZZLE_GEN_VEC4_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC4_TYPE, A, B, C, D)
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC_FROM_VEC4(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE) \
|
||||
GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, x, y, z, w) \
|
||||
GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, r, g, b, a) \
|
||||
GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, s, t, p, q)
|
||||
|
||||
//GLM_SWIZZLE_GEN_VEC_FROM_VEC4(valType, detail::vec4, detail::vec2, detail::vec3, detail::vec4)
|
||||
|
||||
#endif//glm_core_swizzle_func
|
||||
@@ -0,0 +1,217 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/_vectorize.hpp
|
||||
/// @date 2011-10-14 / 2011-10-14
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef GLM_CORE_DETAIL_INCLUDED
|
||||
#define GLM_CORE_DETAIL_INCLUDED
|
||||
|
||||
#include "type_vec1.hpp"
|
||||
#include "type_vec2.hpp"
|
||||
#include "type_vec3.hpp"
|
||||
#include "type_vec4.hpp"
|
||||
|
||||
#define VECTORIZE1_VEC(func) \
|
||||
template <typename T, precision P> \
|
||||
GLM_FUNC_QUALIFIER detail::tvec1<T, P> func( \
|
||||
detail::tvec1<T, P> const & v) \
|
||||
{ \
|
||||
return detail::tvec1<T, P>( \
|
||||
func(v.x)); \
|
||||
}
|
||||
|
||||
#define VECTORIZE2_VEC(func) \
|
||||
template <typename T, precision P> \
|
||||
GLM_FUNC_QUALIFIER detail::tvec2<T, P> func( \
|
||||
detail::tvec2<T, P> const & v) \
|
||||
{ \
|
||||
return detail::tvec2<T, P>( \
|
||||
func(v.x), \
|
||||
func(v.y)); \
|
||||
}
|
||||
|
||||
#define VECTORIZE3_VEC(func) \
|
||||
template <typename T, precision P> \
|
||||
GLM_FUNC_QUALIFIER detail::tvec3<T, P> func( \
|
||||
detail::tvec3<T, P> const & v) \
|
||||
{ \
|
||||
return detail::tvec3<T, P>( \
|
||||
func(v.x), \
|
||||
func(v.y), \
|
||||
func(v.z)); \
|
||||
}
|
||||
|
||||
#define VECTORIZE4_VEC(func) \
|
||||
template <typename T, precision P> \
|
||||
GLM_FUNC_QUALIFIER detail::tvec4<T, P> func( \
|
||||
detail::tvec4<T, P> const & v) \
|
||||
{ \
|
||||
return detail::tvec4<T, P>( \
|
||||
func(v.x), \
|
||||
func(v.y), \
|
||||
func(v.z), \
|
||||
func(v.w)); \
|
||||
}
|
||||
|
||||
#define VECTORIZE_VEC(func) \
|
||||
VECTORIZE1_VEC(func) \
|
||||
VECTORIZE2_VEC(func) \
|
||||
VECTORIZE3_VEC(func) \
|
||||
VECTORIZE4_VEC(func)
|
||||
|
||||
#define VECTORIZE1_VEC_SCA(func) \
|
||||
template <typename T, precision P> \
|
||||
GLM_FUNC_QUALIFIER detail::tvec1<T, P> func \
|
||||
( \
|
||||
detail::tvec1<T, P> const & x, \
|
||||
T const & y \
|
||||
) \
|
||||
{ \
|
||||
return detail::tvec1<T, P>( \
|
||||
func(x.x, y)); \
|
||||
}
|
||||
|
||||
#define VECTORIZE2_VEC_SCA(func) \
|
||||
template <typename T, precision P> \
|
||||
GLM_FUNC_QUALIFIER detail::tvec2<T, P> func \
|
||||
( \
|
||||
detail::tvec2<T, P> const & x, \
|
||||
T const & y \
|
||||
) \
|
||||
{ \
|
||||
return detail::tvec2<T, P>( \
|
||||
func(x.x, y), \
|
||||
func(x.y, y)); \
|
||||
}
|
||||
|
||||
#define VECTORIZE3_VEC_SCA(func) \
|
||||
template <typename T, precision P> \
|
||||
GLM_FUNC_QUALIFIER detail::tvec3<T, P> func \
|
||||
( \
|
||||
detail::tvec3<T, P> const & x, \
|
||||
T const & y \
|
||||
) \
|
||||
{ \
|
||||
return detail::tvec3<T, P>( \
|
||||
func(x.x, y), \
|
||||
func(x.y, y), \
|
||||
func(x.z, y)); \
|
||||
}
|
||||
|
||||
#define VECTORIZE4_VEC_SCA(func) \
|
||||
template <typename T, precision P> \
|
||||
GLM_FUNC_QUALIFIER detail::tvec4<T, P> func \
|
||||
( \
|
||||
detail::tvec4<T, P> const & x, \
|
||||
T const & y \
|
||||
) \
|
||||
{ \
|
||||
return detail::tvec4<T, P>( \
|
||||
func(x.x, y), \
|
||||
func(x.y, y), \
|
||||
func(x.z, y), \
|
||||
func(x.w, y)); \
|
||||
}
|
||||
|
||||
#define VECTORIZE_VEC_SCA(func) \
|
||||
VECTORIZE1_VEC_SCA(func) \
|
||||
VECTORIZE2_VEC_SCA(func) \
|
||||
VECTORIZE3_VEC_SCA(func) \
|
||||
VECTORIZE4_VEC_SCA(func)
|
||||
|
||||
#define VECTORIZE2_VEC_VEC(func) \
|
||||
template <typename T, precision P> \
|
||||
GLM_FUNC_QUALIFIER detail::tvec2<T, P> func \
|
||||
( \
|
||||
detail::tvec2<T, P> const & x, \
|
||||
detail::tvec2<T, P> const & y \
|
||||
) \
|
||||
{ \
|
||||
return detail::tvec2<T, P>( \
|
||||
func(x.x, y.x), \
|
||||
func(x.y, y.y)); \
|
||||
}
|
||||
|
||||
#define VECTORIZE3_VEC_VEC(func) \
|
||||
template <typename T, precision P> \
|
||||
GLM_FUNC_QUALIFIER detail::tvec3<T, P> func \
|
||||
( \
|
||||
detail::tvec3<T, P> const & x, \
|
||||
detail::tvec3<T, P> const & y \
|
||||
) \
|
||||
{ \
|
||||
return detail::tvec3<T, P>( \
|
||||
func(x.x, y.x), \
|
||||
func(x.y, y.y), \
|
||||
func(x.z, y.z)); \
|
||||
}
|
||||
|
||||
#define VECTORIZE4_VEC_VEC(func) \
|
||||
template <typename T, precision P> \
|
||||
GLM_FUNC_QUALIFIER detail::tvec4<T, P> func \
|
||||
( \
|
||||
detail::tvec4<T, P> const & x, \
|
||||
detail::tvec4<T, P> const & y \
|
||||
) \
|
||||
{ \
|
||||
return detail::tvec4<T, P>( \
|
||||
func(x.x, y.x), \
|
||||
func(x.y, y.y), \
|
||||
func(x.z, y.z), \
|
||||
func(x.w, y.w)); \
|
||||
}
|
||||
|
||||
#define VECTORIZE_VEC_VEC(func) \
|
||||
VECTORIZE2_VEC_VEC(func) \
|
||||
VECTORIZE3_VEC_VEC(func) \
|
||||
VECTORIZE4_VEC_VEC(func)
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
template<bool C>
|
||||
struct If
|
||||
{
|
||||
template<typename F, typename T>
|
||||
static GLM_FUNC_QUALIFIER T apply(F functor, const T& val)
|
||||
{
|
||||
return functor(val);
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct If<false>
|
||||
{
|
||||
template<typename F, typename T>
|
||||
static GLM_FUNC_QUALIFIER T apply(F, const T& val)
|
||||
{
|
||||
return val;
|
||||
}
|
||||
};
|
||||
}//namespace detail
|
||||
}//namespace glm
|
||||
|
||||
#endif//GLM_CORE_DETAIL_INCLUDED
|
||||
@@ -0,0 +1,190 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/dummy.cpp
|
||||
/// @date 2011-01-19 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///
|
||||
/// GLM is a header only library. There is nothing to compile.
|
||||
/// dummy.cpp exist only a wordaround for CMake file.
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define GLM_FORCE_RADIANS
|
||||
#define GLM_MESSAGES
|
||||
#include "../glm.hpp"
|
||||
#include <limits>
|
||||
|
||||
struct material
|
||||
{
|
||||
glm::vec4 emission; // Ecm
|
||||
glm::vec4 ambient; // Acm
|
||||
glm::vec4 diffuse; // Dcm
|
||||
glm::vec4 specular; // Scm
|
||||
float shininess; // Srm
|
||||
};
|
||||
struct light
|
||||
{
|
||||
glm::vec4 ambient; // Acli
|
||||
glm::vec4 diffuse; // Dcli
|
||||
glm::vec4 specular; // Scli
|
||||
glm::vec4 position; // Ppli
|
||||
glm::vec4 halfVector; // Derived: Hi
|
||||
glm::vec3 spotDirection; // Sdli
|
||||
float spotExponent; // Srli
|
||||
float spotCutoff; // Crli
|
||||
// (range: [0.0,90.0], 180.0)
|
||||
float spotCosCutoff; // Derived: cos(Crli)
|
||||
// (range: [1.0,0.0],-1.0)
|
||||
float constantAttenuation; // K0
|
||||
float linearAttenuation; // K1
|
||||
float quadraticAttenuation;// K2
|
||||
};
|
||||
|
||||
// Sample 1
|
||||
#include <glm/vec3.hpp>// glm::vec3
|
||||
#include <glm/geometric.hpp>// glm::cross, glm::normalize
|
||||
|
||||
glm::vec3 computeNormal
|
||||
(
|
||||
glm::vec3 const & a,
|
||||
glm::vec3 const & b,
|
||||
glm::vec3 const & c
|
||||
)
|
||||
{
|
||||
return glm::normalize(glm::cross(c - a, b - a));
|
||||
}
|
||||
|
||||
typedef unsigned int GLuint;
|
||||
#define GL_FALSE 0
|
||||
void glUniformMatrix4fv(GLuint, int, int, float*){}
|
||||
|
||||
// Sample 2
|
||||
#include <glm/vec3.hpp> // glm::vec3
|
||||
#include <glm/vec4.hpp> // glm::vec4, glm::ivec4
|
||||
#include <glm/mat4x4.hpp> // glm::mat4
|
||||
#include <glm/gtc/matrix_transform.hpp> // glm::translate, glm::rotate, glm::scale, glm::perspective
|
||||
#include <glm/gtc/type_ptr.hpp> // glm::value_ptr
|
||||
void func(GLuint LocationMVP, float Translate, glm::vec2 const & Rotate)
|
||||
{
|
||||
glm::mat4 Projection = glm::perspective(45.0f, 4.0f / 3.0f, 0.1f, 100.f);
|
||||
glm::mat4 ViewTranslate = glm::translate(glm::mat4(1.0f), glm::vec3(0.0f, 0.0f, -Translate));
|
||||
glm::mat4 ViewRotateX = glm::rotate(ViewTranslate, Rotate.y, glm::vec3(-1.0f, 0.0f, 0.0f));
|
||||
glm::mat4 View = glm::rotate(ViewRotateX, Rotate.x, glm::vec3(0.0f, 1.0f, 0.0f));
|
||||
glm::mat4 Model = glm::scale(glm::mat4(1.0f), glm::vec3(0.5f));
|
||||
glm::mat4 MVP = Projection * View * Model;
|
||||
glUniformMatrix4fv(LocationMVP, 1, GL_FALSE, glm::value_ptr(MVP));
|
||||
}
|
||||
|
||||
// Sample 3
|
||||
#include <glm/vec2.hpp>// glm::vec2
|
||||
#include <glm/packing.hpp>// glm::packUnorm2x16
|
||||
#include <glm/integer.hpp>// glm::uint
|
||||
#include <glm/gtc/type_precision.hpp>// glm::i8vec2, glm::i32vec2
|
||||
std::size_t const VertexCount = 4;
|
||||
// Float quad geometry
|
||||
std::size_t const PositionSizeF32 = VertexCount * sizeof(glm::vec2);
|
||||
glm::vec2 const PositionDataF32[VertexCount] =
|
||||
{
|
||||
glm::vec2(-1.0f,-1.0f),
|
||||
glm::vec2( 1.0f,-1.0f),
|
||||
glm::vec2( 1.0f, 1.0f),
|
||||
glm::vec2(-1.0f, 1.0f)
|
||||
};
|
||||
// Half-float quad geometry
|
||||
std::size_t const PositionSizeF16 = VertexCount * sizeof(glm::uint);
|
||||
glm::uint const PositionDataF16[VertexCount] =
|
||||
{
|
||||
glm::uint(glm::packUnorm2x16(glm::vec2(-1.0f, -1.0f))),
|
||||
glm::uint(glm::packUnorm2x16(glm::vec2( 1.0f, -1.0f))),
|
||||
glm::uint(glm::packUnorm2x16(glm::vec2( 1.0f, 1.0f))),
|
||||
glm::uint(glm::packUnorm2x16(glm::vec2(-1.0f, 1.0f)))
|
||||
};
|
||||
// 8 bits signed integer quad geometry
|
||||
std::size_t const PositionSizeI8 = VertexCount * sizeof(glm::i8vec2);
|
||||
glm::i8vec2 const PositionDataI8[VertexCount] =
|
||||
{
|
||||
glm::i8vec2(-1,-1),
|
||||
glm::i8vec2( 1,-1),
|
||||
glm::i8vec2( 1, 1),
|
||||
glm::i8vec2(-1, 1)
|
||||
};
|
||||
// 32 bits signed integer quad geometry
|
||||
std::size_t const PositionSizeI32 = VertexCount * sizeof(glm::i32vec2);
|
||||
glm::i32vec2 const PositionDataI32[VertexCount] =
|
||||
{
|
||||
glm::i32vec2 (-1,-1),
|
||||
glm::i32vec2 ( 1,-1),
|
||||
glm::i32vec2 ( 1, 1),
|
||||
glm::i32vec2 (-1, 1)
|
||||
};
|
||||
|
||||
struct intersection
|
||||
{
|
||||
glm::vec4 position;
|
||||
glm::vec3 normal;
|
||||
};
|
||||
|
||||
/*
|
||||
// Sample 4
|
||||
#include <glm/vec3.hpp>// glm::vec3
|
||||
#include <glm/geometric.hpp>// glm::normalize, glm::dot, glm::reflect
|
||||
#include <glm/exponential.hpp>// glm::pow
|
||||
#include <glm/gtc/random.hpp>// glm::vecRand3
|
||||
glm::vec3 lighting
|
||||
(
|
||||
intersection const & Intersection,
|
||||
material const & Material,
|
||||
light const & Light,
|
||||
glm::vec3 const & View
|
||||
)
|
||||
{
|
||||
glm::vec3 Color(0.0f);
|
||||
glm::vec3 LightVertor(glm::normalize(
|
||||
Light.position - Intersection.position +
|
||||
glm::vecRand3(0.0f, Light.inaccuracy));
|
||||
|
||||
if(!shadow(Intersection.position, Light.position, LightVertor))
|
||||
{
|
||||
float Diffuse = glm::dot(Intersection.normal, LightVector);
|
||||
if(Diffuse <= 0.0f)
|
||||
return Color;
|
||||
if(Material.isDiffuse())
|
||||
Color += Light.color() * Material.diffuse * Diffuse;
|
||||
if(Material.isSpecular())
|
||||
{
|
||||
glm::vec3 Reflect(glm::reflect(
|
||||
glm::normalize(-LightVector),
|
||||
glm::normalize(Intersection.normal)));
|
||||
float Dot = glm::dot(Reflect, View);
|
||||
float Base = Dot > 0.0f ? Dot : 0.0f;
|
||||
float Specular = glm::pow(Base, Material.exponent);
|
||||
Color += Material.specular * Specular;
|
||||
}
|
||||
}
|
||||
return Color;
|
||||
}
|
||||
*/
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,472 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/func_common.hpp
|
||||
/// @date 2008-03-08 / 2010-01-26
|
||||
/// @author Christophe Riccio
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
///
|
||||
/// @defgroup core_func_common Common functions
|
||||
/// @ingroup core
|
||||
///
|
||||
/// These all operate component-wise. The description is per component.
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef GLM_FUNC_COMMON_INCLUDED
|
||||
#define GLM_FUNC_COMMON_INCLUDED
|
||||
|
||||
#include "setup.hpp"
|
||||
#include "precision.hpp"
|
||||
#include "type_int.hpp"
|
||||
#include "_fixes.hpp"
|
||||
|
||||
namespace glm
|
||||
{
|
||||
/// @addtogroup core_func_common
|
||||
/// @{
|
||||
|
||||
/// Returns x if x >= 0; otherwise, it returns -x.
|
||||
///
|
||||
/// @tparam genType floating-point or signed integer; scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/abs.xml">GLSL abs man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType abs(genType const & x);
|
||||
|
||||
/// Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0.
|
||||
///
|
||||
/// @tparam genType Floating-point or signed integer; scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sign.xml">GLSL sign man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType sign(genType const & x);
|
||||
|
||||
/// Returns a value equal to the nearest integer that is less then or equal to x.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floor.xml">GLSL floor man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType floor(genType const & x);
|
||||
|
||||
/// Returns a value equal to the nearest integer to x
|
||||
/// whose absolute value is not larger than the absolute value of x.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/trunc.xml">GLSL trunc man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType trunc(genType const & x);
|
||||
|
||||
/// Returns a value equal to the nearest integer to x.
|
||||
/// The fraction 0.5 will round in a direction chosen by the
|
||||
/// implementation, presumably the direction that is fastest.
|
||||
/// This includes the possibility that round(x) returns the
|
||||
/// same value as roundEven(x) for all values of x.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/round.xml">GLSL round man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType round(genType const & x);
|
||||
|
||||
/// Returns a value equal to the nearest integer to x.
|
||||
/// A fractional part of 0.5 will round toward the nearest even
|
||||
/// integer. (Both 3.5 and 4.5 for x will return 4.0.)
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/roundEven.xml">GLSL roundEven man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
/// @see <a href="http://developer.amd.com/documentation/articles/pages/New-Round-to-Even-Technique.aspx">New round to even technique</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType roundEven(genType const & x);
|
||||
|
||||
/// Returns a value equal to the nearest integer
|
||||
/// that is greater than or equal to x.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/ceil.xml">GLSL ceil man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType ceil(genType const & x);
|
||||
|
||||
/// Return x - floor(x).
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/fract.xml">GLSL fract man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType fract(genType const & x);
|
||||
|
||||
/// Modulus. Returns x - y * floor(x / y)
|
||||
/// for each component in x using the floating point value y.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType mod(
|
||||
genType const & x,
|
||||
genType const & y);
|
||||
|
||||
/// Modulus. Returns x - y * floor(x / y)
|
||||
/// for each component in x using the floating point value y.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType mod(
|
||||
genType const & x,
|
||||
typename genType::value_type const & y);
|
||||
|
||||
/// Returns the fractional part of x and sets i to the integer
|
||||
/// part (as a whole number floating point value). Both the
|
||||
/// return value and the output parameter will have the same
|
||||
/// sign as x.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/modf.xml">GLSL modf man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType modf(
|
||||
genType const & x,
|
||||
genType & i);
|
||||
|
||||
/// Returns y if y < x; otherwise, it returns x.
|
||||
///
|
||||
/// @tparam genType Floating-point or integer; scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/min.xml">GLSL min man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a><<<<<<< HEAD
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType min(
|
||||
genType const & x,
|
||||
genType const & y);
|
||||
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType min(
|
||||
genType const & x,
|
||||
typename genType::value_type const & y);
|
||||
|
||||
/// Returns y if x < y; otherwise, it returns x.
|
||||
///
|
||||
/// @tparam genType Floating-point or integer; scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/max.xml">GLSL max man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType max(
|
||||
genType const & x,
|
||||
genType const & y);
|
||||
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType max(
|
||||
genType const & x,
|
||||
typename genType::value_type const & y);
|
||||
|
||||
/// Returns min(max(x, minVal), maxVal) for each component in x
|
||||
/// using the floating-point values minVal and maxVal.
|
||||
///
|
||||
/// @tparam genType Floating-point or integer; scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/clamp.xml">GLSL clamp man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType clamp(
|
||||
genType const & x,
|
||||
genType const & minVal,
|
||||
genType const & maxVal);
|
||||
|
||||
template <typename genType, precision P>
|
||||
GLM_FUNC_DECL genType clamp(
|
||||
genType const & x,
|
||||
typename genType::value_type const & minVal,
|
||||
typename genType::value_type const & maxVal);
|
||||
|
||||
/// If genTypeU is a floating scalar or vector:
|
||||
/// Returns x * (1.0 - a) + y * a, i.e., the linear blend of
|
||||
/// x and y using the floating-point value a.
|
||||
/// The value for a is not restricted to the range [0, 1].
|
||||
///
|
||||
/// If genTypeU is a boolean scalar or vector:
|
||||
/// Selects which vector each returned component comes
|
||||
/// from. For a component of <a> that is false, the
|
||||
/// corresponding component of x is returned. For a
|
||||
/// component of a that is true, the corresponding
|
||||
/// component of y is returned. Components of x and y that
|
||||
/// are not selected are allowed to be invalid floating point
|
||||
/// values and will have no effect on the results. Thus, this
|
||||
/// provides different functionality than
|
||||
/// genType mix(genType x, genType y, genType(a))
|
||||
/// where a is a Boolean vector.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mix.xml">GLSL mix man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
///
|
||||
/// @param[in] x Value to interpolate.
|
||||
/// @param[in] y Value to interpolate.
|
||||
/// @param[in] a Interpolant.
|
||||
///
|
||||
/// @tparam genTypeT Floating point scalar or vector.
|
||||
/// @tparam genTypeU Floating point or boolean scalar or vector. It can't be a vector if it is the length of genTypeT.
|
||||
///
|
||||
/// @code
|
||||
/// #include <glm/glm.hpp>
|
||||
/// ...
|
||||
/// float a;
|
||||
/// bool b;
|
||||
/// glm::dvec3 e;
|
||||
/// glm::dvec3 f;
|
||||
/// glm::vec4 g;
|
||||
/// glm::vec4 h;
|
||||
/// ...
|
||||
/// glm::vec4 r = glm::mix(g, h, a); // Interpolate with a floating-point scalar two vectors.
|
||||
/// glm::vec4 s = glm::mix(g, h, b); // Teturns g or h;
|
||||
/// glm::dvec3 t = glm::mix(e, f, a); // Types of the third parameter is not required to match with the first and the second.
|
||||
/// glm::vec4 u = glm::mix(g, h, r); // Interpolations can be perform per component with a vector for the last parameter.
|
||||
/// @endcode
|
||||
template <typename T, typename U, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_DECL vecType<T, P> mix(
|
||||
vecType<T, P> const & x,
|
||||
vecType<T, P> const & y,
|
||||
vecType<U, P> const & a);
|
||||
|
||||
template <typename T, typename U, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_DECL vecType<T, P> mix(
|
||||
vecType<T, P> const & x,
|
||||
vecType<T, P> const & y,
|
||||
U const & a);
|
||||
|
||||
template <typename genTypeT, typename genTypeU>
|
||||
GLM_FUNC_DECL genTypeT mix(
|
||||
genTypeT const & x,
|
||||
genTypeT const & y,
|
||||
genTypeU const & a);
|
||||
|
||||
/// Returns 0.0 if x < edge, otherwise it returns 1.0 for each component of a genType.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/step.xml">GLSL step man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType step(
|
||||
genType const & edge,
|
||||
genType const & x);
|
||||
|
||||
/// Returns 0.0 if x < edge, otherwise it returns 1.0.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/step.xml">GLSL step man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <template <typename, precision> class vecType, typename T, precision P>
|
||||
GLM_FUNC_DECL vecType<T, P> step(
|
||||
T const & edge,
|
||||
vecType<T, P> const & x);
|
||||
|
||||
/// Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and
|
||||
/// performs smooth Hermite interpolation between 0 and 1
|
||||
/// when edge0 < x < edge1. This is useful in cases where
|
||||
/// you would want a threshold function with a smooth
|
||||
/// transition. This is equivalent to:
|
||||
/// genType t;
|
||||
/// t = clamp ((x - edge0) / (edge1 - edge0), 0, 1);
|
||||
/// return t * t * (3 - 2 * t);
|
||||
/// Results are undefined if edge0 >= edge1.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/smoothstep.xml">GLSL smoothstep man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType smoothstep(
|
||||
genType const & edge0,
|
||||
genType const & edge1,
|
||||
genType const & x);
|
||||
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType smoothstep(
|
||||
typename genType::value_type const & edge0,
|
||||
typename genType::value_type const & edge1,
|
||||
genType const & x);
|
||||
|
||||
/// Returns true if x holds a NaN (not a number)
|
||||
/// representation in the underlying implementation's set of
|
||||
/// floating point representations. Returns false otherwise,
|
||||
/// including for implementations with no NaN
|
||||
/// representations.
|
||||
///
|
||||
/// /!\ When using compiler fast math, this function may fail.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/isnan.xml">GLSL isnan man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL typename genType::bool_type isnan(genType const & x);
|
||||
|
||||
/// Returns true if x holds a positive infinity or negative
|
||||
/// infinity representation in the underlying implementation's
|
||||
/// set of floating point representations. Returns false
|
||||
/// otherwise, including for implementations with no infinity
|
||||
/// representations.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/isinf.xml">GLSL isinf man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL typename genType::bool_type isinf(genType const & x);
|
||||
|
||||
/// Returns a signed integer value representing
|
||||
/// the encoding of a floating-point value. The floating-point
|
||||
/// value's bit-level representation is preserved.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToInt.xml">GLSL floatBitsToInt man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
GLM_FUNC_DECL int floatBitsToInt(float const & v);
|
||||
|
||||
/// Returns a signed integer value representing
|
||||
/// the encoding of a floating-point value. The floatingpoint
|
||||
/// value's bit-level representation is preserved.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToInt.xml">GLSL floatBitsToInt man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <template <typename, precision> class vecType, precision P>
|
||||
GLM_FUNC_DECL vecType<int, P> floatBitsToInt(vecType<float, P> const & v);
|
||||
|
||||
/// Returns a unsigned integer value representing
|
||||
/// the encoding of a floating-point value. The floatingpoint
|
||||
/// value's bit-level representation is preserved.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToUint.xml">GLSL floatBitsToUint man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
GLM_FUNC_DECL uint floatBitsToUint(float const & v);
|
||||
|
||||
/// Returns a unsigned integer value representing
|
||||
/// the encoding of a floating-point value. The floatingpoint
|
||||
/// value's bit-level representation is preserved.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToUint.xml">GLSL floatBitsToUint man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <template <typename, precision> class vecType, precision P>
|
||||
GLM_FUNC_DECL vecType<uint, P> floatBitsToUint(vecType<float, P> const & v);
|
||||
|
||||
/// Returns a floating-point value corresponding to a signed
|
||||
/// integer encoding of a floating-point value.
|
||||
/// If an inf or NaN is passed in, it will not signal, and the
|
||||
/// resulting floating point value is unspecified. Otherwise,
|
||||
/// the bit-level representation is preserved.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/intBitsToFloat.xml">GLSL intBitsToFloat man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
GLM_FUNC_DECL float intBitsToFloat(int const & v);
|
||||
|
||||
/// Returns a floating-point value corresponding to a signed
|
||||
/// integer encoding of a floating-point value.
|
||||
/// If an inf or NaN is passed in, it will not signal, and the
|
||||
/// resulting floating point value is unspecified. Otherwise,
|
||||
/// the bit-level representation is preserved.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/intBitsToFloat.xml">GLSL intBitsToFloat man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <template <typename, precision> class vecType, precision P>
|
||||
GLM_FUNC_DECL vecType<float, P> intBitsToFloat(vecType<int, P> const & v);
|
||||
|
||||
/// Returns a floating-point value corresponding to a
|
||||
/// unsigned integer encoding of a floating-point value.
|
||||
/// If an inf or NaN is passed in, it will not signal, and the
|
||||
/// resulting floating point value is unspecified. Otherwise,
|
||||
/// the bit-level representation is preserved.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uintBitsToFloat.xml">GLSL uintBitsToFloat man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
GLM_FUNC_DECL float uintBitsToFloat(uint const & v);
|
||||
|
||||
/// Returns a floating-point value corresponding to a
|
||||
/// unsigned integer encoding of a floating-point value.
|
||||
/// If an inf or NaN is passed in, it will not signal, and the
|
||||
/// resulting floating point value is unspecified. Otherwise,
|
||||
/// the bit-level representation is preserved.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uintBitsToFloat.xml">GLSL uintBitsToFloat man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <template <typename, precision> class vecType, precision P>
|
||||
GLM_FUNC_DECL vecType<float, P> uintBitsToFloat(vecType<uint, P> const & v);
|
||||
|
||||
/// Computes and returns a * b + c.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/fma.xml">GLSL fma man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType fma(genType const & a, genType const & b, genType const & c);
|
||||
|
||||
/// Splits x into a floating-point significand in the range
|
||||
/// [0.5, 1.0) and an integral exponent of two, such that:
|
||||
/// x = significand * exp(2, exponent)
|
||||
///
|
||||
/// The significand is returned by the function and the
|
||||
/// exponent is returned in the parameter exp. For a
|
||||
/// floating-point value of zero, the significant and exponent
|
||||
/// are both zero. For a floating-point value that is an
|
||||
/// infinity or is not a number, the results are undefined.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/frexp.xml">GLSL frexp man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType, typename genIType>
|
||||
GLM_FUNC_DECL genType frexp(genType const & x, genIType & exp);
|
||||
|
||||
/// Builds a floating-point number from x and the
|
||||
/// corresponding integral exponent of two in exp, returning:
|
||||
/// significand * exp(2, exponent)
|
||||
///
|
||||
/// If this product is too large to be represented in the
|
||||
/// floating-point type, the result is undefined.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/ldexp.xml">GLSL ldexp man page</a>;
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
template <typename genType, typename genIType>
|
||||
GLM_FUNC_DECL genType ldexp(genType const & x, genIType const & exp);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
||||
#include "func_common.inl"
|
||||
|
||||
#endif//GLM_FUNC_COMMON_INCLUDED
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,132 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/func_exponential.hpp
|
||||
/// @date 2008-08-08 / 2011-06-14
|
||||
/// @author Christophe Riccio
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
|
||||
///
|
||||
/// @defgroup core_func_exponential Exponential functions
|
||||
/// @ingroup core
|
||||
///
|
||||
/// These all operate component-wise. The description is per component.
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef glm_core_func_exponential
|
||||
#define glm_core_func_exponential
|
||||
|
||||
#include "type_vec1.hpp"
|
||||
#include "type_vec2.hpp"
|
||||
#include "type_vec3.hpp"
|
||||
#include "type_vec4.hpp"
|
||||
#include <cmath>
|
||||
|
||||
namespace glm
|
||||
{
|
||||
/// @addtogroup core_func_exponential
|
||||
/// @{
|
||||
|
||||
/// Returns 'base' raised to the power 'exponent'.
|
||||
///
|
||||
/// @param base Floating point value. pow function is defined for input values of x defined in the range (inf-, inf+) in the limit of the type precision.
|
||||
/// @param exponent Floating point value representing the 'exponent'.
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/pow.xml">GLSL pow man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType pow(genType const & base, genType const & exponent);
|
||||
|
||||
/// Returns the natural exponentiation of x, i.e., e^x.
|
||||
///
|
||||
/// @param x exp function is defined for input values of x defined in the range (inf-, inf+) in the limit of the type precision.
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/exp.xml">GLSL exp man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType exp(genType const & x);
|
||||
|
||||
/// Returns the natural logarithm of x, i.e.,
|
||||
/// returns the value y which satisfies the equation x = e^y.
|
||||
/// Results are undefined if x <= 0.
|
||||
///
|
||||
/// @param x log function is defined for input values of x defined in the range (0, inf+) in the limit of the type precision.
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/log.xml">GLSL log man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType log(genType const & x);
|
||||
|
||||
/// Returns 2 raised to the x power.
|
||||
///
|
||||
/// @param x exp2 function is defined for input values of x defined in the range (inf-, inf+) in the limit of the type precision.
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/exp2.xml">GLSL exp2 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType exp2(genType const & x);
|
||||
|
||||
/// Returns the base 2 log of x, i.e., returns the value y,
|
||||
/// which satisfies the equation x = 2 ^ y.
|
||||
///
|
||||
/// @param x log2 function is defined for input values of x defined in the range (0, inf+) in the limit of the type precision.
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/log2.xml">GLSL log2 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType log2(genType x);
|
||||
|
||||
/// Returns the positive square root of x.
|
||||
///
|
||||
/// @param x sqrt function is defined for input values of x defined in the range [0, inf+) in the limit of the type precision.
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sqrt.xml">GLSL sqrt man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
|
||||
//template <typename genType>
|
||||
//GLM_FUNC_DECL genType sqrt(genType const & x);
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_DECL vecType<T, P> sqrt(vecType<T, P> const & x);
|
||||
|
||||
/// Returns the reciprocal of the positive square root of x.
|
||||
///
|
||||
/// @param x inversesqrt function is defined for input values of x defined in the range [0, inf+) in the limit of the type precision.
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inversesqrt.xml">GLSL inversesqrt man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType inversesqrt(genType const & x);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
||||
#include "func_exponential.inl"
|
||||
|
||||
#endif//glm_core_func_exponential
|
||||
@@ -0,0 +1,247 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/func_exponential.inl
|
||||
/// @date 2008-08-03 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "func_vector_relational.hpp"
|
||||
#include "_vectorize.hpp"
|
||||
#include <limits>
|
||||
#include <cassert>
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
template <bool isFloat>
|
||||
struct compute_log2
|
||||
{
|
||||
template <typename T>
|
||||
T operator() (T const & Value) const;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct compute_log2<true>
|
||||
{
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER T operator() (T const & Value) const
|
||||
{
|
||||
return static_cast<T>(::std::log(Value)) * static_cast<T>(1.4426950408889634073599246810019);
|
||||
}
|
||||
};
|
||||
|
||||
template <template <class, precision> class vecType, typename T, precision P>
|
||||
struct compute_inversesqrt
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x)
|
||||
{
|
||||
return static_cast<T>(1) / sqrt(x);
|
||||
}
|
||||
};
|
||||
|
||||
template <template <class, precision> class vecType>
|
||||
struct compute_inversesqrt<vecType, float, lowp>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<float, lowp> call(vecType<float, lowp> const & x)
|
||||
{
|
||||
vecType<float, lowp> tmp(x);
|
||||
vecType<float, lowp> xhalf(tmp * 0.5f);
|
||||
vecType<uint, lowp>* p = reinterpret_cast<vecType<uint, lowp>*>(const_cast<vecType<float, lowp>*>(&x));
|
||||
vecType<uint, lowp> i = vecType<uint, lowp>(0x5f375a86) - (*p >> vecType<uint, lowp>(1));
|
||||
vecType<float, lowp>* ptmp = reinterpret_cast<vecType<float, lowp>*>(&i);
|
||||
tmp = *ptmp;
|
||||
tmp = tmp * (1.5f - xhalf * tmp * tmp);
|
||||
return tmp;
|
||||
}
|
||||
};
|
||||
}//namespace detail
|
||||
|
||||
// pow
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType pow
|
||||
(
|
||||
genType const & x,
|
||||
genType const & y
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(
|
||||
std::numeric_limits<genType>::is_iec559,
|
||||
"'pow' only accept floating-point inputs");
|
||||
|
||||
return std::pow(x, y);
|
||||
}
|
||||
|
||||
VECTORIZE_VEC_VEC(pow)
|
||||
|
||||
// exp
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType exp
|
||||
(
|
||||
genType const & x
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(
|
||||
std::numeric_limits<genType>::is_iec559,
|
||||
"'exp' only accept floating-point inputs");
|
||||
|
||||
return std::exp(x);
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(exp)
|
||||
|
||||
// log
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType log
|
||||
(
|
||||
genType const & x
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(
|
||||
std::numeric_limits<genType>::is_iec559,
|
||||
"'log' only accept floating-point inputs");
|
||||
|
||||
return std::log(x);
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(log)
|
||||
|
||||
//exp2, ln2 = 0.69314718055994530941723212145818f
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType exp2(genType const & x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(
|
||||
std::numeric_limits<genType>::is_iec559,
|
||||
"'exp2' only accept floating-point inputs");
|
||||
|
||||
return std::exp(static_cast<genType>(0.69314718055994530941723212145818) * x);
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(exp2)
|
||||
|
||||
// log2, ln2 = 0.69314718055994530941723212145818f
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType log2(genType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::is_integer,
|
||||
"GLM core 'log2' only accept floating-point inputs. Include <glm/gtx/integer.hpp> for additional integer support.");
|
||||
|
||||
assert(x > genType(0)); // log2 is only defined on the range (0, inf]
|
||||
return detail::compute_log2<std::numeric_limits<genType>::is_iec559>()(x);
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(log2)
|
||||
|
||||
namespace detail
|
||||
{
|
||||
template <template <class, precision> class vecType, typename T, precision P>
|
||||
struct compute_sqrt{};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_sqrt<detail::tvec1, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static detail::tvec1<T, P> call(detail::tvec1<T, P> const & x)
|
||||
{
|
||||
return detail::tvec1<T, P>(std::sqrt(x.x));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_sqrt<detail::tvec2, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static detail::tvec2<T, P> call(detail::tvec2<T, P> const & x)
|
||||
{
|
||||
return detail::tvec2<T, P>(std::sqrt(x.x), std::sqrt(x.y));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_sqrt<detail::tvec3, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static detail::tvec3<T, P> call(detail::tvec3<T, P> const & x)
|
||||
{
|
||||
return detail::tvec3<T, P>(std::sqrt(x.x), std::sqrt(x.y), std::sqrt(x.z));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_sqrt<detail::tvec4, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static detail::tvec4<T, P> call(detail::tvec4<T, P> const & x)
|
||||
{
|
||||
return detail::tvec4<T, P>(std::sqrt(x.x), std::sqrt(x.y), std::sqrt(x.z), std::sqrt(x.w));
|
||||
}
|
||||
};
|
||||
}//namespace detail
|
||||
|
||||
// sqrt
|
||||
GLM_FUNC_QUALIFIER float sqrt(float x)
|
||||
{
|
||||
# ifdef __CUDACC__ // Wordaround for a CUDA compiler bug up to CUDA6
|
||||
detail::tvec1<float, highp> tmp(detail::compute_sqrt<detail::tvec1, float, highp>::call(x));
|
||||
return tmp.x;
|
||||
# else
|
||||
return detail::compute_sqrt<detail::tvec1, float, highp>::call(x).x;
|
||||
# endif
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER double sqrt(double x)
|
||||
{
|
||||
# ifdef __CUDACC__ // Wordaround for a CUDA compiler bug up to CUDA6
|
||||
detail::tvec1<double, highp> tmp(detail::compute_sqrt<detail::tvec1, double, highp>::call(x));
|
||||
return tmp.x;
|
||||
# else
|
||||
return detail::compute_sqrt<detail::tvec1, double, highp>::call(x).x;
|
||||
# endif
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> sqrt(vecType<T, P> const & x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'sqrt' only accept floating-point inputs");
|
||||
return detail::compute_sqrt<vecType, T, P>::call(x);
|
||||
}
|
||||
|
||||
// inversesqrt
|
||||
GLM_FUNC_QUALIFIER float inversesqrt(float const & x)
|
||||
{
|
||||
return 1.0f / sqrt(x);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER double inversesqrt(double const & x)
|
||||
{
|
||||
return 1.0 / sqrt(x);
|
||||
}
|
||||
|
||||
template <template <class, precision> class vecType, typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> inversesqrt
|
||||
(
|
||||
vecType<T, P> const & x
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'inversesqrt' only accept floating-point inputs");
|
||||
return detail::compute_inversesqrt<vecType, T, P>::call(x);
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(inversesqrt)
|
||||
}//namespace glm
|
||||
@@ -0,0 +1,151 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/func_geometric.hpp
|
||||
/// @date 2008-08-03 / 2011-06-14
|
||||
/// @author Christophe Riccio
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
|
||||
///
|
||||
/// @defgroup core_func_geometric Geometric functions
|
||||
/// @ingroup core
|
||||
///
|
||||
/// These operate on vectors as vectors, not component-wise.
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef glm_core_func_geometric
|
||||
#define glm_core_func_geometric
|
||||
|
||||
#include "type_vec3.hpp"
|
||||
|
||||
namespace glm
|
||||
{
|
||||
/// @addtogroup core_func_geometric
|
||||
/// @{
|
||||
|
||||
/// Returns the length of x, i.e., sqrt(x * x).
|
||||
///
|
||||
/// @tparam genType Floating-point vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/length.xml">GLSL length man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL typename genType::value_type length(
|
||||
genType const & x);
|
||||
|
||||
/// Returns the distance betwwen p0 and p1, i.e., length(p0 - p1).
|
||||
///
|
||||
/// @tparam genType Floating-point vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/distance.xml">GLSL distance man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL typename genType::value_type distance(
|
||||
genType const & p0,
|
||||
genType const & p1);
|
||||
|
||||
/// Returns the dot product of x and y, i.e., result = x * y.
|
||||
///
|
||||
/// @tparam genType Floating-point vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/dot.xml">GLSL dot man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_DECL T dot(
|
||||
vecType<T, P> const & x,
|
||||
vecType<T, P> const & y);
|
||||
|
||||
/// Returns the dot product of x and y, i.e., result = x * y.
|
||||
///
|
||||
/// @tparam genType Floating-point vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/dot.xml">GLSL dot man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType dot(
|
||||
genType const & x,
|
||||
genType const & y);
|
||||
|
||||
/// Returns the cross product of x and y.
|
||||
///
|
||||
/// @tparam valType Floating-point scalar types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cross.xml">GLSL cross man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL detail::tvec3<T, P> cross(
|
||||
detail::tvec3<T, P> const & x,
|
||||
detail::tvec3<T, P> const & y);
|
||||
|
||||
/// Returns a vector in the same direction as x but with length of 1.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/normalize.xml">GLSL normalize man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType normalize(
|
||||
genType const & x);
|
||||
|
||||
/// If dot(Nref, I) < 0.0, return N, otherwise, return -N.
|
||||
///
|
||||
/// @tparam genType Floating-point vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/faceforward.xml">GLSL faceforward man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType faceforward(
|
||||
genType const & N,
|
||||
genType const & I,
|
||||
genType const & Nref);
|
||||
|
||||
/// For the incident vector I and surface orientation N,
|
||||
/// returns the reflection direction : result = I - 2.0 * dot(N, I) * N.
|
||||
///
|
||||
/// @tparam genType Floating-point vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/reflect.xml">GLSL reflect man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType reflect(
|
||||
genType const & I,
|
||||
genType const & N);
|
||||
|
||||
/// For the incident vector I and surface normal N,
|
||||
/// and the ratio of indices of refraction eta,
|
||||
/// return the refraction vector.
|
||||
///
|
||||
/// @tparam genType Floating-point vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/refract.xml">GLSL refract man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_DECL vecType<T, P> refract(
|
||||
vecType<T, P> const & I,
|
||||
vecType<T, P> const & N,
|
||||
T const & eta);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
||||
#include "func_geometric.inl"
|
||||
|
||||
#endif//glm_core_func_geometric
|
||||
@@ -0,0 +1,340 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/func_geometric.inl
|
||||
/// @date 2008-08-03 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "func_exponential.hpp"
|
||||
#include "func_common.hpp"
|
||||
#include "type_vec2.hpp"
|
||||
#include "type_vec4.hpp"
|
||||
#include "type_float.hpp"
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
template <template <class, precision> class vecType, typename T, precision P>
|
||||
struct compute_dot{};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_dot<detail::tvec1, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static T call(detail::tvec1<T, P> const & x, detail::tvec1<T, P> const & y)
|
||||
{
|
||||
# ifdef __CUDACC__ // Wordaround for a CUDA compiler bug up to CUDA6
|
||||
detail::tvec1<T, P> tmp(x * y);
|
||||
return tmp.x;
|
||||
# else
|
||||
return detail::tvec1<T, P>(x * y).x;
|
||||
# endif
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_dot<detail::tvec2, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static T call(detail::tvec2<T, P> const & x, detail::tvec2<T, P> const & y)
|
||||
{
|
||||
detail::tvec2<T, P> tmp(x * y);
|
||||
return tmp.x + tmp.y;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_dot<detail::tvec3, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static T call(detail::tvec3<T, P> const & x, detail::tvec3<T, P> const & y)
|
||||
{
|
||||
detail::tvec3<T, P> tmp(x * y);
|
||||
return tmp.x + tmp.y + tmp.z;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_dot<detail::tvec4, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static T call(detail::tvec4<T, P> const & x, detail::tvec4<T, P> const & y)
|
||||
{
|
||||
detail::tvec4<T, P> tmp(x * y);
|
||||
return (tmp.x + tmp.y) + (tmp.z + tmp.w);
|
||||
}
|
||||
};
|
||||
}//namespace detail
|
||||
|
||||
// length
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType length
|
||||
(
|
||||
genType const & x
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'length' only accept floating-point inputs");
|
||||
|
||||
genType sqr = x * x;
|
||||
return sqrt(sqr);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER T length(detail::tvec2<T, P> const & v)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'length' only accept floating-point inputs");
|
||||
|
||||
T sqr = v.x * v.x + v.y * v.y;
|
||||
return sqrt(sqr);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER T length(detail::tvec3<T, P> const & v)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'length' only accept floating-point inputs");
|
||||
|
||||
T sqr = v.x * v.x + v.y * v.y + v.z * v.z;
|
||||
return sqrt(sqr);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER T length(detail::tvec4<T, P> const & v)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'length' only accept floating-point inputs");
|
||||
|
||||
T sqr = v.x * v.x + v.y * v.y + v.z * v.z + v.w * v.w;
|
||||
return sqrt(sqr);
|
||||
}
|
||||
|
||||
// distance
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType distance
|
||||
(
|
||||
genType const & p0,
|
||||
genType const & p1
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'distance' only accept floating-point inputs");
|
||||
|
||||
return length(p1 - p0);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER T distance
|
||||
(
|
||||
detail::tvec2<T, P> const & p0,
|
||||
detail::tvec2<T, P> const & p1
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'distance' only accept floating-point inputs");
|
||||
|
||||
return length(p1 - p0);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER T distance
|
||||
(
|
||||
detail::tvec3<T, P> const & p0,
|
||||
detail::tvec3<T, P> const & p1
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'distance' only accept floating-point inputs");
|
||||
|
||||
return length(p1 - p0);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER T distance
|
||||
(
|
||||
detail::tvec4<T, P> const & p0,
|
||||
detail::tvec4<T, P> const & p1
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'distance' only accept floating-point inputs");
|
||||
|
||||
return length(p1 - p0);
|
||||
}
|
||||
|
||||
// dot
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER T dot
|
||||
(
|
||||
T const & x,
|
||||
T const & y
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'dot' only accept floating-point inputs");
|
||||
return detail::compute_dot<detail::tvec1, T, highp>::call(x, y);
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER T dot
|
||||
(
|
||||
vecType<T, P> const & x,
|
||||
vecType<T, P> const & y
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'dot' only accept floating-point inputs");
|
||||
return detail::compute_dot<vecType, T, P>::call(x, y);
|
||||
}
|
||||
|
||||
/* // SSE3
|
||||
GLM_FUNC_QUALIFIER float dot(const tvec4<float>& x, const tvec4<float>& y)
|
||||
{
|
||||
float Result;
|
||||
__asm
|
||||
{
|
||||
mov esi, x
|
||||
mov edi, y
|
||||
movaps xmm0, [esi]
|
||||
mulps xmm0, [edi]
|
||||
haddps( _xmm0, _xmm0 )
|
||||
haddps( _xmm0, _xmm0 )
|
||||
movss Result, xmm0
|
||||
}
|
||||
return Result;
|
||||
}
|
||||
*/
|
||||
// cross
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER detail::tvec3<T, P> cross
|
||||
(
|
||||
detail::tvec3<T, P> const & x,
|
||||
detail::tvec3<T, P> const & y
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'cross' only accept floating-point inputs");
|
||||
|
||||
return detail::tvec3<T, P>(
|
||||
x.y * y.z - y.y * x.z,
|
||||
x.z * y.x - y.z * x.x,
|
||||
x.x * y.y - y.x * x.y);
|
||||
}
|
||||
|
||||
// normalize
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType normalize
|
||||
(
|
||||
genType const & x
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'normalize' only accept floating-point inputs");
|
||||
|
||||
return x < genType(0) ? genType(-1) : genType(1);
|
||||
}
|
||||
|
||||
// According to issue 10 GLSL 1.10 specification, if length(x) == 0 then result is undefine and generate an error
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER detail::tvec2<T, P> normalize
|
||||
(
|
||||
detail::tvec2<T, P> const & x
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'normalize' only accept floating-point inputs");
|
||||
|
||||
T sqr = x.x * x.x + x.y * x.y;
|
||||
return x * inversesqrt(sqr);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER detail::tvec3<T, P> normalize
|
||||
(
|
||||
detail::tvec3<T, P> const & x
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'normalize' only accept floating-point inputs");
|
||||
|
||||
T sqr = x.x * x.x + x.y * x.y + x.z * x.z;
|
||||
return x * inversesqrt(sqr);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER detail::tvec4<T, P> normalize
|
||||
(
|
||||
detail::tvec4<T, P> const & x
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'normalize' only accept floating-point inputs");
|
||||
|
||||
T sqr = x.x * x.x + x.y * x.y + x.z * x.z + x.w * x.w;
|
||||
return x * inversesqrt(sqr);
|
||||
}
|
||||
|
||||
// faceforward
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType faceforward
|
||||
(
|
||||
genType const & N,
|
||||
genType const & I,
|
||||
genType const & Nref
|
||||
)
|
||||
{
|
||||
return dot(Nref, I) < 0 ? N : -N;
|
||||
}
|
||||
|
||||
// reflect
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType reflect
|
||||
(
|
||||
genType const & I,
|
||||
genType const & N
|
||||
)
|
||||
{
|
||||
return I - N * dot(N, I) * genType(2);
|
||||
}
|
||||
|
||||
// refract
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType refract
|
||||
(
|
||||
genType const & I,
|
||||
genType const & N,
|
||||
genType const & eta
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'refract' only accept floating-point inputs");
|
||||
|
||||
genType dotValue = dot(N, I);
|
||||
genType k = genType(1) - eta * eta * (genType(1) - dotValue * dotValue);
|
||||
if(k < genType(0))
|
||||
return genType(0);
|
||||
else
|
||||
return eta * I - (eta * dotValue + sqrt(k)) * N;
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> refract
|
||||
(
|
||||
vecType<T, P> const & I,
|
||||
vecType<T, P> const & N,
|
||||
T const & eta
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'refract' only accept floating-point inputs");
|
||||
|
||||
T dotValue = dot(N, I);
|
||||
T k = T(1) - eta * eta * (T(1) - dotValue * dotValue);
|
||||
if(k < T(0))
|
||||
return vecType<T, P>(0);
|
||||
else
|
||||
return eta * I - (eta * dotValue + std::sqrt(k)) * N;
|
||||
}
|
||||
|
||||
}//namespace glm
|
||||
@@ -0,0 +1,203 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/func_integer.hpp
|
||||
/// @date 2010-03-17 / 2011-06-18
|
||||
/// @author Christophe Riccio
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
|
||||
///
|
||||
/// @defgroup core_func_integer Integer functions
|
||||
/// @ingroup core
|
||||
///
|
||||
/// These all operate component-wise. The description is per component.
|
||||
/// The notation [a, b] means the set of bits from bit-number a through bit-number
|
||||
/// b, inclusive. The lowest-order bit is bit 0.
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef glm_core_func_integer
|
||||
#define glm_core_func_integer
|
||||
|
||||
#include "setup.hpp"
|
||||
|
||||
namespace glm
|
||||
{
|
||||
/// @addtogroup core_func_integer
|
||||
/// @{
|
||||
|
||||
/// Adds 32-bit unsigned integer x and y, returning the sum
|
||||
/// modulo pow(2, 32). The value carry is set to 0 if the sum was
|
||||
/// less than pow(2, 32), or to 1 otherwise.
|
||||
///
|
||||
/// @tparam genUType Unsigned integer scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uaddCarry.xml">GLSL uaddCarry man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
|
||||
template <typename genUType>
|
||||
GLM_FUNC_DECL genUType uaddCarry(
|
||||
genUType const & x,
|
||||
genUType const & y,
|
||||
genUType & carry);
|
||||
|
||||
/// Subtracts the 32-bit unsigned integer y from x, returning
|
||||
/// the difference if non-negative, or pow(2, 32) plus the difference
|
||||
/// otherwise. The value borrow is set to 0 if x >= y, or to 1 otherwise.
|
||||
///
|
||||
/// @tparam genUType Unsigned integer scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/usubBorrow.xml">GLSL usubBorrow man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
|
||||
template <typename genUType>
|
||||
GLM_FUNC_DECL genUType usubBorrow(
|
||||
genUType const & x,
|
||||
genUType const & y,
|
||||
genUType & borrow);
|
||||
|
||||
/// Multiplies 32-bit integers x and y, producing a 64-bit
|
||||
/// result. The 32 least-significant bits are returned in lsb.
|
||||
/// The 32 most-significant bits are returned in msb.
|
||||
///
|
||||
/// @tparam genUType Unsigned integer scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/umulExtended.xml">GLSL umulExtended man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
|
||||
template <typename genUType>
|
||||
GLM_FUNC_DECL void umulExtended(
|
||||
genUType const & x,
|
||||
genUType const & y,
|
||||
genUType & msb,
|
||||
genUType & lsb);
|
||||
|
||||
/// Multiplies 32-bit integers x and y, producing a 64-bit
|
||||
/// result. The 32 least-significant bits are returned in lsb.
|
||||
/// The 32 most-significant bits are returned in msb.
|
||||
///
|
||||
/// @tparam genIType Signed integer scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/imulExtended.xml">GLSL imulExtended man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
|
||||
template <typename genIType>
|
||||
GLM_FUNC_DECL void imulExtended(
|
||||
genIType const & x,
|
||||
genIType const & y,
|
||||
genIType & msb,
|
||||
genIType & lsb);
|
||||
|
||||
/// Extracts bits [offset, offset + bits - 1] from value,
|
||||
/// returning them in the least significant bits of the result.
|
||||
/// For unsigned data types, the most significant bits of the
|
||||
/// result will be set to zero. For signed data types, the
|
||||
/// most significant bits will be set to the value of bit offset + base - 1.
|
||||
///
|
||||
/// If bits is zero, the result will be zero. The result will be
|
||||
/// undefined if offset or bits is negative, or if the sum of
|
||||
/// offset and bits is greater than the number of bits used
|
||||
/// to store the operand.
|
||||
///
|
||||
/// @tparam genIUType Signed or unsigned integer scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldExtract.xml">GLSL bitfieldExtract man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
|
||||
template <typename genIUType>
|
||||
GLM_FUNC_DECL genIUType bitfieldExtract(
|
||||
genIUType const & Value,
|
||||
int const & Offset,
|
||||
int const & Bits);
|
||||
|
||||
/// Returns the insertion the bits least-significant bits of insert into base.
|
||||
///
|
||||
/// The result will have bits [offset, offset + bits - 1] taken
|
||||
/// from bits [0, bits - 1] of insert, and all other bits taken
|
||||
/// directly from the corresponding bits of base. If bits is
|
||||
/// zero, the result will simply be base. The result will be
|
||||
/// undefined if offset or bits is negative, or if the sum of
|
||||
/// offset and bits is greater than the number of bits used to
|
||||
/// store the operand.
|
||||
///
|
||||
/// @tparam genIUType Signed or unsigned integer scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldInsert.xml">GLSL bitfieldInsert man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
|
||||
template <typename genIUType>
|
||||
GLM_FUNC_DECL genIUType bitfieldInsert(
|
||||
genIUType const & Base,
|
||||
genIUType const & Insert,
|
||||
int const & Offset,
|
||||
int const & Bits);
|
||||
|
||||
/// Returns the reversal of the bits of value.
|
||||
/// The bit numbered n of the result will be taken from bit (bits - 1) - n of value,
|
||||
/// where bits is the total number of bits used to represent value.
|
||||
///
|
||||
/// @tparam genIUType Signed or unsigned integer scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldReverse.xml">GLSL bitfieldReverse man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
|
||||
template <typename genIUType>
|
||||
GLM_FUNC_DECL genIUType bitfieldReverse(genIUType const & Value);
|
||||
|
||||
/// Returns the number of bits set to 1 in the binary representation of value.
|
||||
///
|
||||
/// @tparam genIUType Signed or unsigned integer scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitCount.xml">GLSL bitCount man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
|
||||
///
|
||||
/// @todo Clarify the declaration to specify that scalars are suported.
|
||||
template <typename T, template <typename> class genIUType>
|
||||
GLM_FUNC_DECL typename genIUType<T>::signed_type bitCount(genIUType<T> const & Value);
|
||||
|
||||
/// Returns the bit number of the least significant bit set to
|
||||
/// 1 in the binary representation of value.
|
||||
/// If value is zero, -1 will be returned.
|
||||
///
|
||||
/// @tparam genIUType Signed or unsigned integer scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findLSB.xml">GLSL findLSB man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
|
||||
///
|
||||
/// @todo Clarify the declaration to specify that scalars are suported.
|
||||
template <typename T, template <typename> class genIUType>
|
||||
GLM_FUNC_DECL typename genIUType<T>::signed_type findLSB(genIUType<T> const & Value);
|
||||
|
||||
/// Returns the bit number of the most significant bit in the binary representation of value.
|
||||
/// For positive integers, the result will be the bit number of the most significant bit set to 1.
|
||||
/// For negative integers, the result will be the bit number of the most significant
|
||||
/// bit set to 0. For a value of zero or negative one, -1 will be returned.
|
||||
///
|
||||
/// @tparam genIUType Signed or unsigned integer scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findMSB.xml">GLSL findMSB man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
|
||||
///
|
||||
/// @todo Clarify the declaration to specify that scalars are suported.
|
||||
template <typename T, template <typename> class genIUType>
|
||||
GLM_FUNC_DECL typename genIUType<T>::signed_type findMSB(genIUType<T> const & Value);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
||||
#include "func_integer.inl"
|
||||
|
||||
#endif//glm_core_func_integer
|
||||
|
||||
@@ -0,0 +1,654 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/func_integer.inl
|
||||
/// @date 2010-03-17 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "type_vec2.hpp"
|
||||
#include "type_vec3.hpp"
|
||||
#include "type_vec4.hpp"
|
||||
#include "type_int.hpp"
|
||||
#include "_vectorize.hpp"
|
||||
#if(GLM_ARCH != GLM_ARCH_PURE)
|
||||
#if(GLM_COMPILER & GLM_COMPILER_VC)
|
||||
# include <intrin.h>
|
||||
# pragma intrinsic(_BitScanReverse)
|
||||
#endif//(GLM_COMPILER & GLM_COMPILER_VC)
|
||||
#endif//(GLM_ARCH != GLM_ARCH_PURE)
|
||||
#include <limits>
|
||||
|
||||
namespace glm
|
||||
{
|
||||
// uaddCarry
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER uint uaddCarry
|
||||
(
|
||||
uint const & x,
|
||||
uint const & y,
|
||||
uint & Carry
|
||||
)
|
||||
{
|
||||
uint64 Value64 = static_cast<uint64>(x) + static_cast<uint64>(y);
|
||||
uint32 Result = static_cast<uint32>(Value64 % (static_cast<uint64>(1) << static_cast<uint64>(32)));
|
||||
Carry = (Value64 % (static_cast<uint64>(1) << static_cast<uint64>(32))) > 1 ? static_cast<uint32>(1) : static_cast<uint32>(0);
|
||||
return Result;
|
||||
}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER uvec2 uaddCarry
|
||||
(
|
||||
uvec2 const & x,
|
||||
uvec2 const & y,
|
||||
uvec2 & Carry
|
||||
)
|
||||
{
|
||||
return uvec2(
|
||||
uaddCarry(x[0], y[0], Carry[0]),
|
||||
uaddCarry(x[1], y[1], Carry[1]));
|
||||
}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER uvec3 uaddCarry
|
||||
(
|
||||
uvec3 const & x,
|
||||
uvec3 const & y,
|
||||
uvec3 & Carry
|
||||
)
|
||||
{
|
||||
return uvec3(
|
||||
uaddCarry(x[0], y[0], Carry[0]),
|
||||
uaddCarry(x[1], y[1], Carry[1]),
|
||||
uaddCarry(x[2], y[2], Carry[2]));
|
||||
}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER uvec4 uaddCarry
|
||||
(
|
||||
uvec4 const & x,
|
||||
uvec4 const & y,
|
||||
uvec4 & Carry
|
||||
)
|
||||
{
|
||||
return uvec4(
|
||||
uaddCarry(x[0], y[0], Carry[0]),
|
||||
uaddCarry(x[1], y[1], Carry[1]),
|
||||
uaddCarry(x[2], y[2], Carry[2]),
|
||||
uaddCarry(x[3], y[3], Carry[3]));
|
||||
}
|
||||
|
||||
// usubBorrow
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER uint usubBorrow
|
||||
(
|
||||
uint const & x,
|
||||
uint const & y,
|
||||
uint & Borrow
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(sizeof(uint) == sizeof(uint32), "uint and uint32 size mismatch");
|
||||
|
||||
Borrow = x >= y ? static_cast<uint32>(0) : static_cast<uint32>(1);
|
||||
if(y >= x)
|
||||
return y - x;
|
||||
else
|
||||
return static_cast<uint32>((static_cast<int64>(1) << static_cast<int64>(32)) + (static_cast<int64>(y) - static_cast<int64>(x)));
|
||||
}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER uvec2 usubBorrow
|
||||
(
|
||||
uvec2 const & x,
|
||||
uvec2 const & y,
|
||||
uvec2 & Borrow
|
||||
)
|
||||
{
|
||||
return uvec2(
|
||||
usubBorrow(x[0], y[0], Borrow[0]),
|
||||
usubBorrow(x[1], y[1], Borrow[1]));
|
||||
}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER uvec3 usubBorrow
|
||||
(
|
||||
uvec3 const & x,
|
||||
uvec3 const & y,
|
||||
uvec3 & Borrow
|
||||
)
|
||||
{
|
||||
return uvec3(
|
||||
usubBorrow(x[0], y[0], Borrow[0]),
|
||||
usubBorrow(x[1], y[1], Borrow[1]),
|
||||
usubBorrow(x[2], y[2], Borrow[2]));
|
||||
}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER uvec4 usubBorrow
|
||||
(
|
||||
uvec4 const & x,
|
||||
uvec4 const & y,
|
||||
uvec4 & Borrow
|
||||
)
|
||||
{
|
||||
return uvec4(
|
||||
usubBorrow(x[0], y[0], Borrow[0]),
|
||||
usubBorrow(x[1], y[1], Borrow[1]),
|
||||
usubBorrow(x[2], y[2], Borrow[2]),
|
||||
usubBorrow(x[3], y[3], Borrow[3]));
|
||||
}
|
||||
|
||||
// umulExtended
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER void umulExtended
|
||||
(
|
||||
uint const & x,
|
||||
uint const & y,
|
||||
uint & msb,
|
||||
uint & lsb
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(sizeof(uint) == sizeof(uint32), "uint and uint32 size mismatch");
|
||||
|
||||
uint64 Value64 = static_cast<uint64>(x) * static_cast<uint64>(y);
|
||||
uint32* PointerMSB = (reinterpret_cast<uint32*>(&Value64) + 1);
|
||||
msb = *PointerMSB;
|
||||
uint32* PointerLSB = (reinterpret_cast<uint32*>(&Value64) + 0);
|
||||
lsb = *PointerLSB;
|
||||
}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER void umulExtended
|
||||
(
|
||||
uvec2 const & x,
|
||||
uvec2 const & y,
|
||||
uvec2 & msb,
|
||||
uvec2 & lsb
|
||||
)
|
||||
{
|
||||
umulExtended(x[0], y[0], msb[0], lsb[0]);
|
||||
umulExtended(x[1], y[1], msb[1], lsb[1]);
|
||||
}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER void umulExtended
|
||||
(
|
||||
uvec3 const & x,
|
||||
uvec3 const & y,
|
||||
uvec3 & msb,
|
||||
uvec3 & lsb
|
||||
)
|
||||
{
|
||||
umulExtended(x[0], y[0], msb[0], lsb[0]);
|
||||
umulExtended(x[1], y[1], msb[1], lsb[1]);
|
||||
umulExtended(x[2], y[2], msb[2], lsb[2]);
|
||||
}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER void umulExtended
|
||||
(
|
||||
uvec4 const & x,
|
||||
uvec4 const & y,
|
||||
uvec4 & msb,
|
||||
uvec4 & lsb
|
||||
)
|
||||
{
|
||||
umulExtended(x[0], y[0], msb[0], lsb[0]);
|
||||
umulExtended(x[1], y[1], msb[1], lsb[1]);
|
||||
umulExtended(x[2], y[2], msb[2], lsb[2]);
|
||||
umulExtended(x[3], y[3], msb[3], lsb[3]);
|
||||
}
|
||||
|
||||
// imulExtended
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER void imulExtended
|
||||
(
|
||||
int const & x,
|
||||
int const & y,
|
||||
int & msb,
|
||||
int & lsb
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(sizeof(int) == sizeof(int32), "int and int32 size mismatch");
|
||||
|
||||
int64 Value64 = static_cast<int64>(x) * static_cast<int64>(y);
|
||||
int32* PointerMSB = (reinterpret_cast<int32*>(&Value64) + 1);
|
||||
msb = *PointerMSB;
|
||||
int32* PointerLSB = (reinterpret_cast<int32*>(&Value64));
|
||||
lsb = *PointerLSB;
|
||||
}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER void imulExtended
|
||||
(
|
||||
ivec2 const & x,
|
||||
ivec2 const & y,
|
||||
ivec2 & msb,
|
||||
ivec2 & lsb
|
||||
)
|
||||
{
|
||||
imulExtended(x[0], y[0], msb[0], lsb[0]),
|
||||
imulExtended(x[1], y[1], msb[1], lsb[1]);
|
||||
}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER void imulExtended
|
||||
(
|
||||
ivec3 const & x,
|
||||
ivec3 const & y,
|
||||
ivec3 & msb,
|
||||
ivec3 & lsb
|
||||
)
|
||||
{
|
||||
imulExtended(x[0], y[0], msb[0], lsb[0]),
|
||||
imulExtended(x[1], y[1], msb[1], lsb[1]);
|
||||
imulExtended(x[2], y[2], msb[2], lsb[2]);
|
||||
}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER void imulExtended
|
||||
(
|
||||
ivec4 const & x,
|
||||
ivec4 const & y,
|
||||
ivec4 & msb,
|
||||
ivec4 & lsb
|
||||
)
|
||||
{
|
||||
imulExtended(x[0], y[0], msb[0], lsb[0]),
|
||||
imulExtended(x[1], y[1], msb[1], lsb[1]);
|
||||
imulExtended(x[2], y[2], msb[2], lsb[2]);
|
||||
imulExtended(x[3], y[3], msb[3], lsb[3]);
|
||||
}
|
||||
|
||||
// bitfieldExtract
|
||||
template <typename genIUType>
|
||||
GLM_FUNC_QUALIFIER genIUType bitfieldExtract
|
||||
(
|
||||
genIUType const & Value,
|
||||
int const & Offset,
|
||||
int const & Bits
|
||||
)
|
||||
{
|
||||
int GenSize = int(sizeof(genIUType)) << int(3);
|
||||
|
||||
assert(Offset + Bits <= GenSize);
|
||||
|
||||
genIUType ShiftLeft = Bits ? Value << (GenSize - (Bits + Offset)) : genIUType(0);
|
||||
genIUType ShiftBack = ShiftLeft >> genIUType(GenSize - Bits);
|
||||
|
||||
return ShiftBack;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER detail::tvec2<T, P> bitfieldExtract
|
||||
(
|
||||
detail::tvec2<T, P> const & Value,
|
||||
int const & Offset,
|
||||
int const & Bits
|
||||
)
|
||||
{
|
||||
return detail::tvec2<T, P>(
|
||||
bitfieldExtract(Value[0], Offset, Bits),
|
||||
bitfieldExtract(Value[1], Offset, Bits));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER detail::tvec3<T, P> bitfieldExtract
|
||||
(
|
||||
detail::tvec3<T, P> const & Value,
|
||||
int const & Offset,
|
||||
int const & Bits
|
||||
)
|
||||
{
|
||||
return detail::tvec3<T, P>(
|
||||
bitfieldExtract(Value[0], Offset, Bits),
|
||||
bitfieldExtract(Value[1], Offset, Bits),
|
||||
bitfieldExtract(Value[2], Offset, Bits));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER detail::tvec4<T, P> bitfieldExtract
|
||||
(
|
||||
detail::tvec4<T, P> const & Value,
|
||||
int const & Offset,
|
||||
int const & Bits
|
||||
)
|
||||
{
|
||||
return detail::tvec4<T, P>(
|
||||
bitfieldExtract(Value[0], Offset, Bits),
|
||||
bitfieldExtract(Value[1], Offset, Bits),
|
||||
bitfieldExtract(Value[2], Offset, Bits),
|
||||
bitfieldExtract(Value[3], Offset, Bits));
|
||||
}
|
||||
|
||||
// bitfieldInsert
|
||||
template <typename genIUType>
|
||||
GLM_FUNC_QUALIFIER genIUType bitfieldInsert
|
||||
(
|
||||
genIUType const & Base,
|
||||
genIUType const & Insert,
|
||||
int const & Offset,
|
||||
int const & Bits
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'bitfieldInsert' only accept integer values");
|
||||
assert(Offset + Bits <= sizeof(genIUType));
|
||||
|
||||
if(Bits == 0)
|
||||
return Base;
|
||||
|
||||
genIUType Mask = 0;
|
||||
for(int Bit = Offset; Bit < Offset + Bits; ++Bit)
|
||||
Mask |= (1 << Bit);
|
||||
|
||||
return (Base & ~Mask) | (Insert & Mask);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER detail::tvec2<T, P> bitfieldInsert
|
||||
(
|
||||
detail::tvec2<T, P> const & Base,
|
||||
detail::tvec2<T, P> const & Insert,
|
||||
int const & Offset,
|
||||
int const & Bits
|
||||
)
|
||||
{
|
||||
return detail::tvec2<T, P>(
|
||||
bitfieldInsert(Base[0], Insert[0], Offset, Bits),
|
||||
bitfieldInsert(Base[1], Insert[1], Offset, Bits));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER detail::tvec3<T, P> bitfieldInsert
|
||||
(
|
||||
detail::tvec3<T, P> const & Base,
|
||||
detail::tvec3<T, P> const & Insert,
|
||||
int const & Offset,
|
||||
int const & Bits
|
||||
)
|
||||
{
|
||||
return detail::tvec3<T, P>(
|
||||
bitfieldInsert(Base[0], Insert[0], Offset, Bits),
|
||||
bitfieldInsert(Base[1], Insert[1], Offset, Bits),
|
||||
bitfieldInsert(Base[2], Insert[2], Offset, Bits));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER detail::tvec4<T, P> bitfieldInsert
|
||||
(
|
||||
detail::tvec4<T, P> const & Base,
|
||||
detail::tvec4<T, P> const & Insert,
|
||||
int const & Offset,
|
||||
int const & Bits
|
||||
)
|
||||
{
|
||||
return detail::tvec4<T, P>(
|
||||
bitfieldInsert(Base[0], Insert[0], Offset, Bits),
|
||||
bitfieldInsert(Base[1], Insert[1], Offset, Bits),
|
||||
bitfieldInsert(Base[2], Insert[2], Offset, Bits),
|
||||
bitfieldInsert(Base[3], Insert[3], Offset, Bits));
|
||||
}
|
||||
|
||||
// bitfieldReverse
|
||||
template <typename genIUType>
|
||||
GLM_FUNC_QUALIFIER genIUType bitfieldReverse(genIUType const & Value)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'bitfieldReverse' only accept integer values");
|
||||
|
||||
genIUType Out = 0;
|
||||
std::size_t BitSize = sizeof(genIUType) * 8;
|
||||
for(std::size_t i = 0; i < BitSize; ++i)
|
||||
if(Value & (genIUType(1) << i))
|
||||
Out |= genIUType(1) << (BitSize - 1 - i);
|
||||
return Out;
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(bitfieldReverse)
|
||||
|
||||
// bitCount
|
||||
template <typename genIUType>
|
||||
GLM_FUNC_QUALIFIER int bitCount(genIUType const & Value)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'bitCount' only accept integer values");
|
||||
|
||||
int Count = 0;
|
||||
for(std::size_t i = 0; i < sizeof(genIUType) * std::size_t(8); ++i)
|
||||
{
|
||||
if(Value & (1 << i))
|
||||
++Count;
|
||||
}
|
||||
return Count;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER detail::tvec2<int, P> bitCount
|
||||
(
|
||||
detail::tvec2<T, P> const & value
|
||||
)
|
||||
{
|
||||
return detail::tvec2<int, P>(
|
||||
bitCount(value[0]),
|
||||
bitCount(value[1]));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER detail::tvec3<int, P> bitCount
|
||||
(
|
||||
detail::tvec3<T, P> const & value
|
||||
)
|
||||
{
|
||||
return detail::tvec3<int, P>(
|
||||
bitCount(value[0]),
|
||||
bitCount(value[1]),
|
||||
bitCount(value[2]));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER detail::tvec4<int, P> bitCount
|
||||
(
|
||||
detail::tvec4<T, P> const & value
|
||||
)
|
||||
{
|
||||
return detail::tvec4<int, P>(
|
||||
bitCount(value[0]),
|
||||
bitCount(value[1]),
|
||||
bitCount(value[2]),
|
||||
bitCount(value[3]));
|
||||
}
|
||||
|
||||
// findLSB
|
||||
template <typename genIUType>
|
||||
GLM_FUNC_QUALIFIER int findLSB
|
||||
(
|
||||
genIUType const & Value
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'findLSB' only accept integer values");
|
||||
if(Value == 0)
|
||||
return -1;
|
||||
|
||||
genIUType Bit;
|
||||
for(Bit = genIUType(0); !(Value & (1 << Bit)); ++Bit){}
|
||||
return Bit;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER detail::tvec2<int, P> findLSB
|
||||
(
|
||||
detail::tvec2<T, P> const & value
|
||||
)
|
||||
{
|
||||
return detail::tvec2<int, P>(
|
||||
findLSB(value[0]),
|
||||
findLSB(value[1]));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER detail::tvec3<int, P> findLSB
|
||||
(
|
||||
detail::tvec3<T, P> const & value
|
||||
)
|
||||
{
|
||||
return detail::tvec3<int, P>(
|
||||
findLSB(value[0]),
|
||||
findLSB(value[1]),
|
||||
findLSB(value[2]));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER detail::tvec4<int, P> findLSB
|
||||
(
|
||||
detail::tvec4<T, P> const & value
|
||||
)
|
||||
{
|
||||
return detail::tvec4<int, P>(
|
||||
findLSB(value[0]),
|
||||
findLSB(value[1]),
|
||||
findLSB(value[2]),
|
||||
findLSB(value[3]));
|
||||
}
|
||||
|
||||
// findMSB
|
||||
#if((GLM_ARCH != GLM_ARCH_PURE) && (GLM_COMPILER & GLM_COMPILER_VC))
|
||||
|
||||
template <typename genIUType>
|
||||
GLM_FUNC_QUALIFIER int findMSB
|
||||
(
|
||||
genIUType const & Value
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'findMSB' only accept integer values");
|
||||
if(Value == 0)
|
||||
return -1;
|
||||
|
||||
unsigned long Result(0);
|
||||
_BitScanReverse(&Result, Value);
|
||||
return int(Result);
|
||||
}
|
||||
/*
|
||||
// __builtin_clz seems to be buggy as it crasks for some values, from 0x00200000 to 80000000
|
||||
#elif((GLM_ARCH != GLM_ARCH_PURE) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC40))
|
||||
|
||||
template <typename genIUType>
|
||||
GLM_FUNC_QUALIFIER int findMSB
|
||||
(
|
||||
genIUType const & Value
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'findMSB' only accept integer values");
|
||||
if(Value == 0)
|
||||
return -1;
|
||||
|
||||
// clz returns the number or trailing 0-bits; see
|
||||
// http://gcc.gnu.org/onlinedocs/gcc-4.7.1/gcc/Other-Builtins.html
|
||||
//
|
||||
// NoteBecause __builtin_clz only works for unsigned ints, this
|
||||
// implementation will not work for 64-bit integers.
|
||||
//
|
||||
return 31 - __builtin_clzl(Value);
|
||||
}
|
||||
*/
|
||||
#else
|
||||
|
||||
/* SSE implementation idea
|
||||
|
||||
__m128i const Zero = _mm_set_epi32( 0, 0, 0, 0);
|
||||
__m128i const One = _mm_set_epi32( 1, 1, 1, 1);
|
||||
__m128i Bit = _mm_set_epi32(-1, -1, -1, -1);
|
||||
__m128i Tmp = _mm_set_epi32(Value, Value, Value, Value);
|
||||
__m128i Mmi = Zero;
|
||||
for(int i = 0; i < 32; ++i)
|
||||
{
|
||||
__m128i Shilt = _mm_and_si128(_mm_cmpgt_epi32(Tmp, One), One);
|
||||
Tmp = _mm_srai_epi32(Tmp, One);
|
||||
Bit = _mm_add_epi32(Bit, _mm_and_si128(Shilt, i));
|
||||
Mmi = _mm_and_si128(Mmi, One);
|
||||
}
|
||||
return Bit;
|
||||
|
||||
*/
|
||||
|
||||
template <typename genIUType>
|
||||
GLM_FUNC_QUALIFIER int findMSB
|
||||
(
|
||||
genIUType const & Value
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'findMSB' only accept integer values");
|
||||
|
||||
if(Value == genIUType(0) || Value == genIUType(-1))
|
||||
return -1;
|
||||
else if(Value > 0)
|
||||
{
|
||||
genIUType Bit = genIUType(-1);
|
||||
for(genIUType tmp = Value; tmp > 0; tmp >>= 1, ++Bit){}
|
||||
return Bit;
|
||||
}
|
||||
else //if(Value < 0)
|
||||
{
|
||||
int const BitCount(sizeof(genIUType) * 8);
|
||||
int MostSignificantBit(-1);
|
||||
for(int BitIndex(0); BitIndex < BitCount; ++BitIndex)
|
||||
MostSignificantBit = (Value & (1 << BitIndex)) ? MostSignificantBit : BitIndex;
|
||||
assert(MostSignificantBit >= 0);
|
||||
return MostSignificantBit;
|
||||
}
|
||||
}
|
||||
#endif//(GLM_COMPILER)
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER detail::tvec2<int, P> findMSB
|
||||
(
|
||||
detail::tvec2<T, P> const & value
|
||||
)
|
||||
{
|
||||
return detail::tvec2<int, P>(
|
||||
findMSB(value[0]),
|
||||
findMSB(value[1]));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER detail::tvec3<int, P> findMSB
|
||||
(
|
||||
detail::tvec3<T, P> const & value
|
||||
)
|
||||
{
|
||||
return detail::tvec3<int, P>(
|
||||
findMSB(value[0]),
|
||||
findMSB(value[1]),
|
||||
findMSB(value[2]));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER detail::tvec4<int, P> findMSB
|
||||
(
|
||||
detail::tvec4<T, P> const & value
|
||||
)
|
||||
{
|
||||
return detail::tvec4<int, P>(
|
||||
findMSB(value[0]),
|
||||
findMSB(value[1]),
|
||||
findMSB(value[2]),
|
||||
findMSB(value[3]));
|
||||
}
|
||||
}//namespace glm
|
||||
@@ -0,0 +1,179 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/func_matrix.hpp
|
||||
/// @date 2008-08-03 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
|
||||
///
|
||||
/// @defgroup core_func_matrix Matrix functions
|
||||
/// @ingroup core
|
||||
///
|
||||
/// For each of the following built-in matrix functions, there is both a
|
||||
/// single-precision floating point version, where all arguments and return values
|
||||
/// are single precision, and a double-precision floating version, where all
|
||||
/// arguments and return values are double precision. Only the single-precision
|
||||
/// floating point version is shown.
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef GLM_CORE_func_matrix
|
||||
#define GLM_CORE_func_matrix
|
||||
|
||||
// Dependencies
|
||||
#include "../detail/precision.hpp"
|
||||
#include "../detail/setup.hpp"
|
||||
#include "../detail/type_mat.hpp"
|
||||
#include "../vec2.hpp"
|
||||
#include "../vec3.hpp"
|
||||
#include "../vec4.hpp"
|
||||
#include "../mat2x2.hpp"
|
||||
#include "../mat2x3.hpp"
|
||||
#include "../mat2x4.hpp"
|
||||
#include "../mat3x2.hpp"
|
||||
#include "../mat3x3.hpp"
|
||||
#include "../mat3x4.hpp"
|
||||
#include "../mat4x2.hpp"
|
||||
#include "../mat4x3.hpp"
|
||||
#include "../mat4x4.hpp"
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
template <typename T, precision P>
|
||||
struct outerProduct_trait<T, P, tvec2, tvec2>
|
||||
{
|
||||
typedef tmat2x2<T, P> type;
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct outerProduct_trait<T, P, tvec2, tvec3>
|
||||
{
|
||||
typedef tmat2x3<T, P> type;
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct outerProduct_trait<T, P, tvec2, tvec4>
|
||||
{
|
||||
typedef tmat2x4<T, P> type;
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct outerProduct_trait<T, P, tvec3, tvec2>
|
||||
{
|
||||
typedef tmat3x2<T, P> type;
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct outerProduct_trait<T, P, tvec3, tvec3>
|
||||
{
|
||||
typedef tmat3x3<T, P> type;
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct outerProduct_trait<T, P, tvec3, tvec4>
|
||||
{
|
||||
typedef tmat3x4<T, P> type;
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct outerProduct_trait<T, P, tvec4, tvec2>
|
||||
{
|
||||
typedef tmat4x2<T, P> type;
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct outerProduct_trait<T, P, tvec4, tvec3>
|
||||
{
|
||||
typedef tmat4x3<T, P> type;
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct outerProduct_trait<T, P, tvec4, tvec4>
|
||||
{
|
||||
typedef tmat4x4<T, P> type;
|
||||
};
|
||||
|
||||
}//namespace detail
|
||||
|
||||
/// @addtogroup core_func_matrix
|
||||
/// @{
|
||||
|
||||
/// Multiply matrix x by matrix y component-wise, i.e.,
|
||||
/// result[i][j] is the scalar product of x[i][j] and y[i][j].
|
||||
///
|
||||
/// @tparam matType Floating-point matrix types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/matrixCompMult.xml">GLSL matrixCompMult man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
|
||||
template <typename T, precision P, template <typename, precision> class matType>
|
||||
GLM_FUNC_DECL matType<T, P> matrixCompMult(matType<T, P> const & x, matType<T, P> const & y);
|
||||
|
||||
/// Treats the first parameter c as a column vector
|
||||
/// and the second parameter r as a row vector
|
||||
/// and does a linear algebraic matrix multiply c * r.
|
||||
///
|
||||
/// @tparam matType Floating-point matrix types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/outerProduct.xml">GLSL outerProduct man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
|
||||
///
|
||||
/// @todo Clarify the declaration to specify that matType doesn't have to be provided when used.
|
||||
template <typename T, precision P, template <typename, precision> class vecTypeA, template <typename, precision> class vecTypeB>
|
||||
GLM_FUNC_DECL typename detail::outerProduct_trait<T, P, vecTypeA, vecTypeB>::type outerProduct(vecTypeA<T, P> const & c, vecTypeB<T, P> const & r);
|
||||
|
||||
/// Returns the transposed matrix of x
|
||||
///
|
||||
/// @tparam matType Floating-point matrix types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/transpose.xml">GLSL transpose man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
|
||||
# if((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC11))
|
||||
template <typename T, precision P, template <typename, precision> class matType>
|
||||
GLM_FUNC_DECL typename matType<T, P>::transpose_type transpose(matType<T, P> const & x);
|
||||
# endif
|
||||
|
||||
/// Return the determinant of a squared matrix.
|
||||
///
|
||||
/// @tparam valType Floating-point scalar types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/determinant.xml">GLSL determinant man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
|
||||
template <typename T, precision P, template <typename, precision> class matType>
|
||||
GLM_FUNC_DECL T determinant(matType<T, P> const & m);
|
||||
|
||||
/// Return the inverse of a squared matrix.
|
||||
///
|
||||
/// @tparam valType Floating-point scalar types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inverse.xml">GLSL inverse man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
|
||||
template <typename T, precision P, template <typename, precision> class matType>
|
||||
GLM_FUNC_DECL matType<T, P> inverse(matType<T, P> const & m);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
||||
#include "func_matrix.inl"
|
||||
|
||||
#endif//GLM_CORE_func_matrix
|
||||
@@ -0,0 +1,460 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/func_matrix.inl
|
||||
/// @date 2008-03-08 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "../geometric.hpp"
|
||||
#include <limits>
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
template
|
||||
<
|
||||
template <class, precision> class vecTypeA,
|
||||
template <class, precision> class vecTypeB,
|
||||
typename T, precision P
|
||||
>
|
||||
struct compute_outerProduct{};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_outerProduct<detail::tvec2, detail::tvec2, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait<T, P, detail::tvec2, detail::tvec2>::type call(detail::tvec2<T, P> const & c, detail::tvec2<T, P> const & r)
|
||||
{
|
||||
detail::tmat2x2<T, P> m(detail::tmat2x2<T, P>::_null);
|
||||
m[0][0] = c[0] * r[0];
|
||||
m[0][1] = c[1] * r[0];
|
||||
m[1][0] = c[0] * r[1];
|
||||
m[1][1] = c[1] * r[1];
|
||||
return m;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_outerProduct<detail::tvec3, detail::tvec3, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait<T, P, detail::tvec3, detail::tvec3>::type call(detail::tvec3<T, P> const & c, detail::tvec3<T, P> const & r)
|
||||
{
|
||||
detail::tmat3x3<T, P> m(detail::tmat3x3<T, P>::_null);
|
||||
for(length_t i(0); i < m.length(); ++i)
|
||||
m[i] = c * r[i];
|
||||
return m;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_outerProduct<detail::tvec4, detail::tvec4, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait<T, P, detail::tvec4, detail::tvec4>::type call(detail::tvec4<T, P> const & c, detail::tvec4<T, P> const & r)
|
||||
{
|
||||
detail::tmat4x4<T, P> m(detail::tmat4x4<T, P>::_null);
|
||||
for(length_t i(0); i < m.length(); ++i)
|
||||
m[i] = c * r[i];
|
||||
return m;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_outerProduct<detail::tvec3, detail::tvec2, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait<T, P, detail::tvec3, detail::tvec2>::type call(detail::tvec3<T, P> const & c, detail::tvec2<T, P> const & r)
|
||||
{
|
||||
detail::tmat2x3<T, P> m(detail::tmat2x3<T, P>::_null);
|
||||
m[0][0] = c.x * r.x;
|
||||
m[0][1] = c.y * r.x;
|
||||
m[0][2] = c.z * r.x;
|
||||
m[1][0] = c.x * r.y;
|
||||
m[1][1] = c.y * r.y;
|
||||
m[1][2] = c.z * r.y;
|
||||
return m;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_outerProduct<detail::tvec2, detail::tvec3, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait<T, P, detail::tvec2, detail::tvec3>::type call(detail::tvec2<T, P> const & c, detail::tvec3<T, P> const & r)
|
||||
{
|
||||
detail::tmat3x2<T, P> m(detail::tmat3x2<T, P>::_null);
|
||||
m[0][0] = c.x * r.x;
|
||||
m[0][1] = c.y * r.x;
|
||||
m[1][0] = c.x * r.y;
|
||||
m[1][1] = c.y * r.y;
|
||||
m[2][0] = c.x * r.z;
|
||||
m[2][1] = c.y * r.z;
|
||||
return m;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_outerProduct<detail::tvec4, detail::tvec2, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait<T, P, detail::tvec4, detail::tvec2>::type call(detail::tvec4<T, P> const & c, detail::tvec2<T, P> const & r)
|
||||
{
|
||||
detail::tmat2x4<T, P> m(detail::tmat2x4<T, P>::_null);
|
||||
m[0][0] = c.x * r.x;
|
||||
m[0][1] = c.y * r.x;
|
||||
m[0][2] = c.z * r.x;
|
||||
m[0][3] = c.w * r.x;
|
||||
m[1][0] = c.x * r.y;
|
||||
m[1][1] = c.y * r.y;
|
||||
m[1][2] = c.z * r.y;
|
||||
m[1][3] = c.w * r.y;
|
||||
return m;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_outerProduct<detail::tvec2, detail::tvec4, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait<T, P, detail::tvec2, detail::tvec4>::type call(detail::tvec2<T, P> const & c, detail::tvec4<T, P> const & r)
|
||||
{
|
||||
detail::tmat4x2<T, P> m(detail::tmat4x2<T, P>::_null);
|
||||
m[0][0] = c.x * r.x;
|
||||
m[0][1] = c.y * r.x;
|
||||
m[1][0] = c.x * r.y;
|
||||
m[1][1] = c.y * r.y;
|
||||
m[2][0] = c.x * r.z;
|
||||
m[2][1] = c.y * r.z;
|
||||
m[3][0] = c.x * r.w;
|
||||
m[3][1] = c.y * r.w;
|
||||
return m;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_outerProduct<detail::tvec4, detail::tvec3, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait<T, P, detail::tvec4, detail::tvec3>::type call(detail::tvec4<T, P> const & c, detail::tvec3<T, P> const & r)
|
||||
{
|
||||
detail::tmat3x4<T, P> m(detail::tmat3x4<T, P>::_null);
|
||||
m[0][0] = c.x * r.x;
|
||||
m[0][1] = c.y * r.x;
|
||||
m[0][2] = c.z * r.x;
|
||||
m[0][3] = c.w * r.x;
|
||||
m[1][0] = c.x * r.y;
|
||||
m[1][1] = c.y * r.y;
|
||||
m[1][2] = c.z * r.y;
|
||||
m[1][3] = c.w * r.y;
|
||||
m[2][0] = c.x * r.z;
|
||||
m[2][1] = c.y * r.z;
|
||||
m[2][2] = c.z * r.z;
|
||||
m[2][3] = c.w * r.z;
|
||||
return m;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_outerProduct<detail::tvec3, detail::tvec4, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait<T, P, detail::tvec3, detail::tvec4>::type call(detail::tvec3<T, P> const & c, detail::tvec4<T, P> const & r)
|
||||
{
|
||||
detail::tmat4x3<T, P> m(detail::tmat4x3<T, P>::_null);
|
||||
m[0][0] = c.x * r.x;
|
||||
m[0][1] = c.y * r.x;
|
||||
m[0][2] = c.z * r.x;
|
||||
m[1][0] = c.x * r.y;
|
||||
m[1][1] = c.y * r.y;
|
||||
m[1][2] = c.z * r.y;
|
||||
m[2][0] = c.x * r.z;
|
||||
m[2][1] = c.y * r.z;
|
||||
m[2][2] = c.z * r.z;
|
||||
m[3][0] = c.x * r.w;
|
||||
m[3][1] = c.y * r.w;
|
||||
m[3][2] = c.z * r.w;
|
||||
return m;
|
||||
}
|
||||
};
|
||||
|
||||
template <template <class, precision> class matType, typename T, precision P>
|
||||
struct compute_transpose{};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_transpose<detail::tmat2x2, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static detail::tmat2x2<T, P> call(detail::tmat2x2<T, P> const & m)
|
||||
{
|
||||
detail::tmat2x2<T, P> result(detail::tmat2x2<T, P>::_null);
|
||||
result[0][0] = m[0][0];
|
||||
result[0][1] = m[1][0];
|
||||
result[1][0] = m[0][1];
|
||||
result[1][1] = m[1][1];
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_transpose<detail::tmat2x3, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static detail::tmat3x2<T, P> call(detail::tmat2x3<T, P> const & m)
|
||||
{
|
||||
detail::tmat3x2<T, P> result(detail::tmat3x2<T, P>::_null);
|
||||
result[0][0] = m[0][0];
|
||||
result[0][1] = m[1][0];
|
||||
result[1][0] = m[0][1];
|
||||
result[1][1] = m[1][1];
|
||||
result[2][0] = m[0][2];
|
||||
result[2][1] = m[1][2];
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_transpose<detail::tmat2x4, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static detail::tmat4x2<T, P> call(detail::tmat2x4<T, P> const & m)
|
||||
{
|
||||
detail::tmat4x2<T, P> result(detail::tmat4x2<T, P>::_null);
|
||||
result[0][0] = m[0][0];
|
||||
result[0][1] = m[1][0];
|
||||
result[1][0] = m[0][1];
|
||||
result[1][1] = m[1][1];
|
||||
result[2][0] = m[0][2];
|
||||
result[2][1] = m[1][2];
|
||||
result[3][0] = m[0][3];
|
||||
result[3][1] = m[1][3];
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_transpose<detail::tmat3x2, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static detail::tmat2x3<T, P> call(detail::tmat3x2<T, P> const & m)
|
||||
{
|
||||
detail::tmat2x3<T, P> result(detail::tmat2x3<T, P>::_null);
|
||||
result[0][0] = m[0][0];
|
||||
result[0][1] = m[1][0];
|
||||
result[0][2] = m[2][0];
|
||||
result[1][0] = m[0][1];
|
||||
result[1][1] = m[1][1];
|
||||
result[1][2] = m[2][1];
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_transpose<detail::tmat3x3, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static detail::tmat3x3<T, P> call(detail::tmat3x3<T, P> const & m)
|
||||
{
|
||||
detail::tmat3x3<T, P> result(detail::tmat3x3<T, P>::_null);
|
||||
result[0][0] = m[0][0];
|
||||
result[0][1] = m[1][0];
|
||||
result[0][2] = m[2][0];
|
||||
|
||||
result[1][0] = m[0][1];
|
||||
result[1][1] = m[1][1];
|
||||
result[1][2] = m[2][1];
|
||||
|
||||
result[2][0] = m[0][2];
|
||||
result[2][1] = m[1][2];
|
||||
result[2][2] = m[2][2];
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_transpose<detail::tmat3x4, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static detail::tmat4x3<T, P> call(detail::tmat3x4<T, P> const & m)
|
||||
{
|
||||
detail::tmat4x3<T, P> result(detail::tmat4x3<T, P>::_null);
|
||||
result[0][0] = m[0][0];
|
||||
result[0][1] = m[1][0];
|
||||
result[0][2] = m[2][0];
|
||||
result[1][0] = m[0][1];
|
||||
result[1][1] = m[1][1];
|
||||
result[1][2] = m[2][1];
|
||||
result[2][0] = m[0][2];
|
||||
result[2][1] = m[1][2];
|
||||
result[2][2] = m[2][2];
|
||||
result[3][0] = m[0][3];
|
||||
result[3][1] = m[1][3];
|
||||
result[3][2] = m[2][3];
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_transpose<detail::tmat4x2, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static detail::tmat2x4<T, P> call(detail::tmat4x2<T, P> const & m)
|
||||
{
|
||||
detail::tmat2x4<T, P> result(detail::tmat2x4<T, P>::_null);
|
||||
result[0][0] = m[0][0];
|
||||
result[0][1] = m[1][0];
|
||||
result[0][2] = m[2][0];
|
||||
result[0][3] = m[3][0];
|
||||
result[1][0] = m[0][1];
|
||||
result[1][1] = m[1][1];
|
||||
result[1][2] = m[2][1];
|
||||
result[1][3] = m[3][1];
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_transpose<detail::tmat4x3, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static detail::tmat3x4<T, P> call(detail::tmat4x3<T, P> const & m)
|
||||
{
|
||||
detail::tmat3x4<T, P> result(detail::tmat3x4<T, P>::_null);
|
||||
result[0][0] = m[0][0];
|
||||
result[0][1] = m[1][0];
|
||||
result[0][2] = m[2][0];
|
||||
result[0][3] = m[3][0];
|
||||
result[1][0] = m[0][1];
|
||||
result[1][1] = m[1][1];
|
||||
result[1][2] = m[2][1];
|
||||
result[1][3] = m[3][1];
|
||||
result[2][0] = m[0][2];
|
||||
result[2][1] = m[1][2];
|
||||
result[2][2] = m[2][2];
|
||||
result[2][3] = m[3][2];
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_transpose<detail::tmat4x4, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static detail::tmat4x4<T, P> call(detail::tmat4x4<T, P> const & m)
|
||||
{
|
||||
detail::tmat4x4<T, P> result(detail::tmat4x4<T, P>::_null);
|
||||
result[0][0] = m[0][0];
|
||||
result[0][1] = m[1][0];
|
||||
result[0][2] = m[2][0];
|
||||
result[0][3] = m[3][0];
|
||||
|
||||
result[1][0] = m[0][1];
|
||||
result[1][1] = m[1][1];
|
||||
result[1][2] = m[2][1];
|
||||
result[1][3] = m[3][1];
|
||||
|
||||
result[2][0] = m[0][2];
|
||||
result[2][1] = m[1][2];
|
||||
result[2][2] = m[2][2];
|
||||
result[2][3] = m[3][2];
|
||||
|
||||
result[3][0] = m[0][3];
|
||||
result[3][1] = m[1][3];
|
||||
result[3][2] = m[2][3];
|
||||
result[3][3] = m[3][3];
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <template <class, precision> class matType, typename T, precision P>
|
||||
struct compute_determinant{};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_determinant<detail::tmat2x2, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static T call(detail::tmat2x2<T, P> const & m)
|
||||
{
|
||||
return m[0][0] * m[1][1] - m[1][0] * m[0][1];
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_determinant<detail::tmat3x3, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static T call(detail::tmat3x3<T, P> const & m)
|
||||
{
|
||||
return
|
||||
+ m[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2])
|
||||
- m[1][0] * (m[0][1] * m[2][2] - m[2][1] * m[0][2])
|
||||
+ m[2][0] * (m[0][1] * m[1][2] - m[1][1] * m[0][2]);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_determinant<detail::tmat4x4, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static T call(detail::tmat4x4<T, P> const & m)
|
||||
{
|
||||
T SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3];
|
||||
T SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3];
|
||||
T SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2];
|
||||
T SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3];
|
||||
T SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2];
|
||||
T SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1];
|
||||
|
||||
detail::tvec4<T, P> DetCof(
|
||||
+ (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02),
|
||||
- (m[1][0] * SubFactor00 - m[1][2] * SubFactor03 + m[1][3] * SubFactor04),
|
||||
+ (m[1][0] * SubFactor01 - m[1][1] * SubFactor03 + m[1][3] * SubFactor05),
|
||||
- (m[1][0] * SubFactor02 - m[1][1] * SubFactor04 + m[1][2] * SubFactor05));
|
||||
|
||||
return
|
||||
m[0][0] * DetCof[0] + m[0][1] * DetCof[1] +
|
||||
m[0][2] * DetCof[2] + m[0][3] * DetCof[3];
|
||||
}
|
||||
};
|
||||
}//namespace detail
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class matType>
|
||||
GLM_FUNC_QUALIFIER matType<T, P> matrixCompMult(matType<T, P> const & x, matType<T, P> const & y)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'matrixCompMult' only accept floating-point inputs");
|
||||
|
||||
matType<T, P> result(matType<T, P>::_null);
|
||||
for(length_t i = 0; i < result.length(); ++i)
|
||||
result[i] = x[i] * y[i];
|
||||
return result;
|
||||
}
|
||||
|
||||
template<typename T, precision P, template <typename, precision> class vecTypeA, template <typename, precision> class vecTypeB>
|
||||
GLM_FUNC_QUALIFIER typename detail::outerProduct_trait<T, P, vecTypeA, vecTypeB>::type outerProduct(vecTypeA<T, P> const & c, vecTypeB<T, P> const & r)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'outerProduct' only accept floating-point inputs");
|
||||
return detail::compute_outerProduct<vecTypeA, vecTypeB, T, P>::call(c, r);
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class matType>
|
||||
GLM_FUNC_QUALIFIER typename matType<T, P>::transpose_type transpose(matType<T, P> const & m)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'transpose' only accept floating-point inputs");
|
||||
return detail::compute_transpose<matType, T, P>::call(m);
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class matType>
|
||||
GLM_FUNC_QUALIFIER T determinant(matType<T, P> const & m)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'determinant' only accept floating-point inputs");
|
||||
return detail::compute_determinant<matType, T, P>::call(m);
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class matType>
|
||||
GLM_FUNC_QUALIFIER matType<T, P> inverse(matType<T, P> const & m)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'inverse' only accept floating-point inputs");
|
||||
return detail::compute_inverse<matType, T, P>::call(m);
|
||||
}
|
||||
|
||||
}//namespace glm
|
||||
@@ -0,0 +1,92 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/func_noise.hpp
|
||||
/// @date 2008-08-01 / 2011-06-18
|
||||
/// @author Christophe Riccio
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a>
|
||||
///
|
||||
/// @defgroup core_func_noise Noise functions
|
||||
/// @ingroup core
|
||||
///
|
||||
/// Noise functions are stochastic functions that can be used to increase visual
|
||||
/// complexity. Values returned by the following noise functions give the
|
||||
/// appearance of randomness, but are not truly random.
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef glm_core_func_noise
|
||||
#define glm_core_func_noise
|
||||
|
||||
#include "type_vec1.hpp"
|
||||
#include "type_vec2.hpp"
|
||||
#include "type_vec3.hpp"
|
||||
#include "setup.hpp"
|
||||
|
||||
namespace glm
|
||||
{
|
||||
/// @addtogroup core_func_noise
|
||||
/// @{
|
||||
|
||||
/// Returns a 1D noise value based on the input value x.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise1.xml">GLSL noise1 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL typename genType::value_type noise1(genType const & x);
|
||||
|
||||
/// Returns a 2D noise value based on the input value x.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise2.xml">GLSL noise2 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL detail::tvec2<typename genType::value_type, defaultp> noise2(genType const & x);
|
||||
|
||||
/// Returns a 3D noise value based on the input value x.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise3.xml">GLSL noise3 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL detail::tvec3<typename genType::value_type, defaultp> noise3(genType const & x);
|
||||
|
||||
/// Returns a 4D noise value based on the input value x.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise4.xml">GLSL noise4 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL detail::tvec4<typename genType::value_type, defaultp> noise4(genType const & x);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
||||
#include "func_noise.inl"
|
||||
|
||||
#endif//glm_core_func_noise
|
||||
@@ -0,0 +1,384 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/func_noise.inl
|
||||
/// @date 2008-08-01 / 2011-09-27
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "../detail/_noise.hpp"
|
||||
#include "./func_common.hpp"
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER detail::tvec4<T, P> grad4(T const & j, detail::tvec4<T, P> const & ip)
|
||||
{
|
||||
detail::tvec3<T, P> pXYZ = floor(fract(detail::tvec3<T, P>(j) * detail::tvec3<T, P>(ip)) * T(7)) * ip[2] - T(1);
|
||||
T pW = static_cast<T>(1.5) - dot(abs(pXYZ), detail::tvec3<T, P>(1));
|
||||
detail::tvec4<T, P> s = detail::tvec4<T, P>(lessThan(detail::tvec4<T, P>(pXYZ, pW), detail::tvec4<T, P>(0.0)));
|
||||
pXYZ = pXYZ + (detail::tvec3<T, P>(s) * T(2) - T(1)) * s.w;
|
||||
return detail::tvec4<T, P>(pXYZ, pW);
|
||||
}
|
||||
}//namespace detail
|
||||
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER T noise1(T const & x)
|
||||
{
|
||||
return noise1(detail::tvec2<T, defaultp>(x, T(0)));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER detail::tvec2<T, defaultp> noise2(T const & x)
|
||||
{
|
||||
return detail::tvec2<T, defaultp>(
|
||||
noise1(x + T(0.0)),
|
||||
noise1(x + T(1.0)));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER detail::tvec3<T, defaultp> noise3(T const & x)
|
||||
{
|
||||
return detail::tvec3<T, defaultp>(
|
||||
noise1(x - T(1.0)),
|
||||
noise1(x + T(0.0)),
|
||||
noise1(x + T(1.0)));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER detail::tvec4<T, defaultp> noise4(T const & x)
|
||||
{
|
||||
return detail::tvec4<T, defaultp>(
|
||||
noise1(x - T(1.0)),
|
||||
noise1(x + T(0.0)),
|
||||
noise1(x + T(1.0)),
|
||||
noise1(x + T(2.0)));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER T noise1(detail::tvec2<T, P> const & v)
|
||||
{
|
||||
detail::tvec4<T, P> const C = detail::tvec4<T, P>(
|
||||
T( 0.211324865405187), // (3.0 - sqrt(3.0)) / 6.0
|
||||
T( 0.366025403784439), // 0.5 * (sqrt(3.0) - 1.0)
|
||||
T(-0.577350269189626), // -1.0 + 2.0 * C.x
|
||||
T( 0.024390243902439)); // 1.0 / 41.0
|
||||
|
||||
// First corner
|
||||
detail::tvec2<T, P> i = floor(v + dot(v, detail::tvec2<T, P>(C[1])));
|
||||
detail::tvec2<T, P> x0 = v - i + dot(i, detail::tvec2<T, P>(C[0]));
|
||||
|
||||
// Other corners
|
||||
//i1.x = step( x0.y, x0.x ); // x0.x > x0.y ? 1.0 : 0.0
|
||||
//i1.y = 1.0 - i1.x;
|
||||
detail::tvec2<T, P> i1 = (x0.x > x0.y) ? detail::tvec2<T, P>(1, 0) : detail::tvec2<T, P>(0, 1);
|
||||
|
||||
// x0 = x0 - 0.0 + 0.0 * C.xx ;
|
||||
// x1 = x0 - i1 + 1.0 * C.xx ;
|
||||
// x2 = x0 - 1.0 + 2.0 * C.xx ;
|
||||
detail::tvec4<T, P> x12 = detail::tvec4<T, P>(x0.x, x0.y, x0.x, x0.y) + detail::tvec4<T, P>(C.x, C.x, C.z, C.z);
|
||||
x12 = detail::tvec4<T, P>(detail::tvec2<T, P>(x12) - i1, x12.z, x12.w);
|
||||
|
||||
// Permutations
|
||||
i = mod(i, T(289)); // Avoid truncation effects in permutation
|
||||
detail::tvec3<T, P> p = detail::permute(
|
||||
detail::permute(i.y + detail::tvec3<T, P>(T(0), i1.y, T(1))) + i.x + detail::tvec3<T, P>(T(0), i1.x, T(1)));
|
||||
|
||||
detail::tvec3<T, P> m = max(T(0.5) - detail::tvec3<T, P>(
|
||||
dot(x0, x0),
|
||||
dot(detail::tvec2<T, P>(x12.x, x12.y), detail::tvec2<T, P>(x12.x, x12.y)),
|
||||
dot(detail::tvec2<T, P>(x12.z, x12.w), detail::tvec2<T, P>(x12.z, x12.w))), T(0));
|
||||
|
||||
m = m * m;
|
||||
m = m * m;
|
||||
|
||||
// Gradients: 41 points uniformly over a line, mapped onto a diamond.
|
||||
// The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287)
|
||||
|
||||
detail::tvec3<T, P> x = static_cast<T>(2) * fract(p * C.w) - T(1);
|
||||
detail::tvec3<T, P> h = abs(x) - T(0.5);
|
||||
detail::tvec3<T, P> ox = floor(x + T(0.5));
|
||||
detail::tvec3<T, P> a0 = x - ox;
|
||||
|
||||
// Normalise gradients implicitly by scaling m
|
||||
// Inlined for speed: m *= taylorInvSqrt( a0*a0 + h*h );
|
||||
m *= static_cast<T>(1.79284291400159) - T(0.85373472095314) * (a0 * a0 + h * h);
|
||||
|
||||
// Compute final noise value at P
|
||||
detail::tvec3<T, P> g;
|
||||
g.x = a0.x * x0.x + h.x * x0.y;
|
||||
//g.yz = a0.yz * x12.xz + h.yz * x12.yw;
|
||||
g.y = a0.y * x12.x + h.y * x12.y;
|
||||
g.z = a0.z * x12.z + h.z * x12.w;
|
||||
return T(130) * dot(m, g);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER T noise1(detail::tvec3<T, P> const & v)
|
||||
{
|
||||
detail::tvec2<T, P> const C(1.0 / 6.0, 1.0 / 3.0);
|
||||
detail::tvec4<T, P> const D(0.0, 0.5, 1.0, 2.0);
|
||||
|
||||
// First corner
|
||||
detail::tvec3<T, P> i(floor(v + dot(v, detail::tvec3<T, P>(C.y))));
|
||||
detail::tvec3<T, P> x0(v - i + dot(i, detail::tvec3<T, P>(C.x)));
|
||||
|
||||
// Other corners
|
||||
detail::tvec3<T, P> g(step(detail::tvec3<T, P>(x0.y, x0.z, x0.x), x0));
|
||||
detail::tvec3<T, P> l(T(1) - g);
|
||||
detail::tvec3<T, P> i1(min(g, detail::tvec3<T, P>(l.z, l.x, l.y)));
|
||||
detail::tvec3<T, P> i2(max(g, detail::tvec3<T, P>(l.z, l.x, l.y)));
|
||||
|
||||
// x0 = x0 - 0.0 + 0.0 * C.xxx;
|
||||
// x1 = x0 - i1 + 1.0 * C.xxx;
|
||||
// x2 = x0 - i2 + 2.0 * C.xxx;
|
||||
// x3 = x0 - 1.0 + 3.0 * C.xxx;
|
||||
detail::tvec3<T, P> x1(x0 - i1 + C.x);
|
||||
detail::tvec3<T, P> x2(x0 - i2 + C.y); // 2.0*C.x = 1/3 = C.y
|
||||
detail::tvec3<T, P> x3(x0 - D.y); // -1.0+3.0*C.x = -0.5 = -D.y
|
||||
|
||||
// Permutations
|
||||
i = mod289(i);
|
||||
detail::tvec4<T, P> p(detail::permute(detail::permute(detail::permute(
|
||||
i.z + detail::tvec4<T, P>(T(0), i1.z, i2.z, T(1))) +
|
||||
i.y + detail::tvec4<T, P>(T(0), i1.y, i2.y, T(1))) +
|
||||
i.x + detail::tvec4<T, P>(T(0), i1.x, i2.x, T(1))));
|
||||
|
||||
// Gradients: 7x7 points over a square, mapped onto an octahedron.
|
||||
// The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)
|
||||
T n_ = static_cast<T>(0.142857142857); // 1.0/7.0
|
||||
detail::tvec3<T, P> ns(n_ * detail::tvec3<T, P>(D.w, D.y, D.z) - detail::tvec3<T, P>(D.x, D.z, D.x));
|
||||
|
||||
detail::tvec4<T, P> j(p - T(49) * floor(p * ns.z * ns.z)); // mod(p,7*7)
|
||||
|
||||
detail::tvec4<T, P> x_(floor(j * ns.z));
|
||||
detail::tvec4<T, P> y_(floor(j - T(7) * x_)); // mod(j,N)
|
||||
|
||||
detail::tvec4<T, P> x(x_ * ns.x + ns.y);
|
||||
detail::tvec4<T, P> y(y_ * ns.x + ns.y);
|
||||
detail::tvec4<T, P> h(T(1) - abs(x) - abs(y));
|
||||
|
||||
detail::tvec4<T, P> b0(x.x, x.y, y.x, y.y);
|
||||
detail::tvec4<T, P> b1(x.z, x.w, y.z, y.w);
|
||||
|
||||
// vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;
|
||||
// vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;
|
||||
detail::tvec4<T, P> s0(floor(b0) * T(2) + T(1));
|
||||
detail::tvec4<T, P> s1(floor(b1) * T(2) + T(1));
|
||||
detail::tvec4<T, P> sh(-step(h, detail::tvec4<T, P>(0.0)));
|
||||
|
||||
detail::tvec4<T, P> a0 = detail::tvec4<T, P>(b0.x, b0.z, b0.y, b0.w) + detail::tvec4<T, P>(s0.x, s0.z, s0.y, s0.w) * detail::tvec4<T, P>(sh.x, sh.x, sh.y, sh.y);
|
||||
detail::tvec4<T, P> a1 = detail::tvec4<T, P>(b1.x, b1.z, b1.y, b1.w) + detail::tvec4<T, P>(s1.x, s1.z, s1.y, s1.w) * detail::tvec4<T, P>(sh.z, sh.z, sh.w, sh.w);
|
||||
|
||||
detail::tvec3<T, P> p0(a0.x, a0.y, h.x);
|
||||
detail::tvec3<T, P> p1(a0.z, a0.w, h.y);
|
||||
detail::tvec3<T, P> p2(a1.x, a1.y, h.z);
|
||||
detail::tvec3<T, P> p3(a1.z, a1.w, h.w);
|
||||
|
||||
// Normalise gradients
|
||||
detail::tvec4<T, P> norm = taylorInvSqrt(detail::tvec4<T, P>(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));
|
||||
p0 *= norm.x;
|
||||
p1 *= norm.y;
|
||||
p2 *= norm.z;
|
||||
p3 *= norm.w;
|
||||
|
||||
// Mix final noise value
|
||||
detail::tvec4<T, P> m = max(T(0.6) - detail::tvec4<T, P>(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), T(0));
|
||||
m = m * m;
|
||||
return T(42) * dot(m * m, detail::tvec4<T, P>(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3)));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER T noise1(detail::tvec4<T, P> const & v)
|
||||
{
|
||||
detail::tvec4<T, P> const C(
|
||||
0.138196601125011, // (5 - sqrt(5))/20 G4
|
||||
0.276393202250021, // 2 * G4
|
||||
0.414589803375032, // 3 * G4
|
||||
-0.447213595499958); // -1 + 4 * G4
|
||||
|
||||
// (sqrt(5) - 1)/4 = F4, used once below
|
||||
T const F4 = static_cast<T>(0.309016994374947451);
|
||||
|
||||
// First corner
|
||||
detail::tvec4<T, P> i = floor(v + dot(v, detail::tvec4<T, P>(F4)));
|
||||
detail::tvec4<T, P> x0 = v - i + dot(i, detail::tvec4<T, P>(C.x));
|
||||
|
||||
// Other corners
|
||||
|
||||
// Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI)
|
||||
detail::tvec4<T, P> i0;
|
||||
detail::tvec3<T, P> isX = step(detail::tvec3<T, P>(x0.y, x0.z, x0.w), detail::tvec3<T, P>(x0.x));
|
||||
detail::tvec3<T, P> isYZ = step(detail::tvec3<T, P>(x0.z, x0.w, x0.w), detail::tvec3<T, P>(x0.y, x0.y, x0.z));
|
||||
|
||||
// i0.x = dot(isX, vec3(1.0));
|
||||
//i0.x = isX.x + isX.y + isX.z;
|
||||
//i0.yzw = static_cast<T>(1) - isX;
|
||||
i0 = detail::tvec4<T, P>(isX.x + isX.y + isX.z, T(1) - isX);
|
||||
|
||||
// i0.y += dot(isYZ.xy, vec2(1.0));
|
||||
i0.y += isYZ.x + isYZ.y;
|
||||
|
||||
//i0.zw += 1.0 - detail::tvec2<T, P>(isYZ.x, isYZ.y);
|
||||
i0.z += static_cast<T>(1) - isYZ.x;
|
||||
i0.w += static_cast<T>(1) - isYZ.y;
|
||||
i0.z += isYZ.z;
|
||||
i0.w += static_cast<T>(1) - isYZ.z;
|
||||
|
||||
// i0 now contains the unique values 0,1,2,3 in each channel
|
||||
detail::tvec4<T, P> i3 = clamp(i0, T(0), T(1));
|
||||
detail::tvec4<T, P> i2 = clamp(i0 - T(1), T(0), T(1));
|
||||
detail::tvec4<T, P> i1 = clamp(i0 - T(2), T(0), T(1));
|
||||
|
||||
// x0 = x0 - 0.0 + 0.0 * C.xxxx
|
||||
// x1 = x0 - i1 + 0.0 * C.xxxx
|
||||
// x2 = x0 - i2 + 0.0 * C.xxxx
|
||||
// x3 = x0 - i3 + 0.0 * C.xxxx
|
||||
// x4 = x0 - 1.0 + 4.0 * C.xxxx
|
||||
detail::tvec4<T, P> x1 = x0 - i1 + C.x;
|
||||
detail::tvec4<T, P> x2 = x0 - i2 + C.y;
|
||||
detail::tvec4<T, P> x3 = x0 - i3 + C.z;
|
||||
detail::tvec4<T, P> x4 = x0 + C.w;
|
||||
|
||||
// Permutations
|
||||
i = mod(i, T(289));
|
||||
T j0 = detail::permute(detail::permute(detail::permute(detail::permute(i.w) + i.z) + i.y) + i.x);
|
||||
detail::tvec4<T, P> j1 = detail::permute(detail::permute(detail::permute(detail::permute(
|
||||
i.w + detail::tvec4<T, P>(i1.w, i2.w, i3.w, T(1))) +
|
||||
i.z + detail::tvec4<T, P>(i1.z, i2.z, i3.z, T(1))) +
|
||||
i.y + detail::tvec4<T, P>(i1.y, i2.y, i3.y, T(1))) +
|
||||
i.x + detail::tvec4<T, P>(i1.x, i2.x, i3.x, T(1)));
|
||||
|
||||
// Gradients: 7x7x6 points over a cube, mapped onto a 4-cross polytope
|
||||
// 7*7*6 = 294, which is close to the ring size 17*17 = 289.
|
||||
detail::tvec4<T, P> ip = detail::tvec4<T, P>(T(1) / T(294), T(1) / T(49), T(1) / T(7), T(0));
|
||||
|
||||
detail::tvec4<T, P> p0 = detail::grad4(j0, ip);
|
||||
detail::tvec4<T, P> p1 = detail::grad4(j1.x, ip);
|
||||
detail::tvec4<T, P> p2 = detail::grad4(j1.y, ip);
|
||||
detail::tvec4<T, P> p3 = detail::grad4(j1.z, ip);
|
||||
detail::tvec4<T, P> p4 = detail::grad4(j1.w, ip);
|
||||
|
||||
// Normalise gradients
|
||||
detail::tvec4<T, P> norm = detail::taylorInvSqrt(detail::tvec4<T, P>(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));
|
||||
p0 *= norm.x;
|
||||
p1 *= norm.y;
|
||||
p2 *= norm.z;
|
||||
p3 *= norm.w;
|
||||
p4 *= taylorInvSqrt(dot(p4, p4));
|
||||
|
||||
// Mix contributions from the five corners
|
||||
detail::tvec3<T, P> m0 = max(T(0.6) - detail::tvec3<T, P>(dot(x0, x0), dot(x1, x1), dot(x2, x2)), T(0));
|
||||
detail::tvec2<T, P> m1 = max(T(0.6) - detail::tvec2<T, P>(dot(x3, x3), dot(x4, x4) ), T(0));
|
||||
m0 = m0 * m0;
|
||||
m1 = m1 * m1;
|
||||
|
||||
return T(49) * (
|
||||
dot(m0 * m0, detail::tvec3<T, P>(dot(p0, x0), dot(p1, x1), dot(p2, x2))) +
|
||||
dot(m1 * m1, detail::tvec2<T, P>(dot(p3, x3), dot(p4, x4))));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER detail::tvec2<T, P> noise2(detail::tvec2<T, P> const & x)
|
||||
{
|
||||
return detail::tvec2<T, P>(
|
||||
noise1(x + detail::tvec2<T, P>(0.0)),
|
||||
noise1(detail::tvec2<T, P>(0.0) - x));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER detail::tvec2<T, P> noise2(detail::tvec3<T, P> const & x)
|
||||
{
|
||||
return detail::tvec2<T, P>(
|
||||
noise1(x + detail::tvec3<T, P>(0.0)),
|
||||
noise1(detail::tvec3<T, P>(0.0) - x));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER detail::tvec2<T, P> noise2(detail::tvec4<T, P> const & x)
|
||||
{
|
||||
return detail::tvec2<T, P>(
|
||||
noise1(x + detail::tvec4<T, P>(0)),
|
||||
noise1(detail::tvec4<T, P>(0) - x));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER detail::tvec3<T, P> noise3(detail::tvec2<T, P> const & x)
|
||||
{
|
||||
return detail::tvec3<T, P>(
|
||||
noise1(x - detail::tvec2<T, P>(1.0)),
|
||||
noise1(x + detail::tvec2<T, P>(0.0)),
|
||||
noise1(x + detail::tvec2<T, P>(1.0)));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER detail::tvec3<T, P> noise3(detail::tvec3<T, P> const & x)
|
||||
{
|
||||
return detail::tvec3<T, P>(
|
||||
noise1(x - detail::tvec3<T, P>(1.0)),
|
||||
noise1(x + detail::tvec3<T, P>(0.0)),
|
||||
noise1(x + detail::tvec3<T, P>(1.0)));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER detail::tvec3<T, P> noise3(detail::tvec4<T, P> const & x)
|
||||
{
|
||||
return detail::tvec3<T, P>(
|
||||
noise1(x - detail::tvec4<T, P>(1)),
|
||||
noise1(x + detail::tvec4<T, P>(0)),
|
||||
noise1(x + detail::tvec4<T, P>(1)));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER detail::tvec4<T, P> noise4(detail::tvec2<T, P> const & x)
|
||||
{
|
||||
return detail::tvec4<T, P>(
|
||||
noise1(x - detail::tvec2<T, P>(1)),
|
||||
noise1(x + detail::tvec2<T, P>(0)),
|
||||
noise1(x + detail::tvec2<T, P>(1)),
|
||||
noise1(x + detail::tvec2<T, P>(2)));
|
||||
}
|
||||
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER detail::tvec4<T, P> noise4(detail::tvec3<T, P> const & x)
|
||||
{
|
||||
return detail::tvec4<T, P>(
|
||||
noise1(x - detail::tvec3<T, P>(1)),
|
||||
noise1(x + detail::tvec3<T, P>(0)),
|
||||
noise1(x + detail::tvec3<T, P>(1)),
|
||||
noise1(x + detail::tvec3<T, P>(2)));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER detail::tvec4<T, P> noise4(detail::tvec4<T, P> const & x)
|
||||
{
|
||||
return detail::tvec4<T, P>(
|
||||
noise1(x - detail::tvec4<T, P>(1)),
|
||||
noise1(x + detail::tvec4<T, P>(0)),
|
||||
noise1(x + detail::tvec4<T, P>(1)),
|
||||
noise1(x + detail::tvec4<T, P>(2)));
|
||||
}
|
||||
|
||||
}//namespace glm
|
||||
@@ -0,0 +1,195 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/func_packing.hpp
|
||||
/// @date 2010-03-17 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
///
|
||||
/// @defgroup core_func_packing Floating-Point Pack and Unpack Functions
|
||||
/// @ingroup core
|
||||
///
|
||||
/// These functions do not operate component-wise, rather as described in each case.
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef GLM_CORE_func_packing
|
||||
#define GLM_CORE_func_packing
|
||||
|
||||
#include "type_vec2.hpp"
|
||||
#include "type_vec4.hpp"
|
||||
|
||||
namespace glm
|
||||
{
|
||||
/// @addtogroup core_func_packing
|
||||
/// @{
|
||||
|
||||
/// First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values.
|
||||
/// Then, the results are packed into the returned 32-bit unsigned integer.
|
||||
///
|
||||
/// The conversion for component c of v to fixed point is done as follows:
|
||||
/// packUnorm2x16: round(clamp(c, 0, +1) * 65535.0)
|
||||
///
|
||||
/// The first component of the vector will be written to the least significant bits of the output;
|
||||
/// the last component will be written to the most significant bits.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm2x16.xml">GLSL packUnorm2x16 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL uint packUnorm2x16(vec2 const & v);
|
||||
|
||||
/// First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values.
|
||||
/// Then, the results are packed into the returned 32-bit unsigned integer.
|
||||
///
|
||||
/// The conversion for component c of v to fixed point is done as follows:
|
||||
/// packSnorm2x16: round(clamp(v, -1, +1) * 32767.0)
|
||||
///
|
||||
/// The first component of the vector will be written to the least significant bits of the output;
|
||||
/// the last component will be written to the most significant bits.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm2x16.xml">GLSL packSnorm2x16 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL uint packSnorm2x16(vec2 const & v);
|
||||
|
||||
/// First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values.
|
||||
/// Then, the results are packed into the returned 32-bit unsigned integer.
|
||||
///
|
||||
/// The conversion for component c of v to fixed point is done as follows:
|
||||
/// packUnorm4x8: round(clamp(c, 0, +1) * 255.0)
|
||||
///
|
||||
/// The first component of the vector will be written to the least significant bits of the output;
|
||||
/// the last component will be written to the most significant bits.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm4x8.xml">GLSL packUnorm4x8 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL uint packUnorm4x8(vec4 const & v);
|
||||
|
||||
/// First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values.
|
||||
/// Then, the results are packed into the returned 32-bit unsigned integer.
|
||||
///
|
||||
/// The conversion for component c of v to fixed point is done as follows:
|
||||
/// packSnorm4x8: round(clamp(c, -1, +1) * 127.0)
|
||||
///
|
||||
/// The first component of the vector will be written to the least significant bits of the output;
|
||||
/// the last component will be written to the most significant bits.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm4x8.xml">GLSL packSnorm4x8 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL uint packSnorm4x8(vec4 const & v);
|
||||
|
||||
/// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers.
|
||||
/// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector.
|
||||
///
|
||||
/// The conversion for unpacked fixed-point value f to floating point is done as follows:
|
||||
/// unpackUnorm2x16: f / 65535.0
|
||||
///
|
||||
/// The first component of the returned vector will be extracted from the least significant bits of the input;
|
||||
/// the last component will be extracted from the most significant bits.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm2x16.xml">GLSL unpackUnorm2x16 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL vec2 unpackUnorm2x16(uint const & p);
|
||||
|
||||
/// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers.
|
||||
/// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector.
|
||||
///
|
||||
/// The conversion for unpacked fixed-point value f to floating point is done as follows:
|
||||
/// unpackSnorm2x16: clamp(f / 32767.0, -1, +1)
|
||||
///
|
||||
/// The first component of the returned vector will be extracted from the least significant bits of the input;
|
||||
/// the last component will be extracted from the most significant bits.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm2x16.xml">GLSL unpackSnorm2x16 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL vec2 unpackSnorm2x16(uint const & p);
|
||||
|
||||
/// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers.
|
||||
/// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector.
|
||||
///
|
||||
/// The conversion for unpacked fixed-point value f to floating point is done as follows:
|
||||
/// unpackUnorm4x8: f / 255.0
|
||||
///
|
||||
/// The first component of the returned vector will be extracted from the least significant bits of the input;
|
||||
/// the last component will be extracted from the most significant bits.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm4x8.xml">GLSL unpackUnorm4x8 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL vec4 unpackUnorm4x8(uint const & p);
|
||||
|
||||
/// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers.
|
||||
/// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector.
|
||||
///
|
||||
/// The conversion for unpacked fixed-point value f to floating point is done as follows:
|
||||
/// unpackSnorm4x8: clamp(f / 127.0, -1, +1)
|
||||
///
|
||||
/// The first component of the returned vector will be extracted from the least significant bits of the input;
|
||||
/// the last component will be extracted from the most significant bits.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm4x8.xml">GLSL unpackSnorm4x8 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL vec4 unpackSnorm4x8(uint const & p);
|
||||
|
||||
/// Returns a double-precision value obtained by packing the components of v into a 64-bit value.
|
||||
/// If an IEEE 754 Inf or NaN is created, it will not signal, and the resulting floating point value is unspecified.
|
||||
/// Otherwise, the bit- level representation of v is preserved.
|
||||
/// The first vector component specifies the 32 least significant bits;
|
||||
/// the second component specifies the 32 most significant bits.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packDouble2x32.xml">GLSL packDouble2x32 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL double packDouble2x32(uvec2 const & v);
|
||||
|
||||
/// Returns a two-component unsigned integer vector representation of v.
|
||||
/// The bit-level representation of v is preserved.
|
||||
/// The first component of the vector contains the 32 least significant bits of the double;
|
||||
/// the second component consists the 32 most significant bits.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackDouble2x32.xml">GLSL unpackDouble2x32 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL uvec2 unpackDouble2x32(double const & v);
|
||||
|
||||
/// Returns an unsigned integer obtained by converting the components of a two-component floating-point vector
|
||||
/// to the 16-bit floating-point representation found in the OpenGL Specification,
|
||||
/// and then packing these two 16- bit integers into a 32-bit unsigned integer.
|
||||
/// The first vector component specifies the 16 least-significant bits of the result;
|
||||
/// the second component specifies the 16 most-significant bits.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packHalf2x16.xml">GLSL packHalf2x16 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL uint packHalf2x16(vec2 const & v);
|
||||
|
||||
/// Returns a two-component floating-point vector with components obtained by unpacking a 32-bit unsigned integer into a pair of 16-bit values,
|
||||
/// interpreting those values as 16-bit floating-point numbers according to the OpenGL Specification,
|
||||
/// and converting them to 32-bit floating-point values.
|
||||
/// The first component of the vector is obtained from the 16 least-significant bits of v;
|
||||
/// the second component is obtained from the 16 most-significant bits of v.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackHalf2x16.xml">GLSL unpackHalf2x16 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL vec2 unpackHalf2x16(uint const & v);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
||||
#include "func_packing.inl"
|
||||
|
||||
#endif//GLM_CORE_func_packing
|
||||
@@ -0,0 +1,116 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/func_packing.inl
|
||||
/// @date 2010-03-17 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "func_common.hpp"
|
||||
#include "type_half.hpp"
|
||||
#include "../fwd.hpp"
|
||||
|
||||
namespace glm
|
||||
{
|
||||
GLM_FUNC_QUALIFIER uint packUnorm2x16(vec2 const & v)
|
||||
{
|
||||
u16vec2 Topack(round(clamp(v, 0.0f, 1.0f) * 65535.0f));
|
||||
return reinterpret_cast<uint&>(Topack);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER vec2 unpackUnorm2x16(uint const & p)
|
||||
{
|
||||
vec2 Unpack(reinterpret_cast<u16vec2 const &>(p));
|
||||
return Unpack * float(1.5259021896696421759365224689097e-5); // 1.0 / 65535.0
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint packSnorm2x16(vec2 const & v)
|
||||
{
|
||||
i16vec2 Topack(round(clamp(v ,-1.0f, 1.0f) * 32767.0f));
|
||||
return reinterpret_cast<uint32&>(Topack);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER vec2 unpackSnorm2x16(uint const & p)
|
||||
{
|
||||
vec2 Unpack(reinterpret_cast<i16vec2 const &>(p));
|
||||
return clamp(
|
||||
Unpack * 3.0518509475997192297128208258309e-5f, //1.0f / 32767.0f,
|
||||
-1.0f, 1.0f);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint packUnorm4x8(vec4 const & v)
|
||||
{
|
||||
u8vec4 Topack(round(clamp(v, 0.0f, 1.0f) * 255.0f));
|
||||
return reinterpret_cast<uint&>(Topack);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER vec4 unpackUnorm4x8(uint const & p)
|
||||
{
|
||||
vec4 Unpack(reinterpret_cast<u8vec4 const&>(p));
|
||||
return Unpack * float(0.0039215686274509803921568627451); // 1 / 255
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint packSnorm4x8(vec4 const & v)
|
||||
{
|
||||
i8vec4 Topack(round(clamp(v ,-1.0f, 1.0f) * 127.0f));
|
||||
return reinterpret_cast<uint&>(Topack);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER glm::vec4 unpackSnorm4x8(uint const & p)
|
||||
{
|
||||
vec4 Unpack(reinterpret_cast<i8vec4 const &>(p));
|
||||
return clamp(
|
||||
Unpack * 0.0078740157480315f, // 1.0f / 127.0f
|
||||
-1.0f, 1.0f);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER double packDouble2x32(uvec2 const & v)
|
||||
{
|
||||
return reinterpret_cast<double const &>(v);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uvec2 unpackDouble2x32(double const & v)
|
||||
{
|
||||
return reinterpret_cast<uvec2 const &>(v);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint packHalf2x16(vec2 const & v)
|
||||
{
|
||||
i16vec2 Unpack(
|
||||
detail::toFloat16(v.x),
|
||||
detail::toFloat16(v.y));
|
||||
|
||||
uint * Result = reinterpret_cast<uint*>(&Unpack);
|
||||
return *Result;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER vec2 unpackHalf2x16(uint const & v)
|
||||
{
|
||||
i16vec2 Unpack(reinterpret_cast<i16vec2 const &>(v));
|
||||
|
||||
return vec2(
|
||||
detail::toFloat32(Unpack.x),
|
||||
detail::toFloat32(Unpack.y));
|
||||
}
|
||||
}//namespace glm
|
||||
|
||||
@@ -0,0 +1,203 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/func_trigonometric.hpp
|
||||
/// @date 2008-08-01 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
|
||||
///
|
||||
/// @defgroup core_func_trigonometric Angle and Trigonometry Functions
|
||||
/// @ingroup core
|
||||
///
|
||||
/// Function parameters specified as angle are assumed to be in units of radians.
|
||||
/// In no case will any of these functions result in a divide by zero error. If
|
||||
/// the divisor of a ratio is 0, then results will be undefined.
|
||||
///
|
||||
/// These all operate component-wise. The description is per component.
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef GLM_CORE_func_trigonometric
|
||||
#define GLM_CORE_func_trigonometric
|
||||
|
||||
namespace glm
|
||||
{
|
||||
/// @addtogroup core_func_trigonometric
|
||||
/// @{
|
||||
|
||||
/// Converts degrees to radians and returns the result.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/radians.xml">GLSL radians man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType radians(genType const & degrees);
|
||||
|
||||
/// Converts radians to degrees and returns the result.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/degrees.xml">GLSL degrees man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType degrees(genType const & radians);
|
||||
|
||||
/// The standard trigonometric sine function.
|
||||
/// The values returned by this function will range from [-1, 1].
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sin.xml">GLSL sin man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType sin(genType const & angle);
|
||||
|
||||
/// The standard trigonometric cosine function.
|
||||
/// The values returned by this function will range from [-1, 1].
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cos.xml">GLSL cos man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType cos(genType const & angle);
|
||||
|
||||
/// The standard trigonometric tangent function.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/tan.xml">GLSL tan man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType tan(genType const & angle);
|
||||
|
||||
/// Arc sine. Returns an angle whose sine is x.
|
||||
/// The range of values returned by this function is [-PI/2, PI/2].
|
||||
/// Results are undefined if |x| > 1.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/asin.xml">GLSL asin man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType asin(genType const & x);
|
||||
|
||||
/// Arc cosine. Returns an angle whose sine is x.
|
||||
/// The range of values returned by this function is [0, PI].
|
||||
/// Results are undefined if |x| > 1.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/acos.xml">GLSL acos man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType acos(genType const & x);
|
||||
|
||||
/// Arc tangent. Returns an angle whose tangent is y/x.
|
||||
/// The signs of x and y are used to determine what
|
||||
/// quadrant the angle is in. The range of values returned
|
||||
/// by this function is [-PI, PI]. Results are undefined
|
||||
/// if x and y are both 0.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/atan.xml">GLSL atan man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType atan(genType const & y, genType const & x);
|
||||
|
||||
/// Arc tangent. Returns an angle whose tangent is y_over_x.
|
||||
/// The range of values returned by this function is [-PI/2, PI/2].
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/atan.xml">GLSL atan man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType atan(genType const & y_over_x);
|
||||
|
||||
/// Returns the hyperbolic sine function, (exp(x) - exp(-x)) / 2
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sinh.xml">GLSL sinh man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType sinh(genType const & angle);
|
||||
|
||||
/// Returns the hyperbolic cosine function, (exp(x) + exp(-x)) / 2
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cosh.xml">GLSL cosh man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType cosh(genType const & angle);
|
||||
|
||||
/// Returns the hyperbolic tangent function, sinh(angle) / cosh(angle)
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/tanh.xml">GLSL tanh man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType tanh(genType const & angle);
|
||||
|
||||
/// Arc hyperbolic sine; returns the inverse of sinh.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/asinh.xml">GLSL asinh man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType asinh(genType const & x);
|
||||
|
||||
/// Arc hyperbolic cosine; returns the non-negative inverse
|
||||
/// of cosh. Results are undefined if x < 1.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/acosh.xml">GLSL acosh man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType acosh(genType const & x);
|
||||
|
||||
/// Arc hyperbolic tangent; returns the inverse of tanh.
|
||||
/// Results are undefined if abs(x) >= 1.
|
||||
///
|
||||
/// @tparam genType Floating-point scalar or vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/atanh.xml">GLSL atanh man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType atanh(genType const & x);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
||||
#include "func_trigonometric.inl"
|
||||
|
||||
#endif//GLM_CORE_func_trigonometric
|
||||
|
||||
|
||||
@@ -0,0 +1,246 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/func_trigonometric.inl
|
||||
/// @date 2008-08-03 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "_vectorize.hpp"
|
||||
#include <cmath>
|
||||
#include <limits>
|
||||
|
||||
namespace glm
|
||||
{
|
||||
// radians
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType radians
|
||||
(
|
||||
genType const & degrees
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'radians' only accept floating-point input");
|
||||
|
||||
return degrees * genType(0.01745329251994329576923690768489);
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(radians)
|
||||
|
||||
// degrees
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType degrees
|
||||
(
|
||||
genType const & radians
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'degrees' only accept floating-point input");
|
||||
|
||||
return radians * genType(57.295779513082320876798154814105);
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(degrees)
|
||||
|
||||
// sin
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType sin
|
||||
(
|
||||
genType const & angle
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'sin' only accept floating-point input");
|
||||
|
||||
return genType(::std::sin(angle));
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(sin)
|
||||
|
||||
// cos
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType cos(genType const & angle)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'cos' only accept floating-point input");
|
||||
|
||||
return genType(::std::cos(angle));
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(cos)
|
||||
|
||||
// tan
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType tan
|
||||
(
|
||||
genType const & angle
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'tan' only accept floating-point input");
|
||||
|
||||
return genType(::std::tan(angle));
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(tan)
|
||||
|
||||
// asin
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType asin
|
||||
(
|
||||
genType const & x
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'asin' only accept floating-point input");
|
||||
|
||||
return genType(::std::asin(x));
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(asin)
|
||||
|
||||
// acos
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType acos
|
||||
(
|
||||
genType const & x
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'acos' only accept floating-point input");
|
||||
|
||||
return genType(::std::acos(x));
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(acos)
|
||||
|
||||
// atan
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType atan
|
||||
(
|
||||
genType const & y,
|
||||
genType const & x
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'atan' only accept floating-point input");
|
||||
|
||||
return genType(::std::atan2(y, x));
|
||||
}
|
||||
|
||||
VECTORIZE_VEC_VEC(atan)
|
||||
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType atan
|
||||
(
|
||||
genType const & x
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'atan' only accept floating-point input");
|
||||
|
||||
return genType(::std::atan(x));
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(atan)
|
||||
|
||||
// sinh
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType sinh
|
||||
(
|
||||
genType const & angle
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'sinh' only accept floating-point input");
|
||||
|
||||
return genType(std::sinh(angle));
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(sinh)
|
||||
|
||||
// cosh
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType cosh
|
||||
(
|
||||
genType const & angle
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'cosh' only accept floating-point input");
|
||||
|
||||
return genType(std::cosh(angle));
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(cosh)
|
||||
|
||||
// tanh
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType tanh
|
||||
(
|
||||
genType const & angle
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'tanh' only accept floating-point input");
|
||||
|
||||
return genType(std::tanh(angle));
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(tanh)
|
||||
|
||||
// asinh
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType asinh
|
||||
(
|
||||
genType const & x
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'asinh' only accept floating-point input");
|
||||
|
||||
return (x < genType(0) ? genType(-1) : (x > genType(0) ? genType(1) : genType(0))) * log(abs(x) + sqrt(genType(1) + x * x));
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(asinh)
|
||||
|
||||
// acosh
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType acosh
|
||||
(
|
||||
genType const & x
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'acosh' only accept floating-point input");
|
||||
|
||||
if(x < genType(1))
|
||||
return genType(0);
|
||||
return log(x + sqrt(x * x - genType(1)));
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(acosh)
|
||||
|
||||
// atanh
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType atanh
|
||||
(
|
||||
genType const & x
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'atanh' only accept floating-point input");
|
||||
|
||||
if(abs(x) >= genType(1))
|
||||
return 0;
|
||||
return genType(0.5) * log((genType(1) + x) / (genType(1) - x));
|
||||
}
|
||||
|
||||
VECTORIZE_VEC(atanh)
|
||||
|
||||
}//namespace glm
|
||||
@@ -0,0 +1,145 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/func_vector_relational.hpp
|
||||
/// @date 2008-08-03 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
|
||||
///
|
||||
/// @defgroup core_func_vector_relational Vector Relational Functions
|
||||
/// @ingroup core
|
||||
///
|
||||
/// Relational and equality operators (<, <=, >, >=, ==, !=) are defined to
|
||||
/// operate on scalars and produce scalar Boolean results. For vector results,
|
||||
/// use the following built-in functions.
|
||||
///
|
||||
/// In all cases, the sizes of all the input and return vectors for any particular
|
||||
/// call must match.
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef GLM_CORE_func_vector_relational
|
||||
#define GLM_CORE_func_vector_relational
|
||||
|
||||
#include "precision.hpp"
|
||||
#include "setup.hpp"
|
||||
|
||||
#if !((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER <= GLM_COMPILER_VC10)) // Workaround a Visual C++ bug
|
||||
|
||||
namespace glm
|
||||
{
|
||||
/// @addtogroup core_func_vector_relational
|
||||
/// @{
|
||||
|
||||
/// Returns the component-wise comparison result of x < y.
|
||||
///
|
||||
/// @tparam vecType Floating-point or integer vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/lessThan.xml">GLSL lessThan man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
|
||||
// TODO: Mismatched
|
||||
//template <typename T, precision P, template <typename, precision> class vecType>
|
||||
//GLM_FUNC_DECL typename vecType<T, P>::bool_type lessThan(vecType<T, P> const & x, vecType<T, P> const & y);
|
||||
|
||||
/// Returns the component-wise comparison of result x <= y.
|
||||
///
|
||||
/// @tparam vecType Floating-point or integer vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/lessThanEqual.xml">GLSL lessThanEqual man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_DECL typename vecType<T, P>::bool_type lessThanEqual(vecType<T, P> const & x, vecType<T, P> const & y);
|
||||
|
||||
/// Returns the component-wise comparison of result x > y.
|
||||
///
|
||||
/// @tparam vecType Floating-point or integer vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/greaterThan.xml">GLSL greaterThan man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_DECL typename vecType<T, P>::bool_type greaterThan(vecType<T, P> const & x, vecType<T, P> const & y);
|
||||
|
||||
/// Returns the component-wise comparison of result x >= y.
|
||||
///
|
||||
/// @tparam vecType Floating-point or integer vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/greaterThanEqual.xml">GLSL greaterThanEqual man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_DECL typename vecType<T, P>::bool_type greaterThanEqual(vecType<T, P> const & x, vecType<T, P> const & y);
|
||||
|
||||
/// Returns the component-wise comparison of result x == y.
|
||||
///
|
||||
/// @tparam vecType Floating-point, integer or boolean vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/equal.xml">GLSL equal man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
|
||||
//TODO: conflicts with definision
|
||||
//template <typename T, precision P, template <typename, precision> class vecType>
|
||||
//GLM_FUNC_DECL typename vecType<T, P>::bool_type equal(vecType<T, P> const & x, vecType<T, P> const & y);
|
||||
|
||||
/// Returns the component-wise comparison of result x != y.
|
||||
///
|
||||
/// @tparam vecType Floating-point, integer or boolean vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/notEqual.xml">GLSL notEqual man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_DECL typename vecType<T, P>::bool_type notEqual(vecType<T, P> const & x, vecType<T, P> const & y);
|
||||
|
||||
/// Returns true if any component of x is true.
|
||||
///
|
||||
/// @tparam vecType Boolean vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/any.xml">GLSL any man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
|
||||
template <precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_DECL bool any(vecType<bool, P> const & v);
|
||||
|
||||
/// Returns true if all components of x are true.
|
||||
///
|
||||
/// @tparam vecType Boolean vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/all.xml">GLSL all man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
|
||||
template <precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_DECL bool all(vecType<bool, P> const & v);
|
||||
|
||||
/// Returns the component-wise logical complement of x.
|
||||
/// /!\ Because of language incompatibilities between C++ and GLSL, GLM defines the function not but not_ instead.
|
||||
///
|
||||
/// @tparam vecType Boolean vector types.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/not.xml">GLSL not man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
|
||||
template <precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_DECL vecType<bool, P> not_(vecType<bool, P> const & v);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
||||
#endif
|
||||
|
||||
#include "func_vector_relational.inl"
|
||||
|
||||
#endif//GLM_CORE_func_vector_relational
|
||||
@@ -0,0 +1,159 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/func_vector_relational.inl
|
||||
/// @date 2008-08-03 / 2011-09-09
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <limits>
|
||||
|
||||
namespace glm
|
||||
{
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER typename vecType<T, P>::bool_type lessThan
|
||||
(
|
||||
vecType<T, P> const & x,
|
||||
vecType<T, P> const & y
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer,
|
||||
"Invalid template instantiation of 'lessThan', GLM vector types required floating-point or integer value types vectors");
|
||||
assert(x.length() == y.length());
|
||||
|
||||
typename vecType<bool, P>::bool_type Result(vecType<bool, P>::_null);
|
||||
for(int i = 0; i < x.length(); ++i)
|
||||
Result[i] = x[i] < y[i];
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER typename vecType<T, P>::bool_type lessThanEqual
|
||||
(
|
||||
vecType<T, P> const & x,
|
||||
vecType<T, P> const & y
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer,
|
||||
"Invalid template instantiation of 'lessThanEqual', GLM vector types required floating-point or integer value types vectors");
|
||||
assert(x.length() == y.length());
|
||||
|
||||
typename vecType<bool, P>::bool_type Result(vecType<bool, P>::_null);
|
||||
for(int i = 0; i < x.length(); ++i)
|
||||
Result[i] = x[i] <= y[i];
|
||||
return Result;
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER typename vecType<T, P>::bool_type greaterThan
|
||||
(
|
||||
vecType<T, P> const & x,
|
||||
vecType<T, P> const & y
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer,
|
||||
"Invalid template instantiation of 'greaterThan', GLM vector types required floating-point or integer value types vectors");
|
||||
assert(x.length() == y.length());
|
||||
|
||||
typename vecType<bool, P>::bool_type Result(vecType<bool, P>::_null);
|
||||
for(int i = 0; i < x.length(); ++i)
|
||||
Result[i] = x[i] > y[i];
|
||||
return Result;
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER typename vecType<T, P>::bool_type greaterThanEqual
|
||||
(
|
||||
vecType<T, P> const & x,
|
||||
vecType<T, P> const & y
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer,
|
||||
"Invalid template instantiation of 'greaterThanEqual', GLM vector types required floating-point or integer value types vectors");
|
||||
assert(x.length() == y.length());
|
||||
|
||||
typename vecType<bool, P>::bool_type Result(vecType<bool, P>::_null);
|
||||
for(int i = 0; i < x.length(); ++i)
|
||||
Result[i] = x[i] >= y[i];
|
||||
return Result;
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER typename vecType<T, P>::bool_type equal
|
||||
(
|
||||
vecType<T, P> const & x,
|
||||
vecType<T, P> const & y
|
||||
)
|
||||
{
|
||||
assert(x.length() == y.length());
|
||||
|
||||
typename vecType<bool, P>::bool_type Result(vecType<bool, P>::_null);
|
||||
for(int i = 0; i < x.length(); ++i)
|
||||
Result[i] = x[i] == y[i];
|
||||
return Result;
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER typename vecType<T, P>::bool_type notEqual
|
||||
(
|
||||
vecType<T, P> const & x,
|
||||
vecType<T, P> const & y
|
||||
)
|
||||
{
|
||||
assert(x.length() == y.length());
|
||||
|
||||
typename vecType<bool, P>::bool_type Result(vecType<bool, P>::_null);
|
||||
for(int i = 0; i < x.length(); ++i)
|
||||
Result[i] = x[i] != y[i];
|
||||
return Result;
|
||||
}
|
||||
|
||||
template <precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER bool any(vecType<bool, P> const & v)
|
||||
{
|
||||
bool Result = false;
|
||||
for(int i = 0; i < v.length(); ++i)
|
||||
Result = Result || v[i];
|
||||
return Result;
|
||||
}
|
||||
|
||||
template <precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER bool all(vecType<bool, P> const & v)
|
||||
{
|
||||
bool Result = true;
|
||||
for(int i = 0; i < v.length(); ++i)
|
||||
Result = Result && v[i];
|
||||
return Result;
|
||||
}
|
||||
|
||||
template <precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<bool, P> not_(vecType<bool, P> const & v)
|
||||
{
|
||||
typename vecType<bool, P>::bool_type Result(vecType<bool, P>::_null);
|
||||
for(int i = 0; i < v.length(); ++i)
|
||||
Result[i] = !v[i];
|
||||
return Result;
|
||||
}
|
||||
}//namespace glm
|
||||
|
||||
@@ -0,0 +1,288 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/glm.cpp
|
||||
/// @date 2013-04-22 / 2013-04-22
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
#include <glm/gtc/quaternion.hpp>
|
||||
#include <glm/gtx/dual_quaternion.hpp>
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
// tvec1 type explicit instantiation
|
||||
/*
|
||||
template struct tvec1<uint8, lowp>;
|
||||
template struct tvec1<uint16, lowp>;
|
||||
template struct tvec1<uint32, lowp>;
|
||||
template struct tvec1<uint64, lowp>;
|
||||
template struct tvec1<int8, lowp>;
|
||||
template struct tvec1<int16, lowp>;
|
||||
template struct tvec1<int32, lowp>;
|
||||
template struct tvec1<int64, lowp>;
|
||||
template struct tvec1<float16, lowp>;
|
||||
template struct tvec1<float32, lowp>;
|
||||
template struct tvec1<float64, lowp>;
|
||||
|
||||
template struct tvec1<uint8, mediump>;
|
||||
template struct tvec1<uint16, mediump>;
|
||||
template struct tvec1<uint32, mediump>;
|
||||
template struct tvec1<uint64, mediump>;
|
||||
template struct tvec1<int8, mediump>;
|
||||
template struct tvec1<int16, mediump>;
|
||||
template struct tvec1<int32, mediump>;
|
||||
template struct tvec1<int64, mediump>;
|
||||
template struct tvec1<float16, mediump>;
|
||||
template struct tvec1<float32, mediump>;
|
||||
template struct tvec1<float64, mediump>;
|
||||
|
||||
template struct tvec1<uint8, highp>;
|
||||
template struct tvec1<uint16, highp>;
|
||||
template struct tvec1<uint32, highp>;
|
||||
template struct tvec1<uint64, highp>;
|
||||
template struct tvec1<int8, highp>;
|
||||
template struct tvec1<int16, highp>;
|
||||
template struct tvec1<int32, highp>;
|
||||
template struct tvec1<int64, highp>;
|
||||
template struct tvec1<float16, highp>;
|
||||
template struct tvec1<float32, highp>;
|
||||
template struct tvec1<float64, highp>;
|
||||
*/
|
||||
// tvec2 type explicit instantiation
|
||||
template struct tvec2<uint8, lowp>;
|
||||
template struct tvec2<uint16, lowp>;
|
||||
template struct tvec2<uint32, lowp>;
|
||||
template struct tvec2<uint64, lowp>;
|
||||
template struct tvec2<int8, lowp>;
|
||||
template struct tvec2<int16, lowp>;
|
||||
template struct tvec2<int32, lowp>;
|
||||
template struct tvec2<int64, lowp>;
|
||||
template struct tvec2<float32, lowp>;
|
||||
template struct tvec2<float64, lowp>;
|
||||
|
||||
template struct tvec2<uint8, mediump>;
|
||||
template struct tvec2<uint16, mediump>;
|
||||
template struct tvec2<uint32, mediump>;
|
||||
template struct tvec2<uint64, mediump>;
|
||||
template struct tvec2<int8, mediump>;
|
||||
template struct tvec2<int16, mediump>;
|
||||
template struct tvec2<int32, mediump>;
|
||||
template struct tvec2<int64, mediump>;
|
||||
template struct tvec2<float32, mediump>;
|
||||
template struct tvec2<float64, mediump>;
|
||||
|
||||
template struct tvec2<uint8, highp>;
|
||||
template struct tvec2<uint16, highp>;
|
||||
template struct tvec2<uint32, highp>;
|
||||
template struct tvec2<uint64, highp>;
|
||||
template struct tvec2<int8, highp>;
|
||||
template struct tvec2<int16, highp>;
|
||||
template struct tvec2<int32, highp>;
|
||||
template struct tvec2<int64, highp>;
|
||||
template struct tvec2<float32, highp>;
|
||||
template struct tvec2<float64, highp>;
|
||||
|
||||
// tvec3 type explicit instantiation
|
||||
template struct tvec3<uint8, lowp>;
|
||||
template struct tvec3<uint16, lowp>;
|
||||
template struct tvec3<uint32, lowp>;
|
||||
template struct tvec3<uint64, lowp>;
|
||||
template struct tvec3<int8, lowp>;
|
||||
template struct tvec3<int16, lowp>;
|
||||
template struct tvec3<int32, lowp>;
|
||||
template struct tvec3<int64, lowp>;
|
||||
template struct tvec3<float32, lowp>;
|
||||
template struct tvec3<float64, lowp>;
|
||||
|
||||
template struct tvec3<uint8, mediump>;
|
||||
template struct tvec3<uint16, mediump>;
|
||||
template struct tvec3<uint32, mediump>;
|
||||
template struct tvec3<uint64, mediump>;
|
||||
template struct tvec3<int8, mediump>;
|
||||
template struct tvec3<int16, mediump>;
|
||||
template struct tvec3<int32, mediump>;
|
||||
template struct tvec3<int64, mediump>;
|
||||
template struct tvec3<float32, mediump>;
|
||||
template struct tvec3<float64, mediump>;
|
||||
|
||||
template struct tvec3<uint8, highp>;
|
||||
template struct tvec3<uint16, highp>;
|
||||
template struct tvec3<uint32, highp>;
|
||||
template struct tvec3<uint64, highp>;
|
||||
template struct tvec3<int8, highp>;
|
||||
template struct tvec3<int16, highp>;
|
||||
template struct tvec3<int32, highp>;
|
||||
template struct tvec3<int64, highp>;
|
||||
template struct tvec3<float32, highp>;
|
||||
template struct tvec3<float64, highp>;
|
||||
|
||||
// tvec4 type explicit instantiation
|
||||
template struct tvec4<uint8, lowp>;
|
||||
template struct tvec4<uint16, lowp>;
|
||||
template struct tvec4<uint32, lowp>;
|
||||
template struct tvec4<uint64, lowp>;
|
||||
template struct tvec4<int8, lowp>;
|
||||
template struct tvec4<int16, lowp>;
|
||||
template struct tvec4<int32, lowp>;
|
||||
template struct tvec4<int64, lowp>;
|
||||
template struct tvec4<float32, lowp>;
|
||||
template struct tvec4<float64, lowp>;
|
||||
|
||||
template struct tvec4<uint8, mediump>;
|
||||
template struct tvec4<uint16, mediump>;
|
||||
template struct tvec4<uint32, mediump>;
|
||||
template struct tvec4<uint64, mediump>;
|
||||
template struct tvec4<int8, mediump>;
|
||||
template struct tvec4<int16, mediump>;
|
||||
template struct tvec4<int32, mediump>;
|
||||
template struct tvec4<int64, mediump>;
|
||||
template struct tvec4<float32, mediump>;
|
||||
template struct tvec4<float64, mediump>;
|
||||
|
||||
template struct tvec4<uint8, highp>;
|
||||
template struct tvec4<uint16, highp>;
|
||||
template struct tvec4<uint32, highp>;
|
||||
template struct tvec4<uint64, highp>;
|
||||
template struct tvec4<int8, highp>;
|
||||
template struct tvec4<int16, highp>;
|
||||
template struct tvec4<int32, highp>;
|
||||
template struct tvec4<int64, highp>;
|
||||
template struct tvec4<float32, highp>;
|
||||
template struct tvec4<float64, highp>;
|
||||
|
||||
// tmat2x2 type explicit instantiation
|
||||
template struct tmat2x2<float32, lowp>;
|
||||
template struct tmat2x2<float64, lowp>;
|
||||
|
||||
template struct tmat2x2<float32, mediump>;
|
||||
template struct tmat2x2<float64, mediump>;
|
||||
|
||||
template struct tmat2x2<float32, highp>;
|
||||
template struct tmat2x2<float64, highp>;
|
||||
|
||||
// tmat2x3 type explicit instantiation
|
||||
template struct tmat2x3<float32, lowp>;
|
||||
template struct tmat2x3<float64, lowp>;
|
||||
|
||||
template struct tmat2x3<float32, mediump>;
|
||||
template struct tmat2x3<float64, mediump>;
|
||||
|
||||
template struct tmat2x3<float32, highp>;
|
||||
template struct tmat2x3<float64, highp>;
|
||||
|
||||
// tmat2x4 type explicit instantiation
|
||||
template struct tmat2x4<float32, lowp>;
|
||||
template struct tmat2x4<float64, lowp>;
|
||||
|
||||
template struct tmat2x4<float32, mediump>;
|
||||
template struct tmat2x4<float64, mediump>;
|
||||
|
||||
template struct tmat2x4<float32, highp>;
|
||||
template struct tmat2x4<float64, highp>;
|
||||
|
||||
// tmat3x2 type explicit instantiation
|
||||
template struct tmat3x2<float32, lowp>;
|
||||
template struct tmat3x2<float64, lowp>;
|
||||
|
||||
template struct tmat3x2<float32, mediump>;
|
||||
template struct tmat3x2<float64, mediump>;
|
||||
|
||||
template struct tmat3x2<float32, highp>;
|
||||
template struct tmat3x2<float64, highp>;
|
||||
|
||||
// tmat3x3 type explicit instantiation
|
||||
template struct tmat3x3<float32, lowp>;
|
||||
template struct tmat3x3<float64, lowp>;
|
||||
|
||||
template struct tmat3x3<float32, mediump>;
|
||||
template struct tmat3x3<float64, mediump>;
|
||||
|
||||
template struct tmat3x3<float32, highp>;
|
||||
template struct tmat3x3<float64, highp>;
|
||||
|
||||
// tmat3x4 type explicit instantiation
|
||||
template struct tmat3x4<float32, lowp>;
|
||||
template struct tmat3x4<float64, lowp>;
|
||||
|
||||
template struct tmat3x4<float32, mediump>;
|
||||
template struct tmat3x4<float64, mediump>;
|
||||
|
||||
template struct tmat3x4<float32, highp>;
|
||||
template struct tmat3x4<float64, highp>;
|
||||
|
||||
// tmat4x2 type explicit instantiation
|
||||
template struct tmat4x2<float32, lowp>;
|
||||
template struct tmat4x2<float64, lowp>;
|
||||
|
||||
template struct tmat4x2<float32, mediump>;
|
||||
template struct tmat4x2<float64, mediump>;
|
||||
|
||||
template struct tmat4x2<float32, highp>;
|
||||
template struct tmat4x2<float64, highp>;
|
||||
|
||||
// tmat4x3 type explicit instantiation
|
||||
template struct tmat4x3<float32, lowp>;
|
||||
template struct tmat4x3<float64, lowp>;
|
||||
|
||||
template struct tmat4x3<float32, mediump>;
|
||||
template struct tmat4x3<float64, mediump>;
|
||||
|
||||
template struct tmat4x3<float32, highp>;
|
||||
template struct tmat4x3<float64, highp>;
|
||||
|
||||
// tmat4x4 type explicit instantiation
|
||||
template struct tmat4x4<float32, lowp>;
|
||||
template struct tmat4x4<float64, lowp>;
|
||||
|
||||
template struct tmat4x4<float32, mediump>;
|
||||
template struct tmat4x4<float64, mediump>;
|
||||
|
||||
template struct tmat4x4<float32, highp>;
|
||||
template struct tmat4x4<float64, highp>;
|
||||
|
||||
// tquat type explicit instantiation
|
||||
template struct tquat<float32, lowp>;
|
||||
template struct tquat<float64, lowp>;
|
||||
|
||||
template struct tquat<float32, mediump>;
|
||||
template struct tquat<float64, mediump>;
|
||||
|
||||
template struct tquat<float32, highp>;
|
||||
template struct tquat<float64, highp>;
|
||||
|
||||
//tdualquat type explicit instantiation
|
||||
template struct tdualquat<float32, lowp>;
|
||||
template struct tdualquat<float64, lowp>;
|
||||
|
||||
template struct tdualquat<float32, mediump>;
|
||||
template struct tdualquat<float64, mediump>;
|
||||
|
||||
template struct tdualquat<float32, highp>;
|
||||
template struct tdualquat<float64, highp>;
|
||||
|
||||
}//namespace detail
|
||||
}//namespace glm
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
/// copies of the Software, and to permit persons to whom the Software is
|
||||
/// furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
/// THE SOFTWARE.
|
||||
///
|
||||
/// @ref core
|
||||
/// @file glm/core/hint.hpp
|
||||
/// @date 2008-08-14 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef glm_core_type
|
||||
#define glm_core_type
|
||||
|
||||
namespace glm
|
||||
{
|
||||
// Use dont_care, nicest and fastest to optimize implementations.
|
||||
class dont_care {};
|
||||
class nicest {};
|
||||
class fastest {};
|
||||
}//namespace glm
|
||||
|
||||
#endif//glm_core_type
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user