Vec:clamp(num) -> if self magnitude is higher than provided limit, scale self down to match it Vec:scale(num) -> multiplies self components by a numeric factor Vec:scale(otherVec) -> multiplies self components by corresponding compnents from otherVec Vec:sub(otherVec) -> subtracts components of otherVec from self Vec:add(otherVec) -> adds components of otherVec to self Vec:set(num, num, num) -> set x, y, z components to passed values Vec:setAt(key, num) -> same as "vec = num" Methods modifying self and returning self: Vec:get() => num, num, num -> returns x, y, z components of self Vec.x, vec.y, vec.z -> read/write component Vec:copy() -> copy self into a new vector and retur it Vector.between(vec1, vec2) -> return a vector pointing from vec1 to vec2 Vector.min(vec1, vec2) -> return a vector with min components between vec1 and vec2 Vector.max(vec1, vec2) -> return a vector with max components between vec1 and vec2 Vector(table) -> return a vector with x/y/z or 1/2/3 conponents from source table (x/y/z first) Vector(num, num, num) -> return a vector with specified (x, y, z) components
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |