Vector2 fract method description is wrong

I’m not sure what to write, tho. I don’t understand ‘fract’ :smile:

1 Like

When changed descriptions for Vector3 and Vector4, floor and fract would also need changing.

How about

    /**
     * Gets a new Vector2 from current Vector2 floored values
     * eg (1.2, 2.31, 1.54) returns (1, 2, 1)
     * @returns a new Vector2
     */
    public floor(): Vector2 {
        return new Vector2(Math.floor(this.x), Math.floor(this.y));
    }

    /**
     * Gets a new Vector2 from current Vector2 fractional values
     * eg (1.2, 2.31, 1.54) returns (0.2, 0.31, 0.54)
     * @returns a new Vector2
     */
    public fract(): Vector2 {
        return new Vector2(this.x - Math.floor(this.x), this.y - Math.floor(this.y));
    }
1 Like

Clear, like it.

Are you OK to do a PR?

Yes, sure :ok_hand::slightly_smiling_face:

1 Like