Difference between revisions of "Mods/vector extras"

From Minetest Developer Wiki
Jump to navigation Jump to search
(use a table)
Line 1: Line 1:
<source>vector.line([pos, dir[, range]])</source>
+
{| class="wikitable collapsible sortable"
table of vectors
+
! Function
 
+
! Return value
dir can be following
+
! Comments
 +
|-
 +
|<source enclose="none">vector.line([pos, dir[, range]])</source>
 +
| table of [[vector]]s
 +
| dir can be following
 
* a direction
 
* a direction
 
* a position (range not needed)
 
* a position (range not needed)
 
+
|-
 
+
|<source enclose="none">vector.fine_line([pos, dir[, range], scale])</source>
<source>vector.fine_line([pos, dir[, range], scale])</source>
+
| table of [[vector]]s
table of vectors
+
|
 
* like vector.line but more precise
 
* like vector.line but more precise
 
* needed for not round positions
 
* needed for not round positions
 
+
|-
 
+
|<source enclose="none">vector.straightdelay([s, v[, a]])</source>
<source>vector.straightdelay([s, v[, a]])</source>
+
| number
number
+
|
 
* s = length
 
* s = length
 
* v = velocity
 
* v = velocity
 
* a = acceleration (optional)
 
* a = acceleration (optional)
 
+
|-
 
+
|<source enclose="none">vector.sun_dir(t)</source>
<source>vector.sun_dir(t)</source>
+
| vector
vector
+
|
 
* t = timeofday
 
* t = timeofday
  
 
doesn't work right yet
 
doesn't work right yet
 
+
|-
 
+
|<source enclose="none">vector.inside(pos, minp, maxp)</source>
<source>vector.inside(pos, minp, maxp)</source>
+
| bool
bool
+
| untested
 +
|-
 +
|<source enclose="none">vector.minmax(p1, p2)</source>
 +
| vector, vector
 +
| the first vector's x, y and z are smaller than the second one's
  
 
untested
 
untested
 
+
|-
 
+
|<source enclose="none">vector.move(p1, p2, s)</source>
<source>vector.minmax(p1, p2)</source>
+
| vector
→ vector, vector
+
|
 
 
the first vector's x, y and z are smaller than the second one's
 
 
 
untested
 
 
 
<source>vector.move(p1, p2, s)</source>
 
vector
 
 
* s = length
 
* s = length
 +
* moves s to p2 from p1, made for rubenwardy
 +
* untested
 +
|}
  
moves s to p2 from p1, made for rubenwardy
+
[[Category:Mod]]

Revision as of 19:01, 24 February 2014

Function Return value Comments
vector.line([pos, dir[, range]]) table of vectors dir can be following
  • a direction
  • a position (range not needed)
vector.fine_line([pos, dir[, range], scale]) table of vectors
  • like vector.line but more precise
  • needed for not round positions
vector.straightdelay([s, v[, a]]) number
  • s = length
  • v = velocity
  • a = acceleration (optional)
vector.sun_dir(t) vector
  • t = timeofday

doesn't work right yet

vector.inside(pos, minp, maxp) bool untested
vector.minmax(p1, p2) vector, vector the first vector's x, y and z are smaller than the second one's

untested

vector.move(p1, p2, s) vector
  • s = length
  • moves s to p2 from p1, made for rubenwardy
  • untested