BIG FORMATING COMMIT
This commit is contained in:
@@ -7,14 +7,14 @@ import lib.Vec.Vec3;
|
||||
Basicly a wrapper for Vec3<Float> with some extra functions.
|
||||
`Y` represents the height of the point.
|
||||
**/
|
||||
@:forward(x,y,z)
|
||||
abstract Pos3(Vec3<Float>) from Vec3<Float> to Vec3<Float>{
|
||||
@:forward(x, y, z)
|
||||
abstract Pos3(Vec3<Float>) from Vec3<Float> to Vec3<Float> {
|
||||
inline public function new(i:Vec3<Float>) {
|
||||
this = i;
|
||||
}
|
||||
|
||||
@:op(A + B)
|
||||
public function add(rhs: Vec3<Float>):Pos3 {
|
||||
public function add(rhs:Vec3<Float>):Pos3 {
|
||||
return new Pos3({
|
||||
y: this.y + rhs.y,
|
||||
x: this.x + rhs.x,
|
||||
@@ -23,7 +23,7 @@ abstract Pos3(Vec3<Float>) from Vec3<Float> to Vec3<Float>{
|
||||
}
|
||||
|
||||
@:op(A - B)
|
||||
public function sub(rhs: Vec3<Float>):Pos3 {
|
||||
public function sub(rhs:Vec3<Float>):Pos3 {
|
||||
return new Pos3({
|
||||
y: this.y - rhs.y,
|
||||
x: this.x - rhs.x,
|
||||
@@ -32,7 +32,7 @@ abstract Pos3(Vec3<Float>) from Vec3<Float> to Vec3<Float>{
|
||||
}
|
||||
|
||||
@:op(A * B)
|
||||
public function multiplyScalar(rhs: Float): Pos3 {
|
||||
public function multiplyScalar(rhs:Float):Pos3 {
|
||||
return new Pos3({
|
||||
y: this.y * rhs,
|
||||
x: this.x * rhs,
|
||||
@@ -41,7 +41,7 @@ abstract Pos3(Vec3<Float>) from Vec3<Float> to Vec3<Float>{
|
||||
}
|
||||
|
||||
@:op(A / B)
|
||||
public function divideScalar(rhs: Float): Pos3 {
|
||||
public function divideScalar(rhs:Float):Pos3 {
|
||||
return new Pos3({
|
||||
y: this.y / rhs,
|
||||
x: this.x / rhs,
|
||||
@@ -50,7 +50,7 @@ abstract Pos3(Vec3<Float>) from Vec3<Float> to Vec3<Float>{
|
||||
}
|
||||
|
||||
@:op(-A)
|
||||
public function negate(): Pos3 {
|
||||
public function negate():Pos3 {
|
||||
return new Pos3({
|
||||
y: -this.y,
|
||||
x: -this.x,
|
||||
@@ -58,11 +58,11 @@ abstract Pos3(Vec3<Float>) from Vec3<Float> to Vec3<Float>{
|
||||
});
|
||||
}
|
||||
|
||||
public function dot(rhs: Vec3<Float>): Float {
|
||||
public function dot(rhs:Vec3<Float>):Float {
|
||||
return this.x * rhs.x + this.y * rhs.y + this.z * rhs.z;
|
||||
}
|
||||
|
||||
public function cross(rhs: Vec3<Float>):Pos3 {
|
||||
public function cross(rhs:Vec3<Float>):Pos3 {
|
||||
return new Pos3({
|
||||
x: this.y * rhs.z - this.z * rhs.y,
|
||||
y: this.z * rhs.x - this.x * rhs.z,
|
||||
|
||||
Reference in New Issue
Block a user