![]() |
The Agent Tool
1.01
An Agent Based Graphic Sound Synthesis Environment
|
A Vec2 represents a pair of numbers that can be represent a either a two dimensional point or a vector. More...
#include <Vec2.hpp>
Public Member Functions | |
Vec2 | new () |
A default constructor will provide you Vec2 with pair 0 0. | |
Vec2 | operator+ (Vec2 r) |
Allows the addition of two Vec2's. | |
Vec2 | operator+ (float r) |
Allows the scalar addition of a Vec2 affecting both components. | |
Vec2 | operator+ (int r) |
Allows the scalar addition of a Vec2 affecting both components. | |
Vec2 | operator- (Vec2 r) |
Allows the subtraction of one Vec2 from another. | |
Vec2 | operator- (float r) |
Allows the subtraction of a scalar value from a Vec2 affecting both components. | |
Vec2 | operator- (int r) |
Allows the subtraction of a scalar value from a Vec2 affecting both components. | |
Vec2 | operator* (float r) |
Allows the scalar multiplication of a Vec2. | |
Vec2 | operator* (int r) |
Allows the scalar multiplication of a Vec2. | |
Vec2 | operator/ (float r) |
Allows the division of a Vec2. | |
float | mag () |
Vec2 | norm () |
Vec2 | perp () |
float | dot (const Vec2 &v) const |
bool | operator== (const Vec2 &r) const |
A Vec2 represents a pair of numbers that can be represent a either a two dimensional point or a vector.
To create a Vec2 in Lua you must call Vec2.new() to create an instance of this object. To execute on of the classes functions you must utilize a colon followed by the name ot the function. For example point:x() You can consequently set the x and y components via this mechanism. point:x() = 10
float Vec2::mag | ( | ) |
Vec2 Vec2::new | ( | ) | [inline] |
A default constructor will provide you Vec2 with pair 0 0.
Allows the construction of with a pair of floating point numbers.
Vec2 Vec2::operator* | ( | float | r | ) |
Vec2 Vec2::operator* | ( | int | r | ) |
Allows the addition of two Vec2's.
Vec2 Vec2::operator+ | ( | float | r | ) |
Vec2 Vec2::operator+ | ( | int | r | ) |
Vec2 Vec2::operator- | ( | float | r | ) |
Vec2 Vec2::operator- | ( | int | r | ) |
Vec2 Vec2::operator/ | ( | float | r | ) |