Difference between revisions of "Mods/vector extras"

From Minetest Developer Wiki
Jump to navigation Jump to search
m (nl)
Line 50: Line 50:
 
* made for rubenwardy
 
* made for rubenwardy
 
| untested
 
| untested
 +
|-
 +
|<source enclose="none">vector.explosion_table(r)</source>
 +
| table
 +
|
 +
* r = radius
 +
* returns sth like <source enclose="none">{{pos1, true}, {pos2}}</source>
 +
| works
 +
|-
 +
|<source enclose="none">vector.circle(r)</source>
 +
| table of [[vector]]s
 +
|
 +
* r = radius
 +
| works
 +
|-
 +
|<source enclose="none">vector.ring(r)</source>
 +
| table of [[vector]]s
 +
|
 +
* r = radius
 +
* r can be float
 +
* each positions "touch" their next ones
 +
| works
 
|}
 
|}
  
 
[[Category:Mod]]
 
[[Category:Mod]]

Revision as of 14:26, 3 March 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 returns true if pos is inside or on the corners of minp and maxp 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
vector.explosion_table(r) table
  • r = radius
  • returns sth like {{pos1, true}, {pos2}}
works
vector.circle(r) table of vectors
  • r = radius
works
vector.ring(r) table of vectors
  • r = radius
  • r can be float
  • each positions "touch" their next ones
works