Vector: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (fix see also)
m (fix typo)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
A '''vector''' can be used to represent a position in the 2D or 3D world. The types of vectors are:
A '''vector''' represents a [http://en.wikipedia.org/wiki/Euclidean_vector Euclidean vector], which can be used to work with positions or directions in a 2D plane or 3D space. The classes of vectors available in MTA are:


{{Vectors}}
{{Vectors}}
'''Tip''': if you are using vectors a lot, you can use ''collectgarbage("setpause",100)'' to tell Lua to garbage collect intermediary vectors frequently. Run that once per resource (or just in the resource you need it for). This has other performance implications as Lua will be stopping the world more frequently.


== See also ==
== See also ==
Line 7: Line 9:
* [[OOP Introduction]]
* [[OOP Introduction]]
* [[Matrix]]
* [[Matrix]]
[[Category:OOP]]

Latest revision as of 04:21, 5 September 2018

A vector represents a Euclidean vector, which can be used to work with positions or directions in a 2D plane or 3D space. The classes of vectors available in MTA are:

Tip: if you are using vectors a lot, you can use collectgarbage("setpause",100) to tell Lua to garbage collect intermediary vectors frequently. Run that once per resource (or just in the resource you need it for). This has other performance implications as Lua will be stopping the world more frequently.

See also