Difference between revisions of "Mods/vector extras"

From Minetest Developer Wiki
Jump to navigation Jump to search
(use a table)
Line 3: Line 3:
 
! Return value
 
! Return value
 
! Comments
 
! Comments
 +
! Status
 
|-
 
|-
 
|<source enclose="none">vector.line([pos, dir[, range]])</source>
 
|<source enclose="none">vector.line([pos, dir[, range]])</source>
Line 9: Line 10:
 
* a direction
 
* a direction
 
* a position (range not needed)
 
* a position (range not needed)
 +
| works
 
|-
 
|-
 
|<source enclose="none">vector.fine_line([pos, dir[, range], scale])</source>
 
|<source enclose="none">vector.fine_line([pos, dir[, range], scale])</source>
Line 15: Line 17:
 
* like vector.line but more precise
 
* like vector.line but more precise
 
* needed for not round positions
 
* needed for not round positions
 +
| works but slow
 
|-
 
|-
 
|<source enclose="none">vector.straightdelay([s, v[, a]])</source>
 
|<source enclose="none">vector.straightdelay([s, v[, a]])</source>
Line 22: Line 25:
 
* v = velocity
 
* v = velocity
 
* a = acceleration (optional)
 
* a = acceleration (optional)
 +
| works
 
|-
 
|-
 
|<source enclose="none">vector.sun_dir(t)</source>
 
|<source enclose="none">vector.sun_dir(t)</source>
Line 27: Line 31:
 
|
 
|
 
* t = timeofday
 
* t = timeofday
 
+
| doesn't work right yet
doesn't work right yet
 
 
|-
 
|-
 
|<source enclose="none">vector.inside(pos, minp, maxp)</source>
 
|<source enclose="none">vector.inside(pos, minp, maxp)</source>
 
| bool
 
| bool
 +
|
 
| untested
 
| untested
 
|-
 
|-
Line 37: Line 41:
 
| vector, vector
 
| vector, vector
 
| the first vector's x, y and z are smaller than the second one's
 
| 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 enclose="none">vector.move(p1, p2, s)</source>
Line 45: Line 48:
 
* s = length
 
* s = length
 
* moves s to p2 from p1, made for rubenwardy
 
* moves s to p2 from p1, made for rubenwardy
* untested
+
| untested
 
|}
 
|}
  
 
[[Category:Mod]]
 
[[Category:Mod]]

Revision as of 19:04, 24 February 2014

Function Return value Comments Status
vector.line([pos, dir[, range]]) table of vectors dir can be following
  • a direction
  • a position (range not needed)
works
vector.fine_line([pos, dir[, range], scale]) table of vectors
  • like vector.line but more precise
  • needed for not round positions
works but slow
vector.straightdelay([s, v[, a]]) number
  • s = length
  • v = velocity
  • a = acceleration (optional)
works
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