Giter Site home page Giter Site logo

vector.lua's Introduction

Vector.lua

A Vector3 class
Can be used to create 3d games & 2d games (use 3rd coordinate as depth)
I use this in gmod, luvit, love2d

Example:

image

local mins = Vector(13, 50)
mins.abscissa = 17 -- alias support
mins.ord = 53

local maxs = Vector(75, 25)
maxs.x = 46
maxs[2] = 28

print(
	"from incredible-gmod.ru with <3",
	"\n\t".. mins,
	"\n\t meta events: ".. mins + (maxs - mins) * 0.5,
	"\n\t 5.3 events support (even in lua 5.1): ".. #mins,
	"\n\t normal: ".. mins:GetNormal(),
	"\n\t distance: ".. mins:Distance(maxs),
	"\n\t distance to square: ".. mins:DistanceToSqr(maxs),
	"\n\t dot product: ".. mins:Dot(maxs),
	"\n\t angle: ".. mins:Angle(maxs),
	"\n\t lerp: ".. mins:Lerp(0.5, maxs),
	"\n\t approach: ".. mins:Approach(50, maxs),
	"\nand alot of more useful things!"
)

vector.lua's People

Contributors

be1zebub avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.