summaryrefslogtreecommitdiff
path: root/builtin/common/tests
Commit message (Collapse)AuthorAge
* Add vector.combine (#11920)Lars Müller2022-05-04
|
* Store vector metatable in registryJude Melton-Houghton2022-03-29
|
* Fix vector.from_string returning a table without vector metatableDesour2022-01-02
|
* Split vector.new into 3 constructorsDS2021-09-10
|
* Add metatables to lua vectors (#11039)DS2021-06-04
| | | Add backwards-compatible metatable functions for vectors.
* Add vector.to_string and vector.from_string (#10323)DS2021-04-05
| | | Writing vectors as strings is very common and should belong to `vector.*`. `minetest.pos_to_string` is also too long to write, implies that one should only use it for positions and leaves no spaces after the commas.
* Add vector.offset (#10321)DS2020-08-29
|
* Some vector functions useful for working with rotations (#9572)NetherEran2020-06-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * added vector.rotate * added vector.forward_from_rotation and vector.up_from_rotation * added vector.forward_up_to_rotatiton * fixed some bugs and formatting with vector functions * shortened name of some new vector functions and added documentation * made vector.rotate not require a unit vector as axis * fixed crash with vector.forward_up_to_rot * renamed new vector functions, made vector.rotate apply a rotation matrix, old vector.rotate is now called vector.rotate_around_axis * documented vector function changes * removed some whitespace to appease luacheck * implemented and fixed optimization of vector.rotate_around_axis by SmallJoker * added some unit tests for rotation vector functions * clarified that rotation vectors are in radians and according to the left hand rule * hopefully appeased luacheck * renamed rotation_to_horizontal to forward_at_rotation, rotation_to_vertical to up_at_rotation * handled cases where sin or cos are 0 in rotation vector functions * added more comments * clarified documentation of rotation vector functions * added more unit tests * changed way in which vector.rotate_around_axis is adjusted for left handed coordinate systems * made vector.rotate_around_axis actually left handed * unrolled matrix multiplication * removed vector.forward_at_rotation and vector.up_at_rotation * prettified vector.rotate_around_axis, made previous commits not break anything * removed references to removed vector.forward_at_rotation and vector.up_at_rotation * removed documentation of removed vector functions * clarified documentation and fixed styling of rotation vector functions * restyled comments minorly * spelling fixes and some hopefully better comments * allowed 'up' to be missing from vector.directions_to_rotation and removed requirement for unit vectors as arguments * made vector.rotate_around_axis() right handed again for consistency * documented previous changes * made matrix multiplication actually multiply * renamed vector.directions_to_rotation() to vector.dir_to_rotation() * optimized a distance comparison * Fixed potential false positive in unit tests. Co-authored-by: NetherEran <nethereran@hotmail.com>
* minetest.serialize: Reversible number serialization (#9722)HybridDog2020-04-22
| | | | | | | * minetest.serialize: Reversible number to string conversion The %a format is not supported in Lua 5.1. This commit also adds two tests for number serialization.
* Fix potential security issue(s), documentation on minetest.deserialize() (#9369)sfan52020-03-05
| | | Also adds an unittest
* Add Lua unit tests to builtin using busted (#9184)rubenwardy2020-01-18