data-types
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
Next revision | |||
— | data-types [2020/01/23 13:38] – created maxime | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Data types ====== | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== boolean ==== | ||
+ | |||
+ | <file lua> | ||
+ | local value = true | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== integer ==== | ||
+ | |||
+ | Integer number | ||
+ | |||
+ | <file lua> | ||
+ | local value = 42 | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== float ==== | ||
+ | |||
+ | Floating-point number with single precision | ||
+ | |||
+ | <file lua> | ||
+ | local value = 17.44 | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== double ==== | ||
+ | |||
+ | Floating-point number with double precision | ||
+ | |||
+ | <file lua> | ||
+ | local value = -61.7267023355 | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== string ==== | ||
+ | |||
+ | <file lua> | ||
+ | local value = " | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== vec2i ==== | ||
+ | |||
+ | 2D integer vector | ||
+ | |||
+ | To initialize a '' | ||
+ | <file lua> | ||
+ | local value = { 54, 97 } | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== vec2f ==== | ||
+ | |||
+ | 2D float vector | ||
+ | |||
+ | To initialize a '' | ||
+ | <file lua> | ||
+ | local value = { 73.0, 15.66 } | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== vec3i ==== | ||
+ | |||
+ | 3D integer vector | ||
+ | |||
+ | To initialize a '' | ||
+ | <file lua> | ||
+ | local value = { 19, 86, 45 } | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== vec3f ==== | ||
+ | |||
+ | 3D float vector | ||
+ | |||
+ | To initialize a '' | ||
+ | <file lua> | ||
+ | local value = { -15.71, -71.0, 93.03 } | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== quaternion ==== | ||
+ | |||
+ | 4D float vector representing a rotation | ||
+ | |||
+ | To initialize a '' | ||
+ | <file lua> | ||
+ | local value = { 0.302268, 0.075567, 0.6347627, 0.7071068 } | ||
+ | </ | ||
+ | |||
+ | Quaternion properties can also be set with a '' | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== color ==== | ||
+ | |||
+ | A color is stored as four float numbers, representing the four channels. Each channel can have a value superior to 1, in case of HDR use. | ||
+ | |||
+ | To initialize a '' | ||
+ | <file lua> | ||
+ | local value = { 1, 0.549, 0, 0.9 } | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== polygon ==== | ||
+ | |||
+ | A 2D polygon is a list of 2D points ('' | ||
+ | |||
+ | To initialize a square polygon with a side length of '' | ||
+ | <file lua> | ||
+ | local value = { | ||
+ | { 5.5, 5.5 }, | ||
+ | { 5.5, -3.5 }, | ||
+ | { -3.5, -3.5 }, | ||
+ | { -3.5, 5.5 } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | You can also create simple polygons with the following functions: | ||
+ | |||
+ | * '' | ||
+ | |||
+ | ^ Name ^ Type ^ Description ^ | ||
+ | | //'' | ||
+ | | //'' | ||
+ | |||
+ | * '' | ||
+ | |||
+ | ^ Name ^ Type ^ Description ^ | ||
+ | | //'' | ||
+ | | //'' | ||
+ | | //'' | ||
data-types.txt · Last modified: 2023/09/14 14:52 by polymorphgames