All files / common/rage_modules vertex.mjs

66.03% Statements 35/53
100% Branches 3/3
40% Functions 2/5
66.03% Lines 35/53

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 561x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 9x 9x 9x 9x 9x 9x 9x 1x 1x           1x 1x           1x 1x                 1x 1x 1x 1x 1x      
import { Vector2, Vector3, Vector4 } from "./vector.mjs"
import { degToRad, radToDeg } from "./utils.mjs"
 
 
 
 
class Vertex2D {
    constructor(x, y){
        // CODE: INCOMPLETE
        // UNIT: FALSE
        // DOCS: FALSE
        this.position = new Vector2(x, y)     
    }
}
 
class Vertex3D {
    constructor(x, y, z){
        // CODE: INCOMPLETE
        // UNIT: FALSE
        // DOCS: FALSE
        this.position = new Vector3(x, y, z)
        this.uv = new Vector2(0, 0)
        this.normal = new Vector3(0, 0, 1 )        
    }
 
    setUV(x, y){
        // CODE: INCOMPLETE
        // UNIT: FALSE
        // DOCS: FALSE
        this.uv = new Vector2(x, y)
    }
 
    setNormal(v){
        // CODE: INCOMPLETE
        // UNIT: FALSE
        // DOCS: FALSE
        this.normal = v
    }
 
    clone(){
        // CODE: INCOMPLETE
        // UNIT: FALSE
        // DOCS: FALSE
        const newVertex = new Vertex3D(this.position.x, this.position.y, this.position.z)
        newVertex.setUV(this.uv.x, this.uv.y)
        newVertex.setNormal(this.normal)
        return newVertex
    }
}
 
 
 
export { Vertex2D, Vertex3D, Vector2, Vector3, Vector4, degToRad, radToDeg }