feat: fromXYZ
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "computercraft-mutil",
|
"name": "computercraft-mutil",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"description": "",
|
"description": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"author": "",
|
"author": "",
|
||||||
|
|||||||
@@ -5,6 +5,10 @@ export class Vec3 {
|
|||||||
public z: number,
|
public z: number,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
|
public static fromXYZ({ x, y, z }: { x: number; y: number; z: number }) {
|
||||||
|
return new Vec3(x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
public dot(b: Vec3): number {
|
public dot(b: Vec3): number {
|
||||||
return this.x * b.x + this.y * b.y + this.z * b.z;
|
return this.x * b.x + this.y * b.y + this.z * b.z;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user