aboutsummaryrefslogtreecommitdiff
path: root/builtin/common/vector.lua
Commit message (Expand)AuthorAge
* Fix vector.from_string returning a table without vector metatableDesour2022-01-02
* Split vector.new into 3 constructorsDS2021-09-10
* Optimize vector length calculations (#11549)Lean Rada2021-08-27
* Add metatables to lua vectors (#11039)DS2021-06-04
* Add vector.to_string and vector.from_string (#10323)DS2021-04-05
* Add `math.round` and fix `vector.round` (#10803)Vincent Robinson2021-04-02
* Add vector.offset (#10321)DS2020-08-29
* Some vector functions useful for working with rotations (#9572)NetherEran2020-06-09
* Use vector.dot and vector.cross in vector.angleHybridDog2019-07-16
* Add vector.dot and vector.crossHybridDog2019-07-16
* Builtin: Add vector.angle(). Returns the angle between 2 vectors (#7738)ANAND2019-03-17
* Vector functions: Fix vector.direction() function, improve documentation (#6801)Paramat2017-12-21
* Vector: Add vector.sort(a, b): return box edgesAuke Kok2017-01-23
* Builtin: Add vector.floor helper functionrubenwardy2016-10-17
* Add Lua helper functions vector.apply(v) math.sign(x, tolerance)SmallJoker2014-12-06
* Remove vector assertionsShadowNinja2014-07-19
* Organize builtin into subdirectoriesShadowNinja2014-05-07
ss="hl kwa">false, NULL); # else pthread_cond_init(&cv, NULL); pthread_mutex_init(&mutex, NULL); notified = false; # endif #endif } #if __cplusplus < 201103L Event::~Event() { #ifdef _WIN32 CloseHandle(event); #else pthread_cond_destroy(&cv); pthread_mutex_destroy(&mutex); #endif } #endif void Event::wait() { #if __cplusplus >= 201103L MutexAutoLock lock(mutex); while (!notified) { cv.wait(lock); } notified = false; #elif defined(_WIN32) WaitForSingleObject(event, INFINITE); #else pthread_mutex_lock(&mutex); while (!notified) { pthread_cond_wait(&cv, &mutex); } notified = false; pthread_mutex_unlock(&mutex); #endif } void Event::signal() { #if __cplusplus >= 201103L MutexAutoLock lock(mutex); notified = true; cv.notify_one(); #elif defined(_WIN32) SetEvent(event); #else pthread_mutex_lock(&mutex); notified = true; pthread_cond_signal(&cv); pthread_mutex_unlock(&mutex); #endif }