Skip to content

Commit c3046fb

Browse files
committed
Added docs comments
1 parent 0d22237 commit c3046fb

File tree

12 files changed

+60
-0
lines changed

12 files changed

+60
-0
lines changed

src/main/scala/vecmatlib/Double2.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,10 @@ trait Double2 {
1919
*/
2020
def y: Double
2121

22+
/**
23+
* Returns an array of length 2 containing the x and y components of this tuple.
24+
*
25+
* @return An array of length 2 containing the x and y components of this tuple
26+
*/
2227
def toArray: Array[Double] = Array(this.x, this.y)
2328
}

src/main/scala/vecmatlib/Double3.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,10 @@ trait Double3 extends Double2 {
1212
*/
1313
def z: Double
1414

15+
/**
16+
* Returns an array of length 3 containing the x, y, and z components of this tuple.
17+
*
18+
* @return An array of length 3 containing the x, y and z components of this tuple
19+
*/
1520
override def toArray: Array[Double] = Array(this.x, this.y, this.z)
1621
}

src/main/scala/vecmatlib/Double4.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,10 @@ trait Double4 extends Double3 {
1212
*/
1313
def w: Double
1414

15+
/**
16+
* Returns an array of length 4 containing the x, y, z, and w components of this tuple.
17+
*
18+
* @return An array of length 4 containing the x, y, z, and w components of this tuple
19+
*/
1520
override def toArray: Array[Double] = Array(this.x, this.y, this.z, this.w)
1621
}

src/main/scala/vecmatlib/Float2.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,10 @@ trait Float2 {
1919
*/
2020
def y: Float
2121

22+
/**
23+
* Returns an array of length 2 containing the x and y components of this tuple.
24+
*
25+
* @return An array of length 2 containing the x and y components of this tuple
26+
*/
2227
def toArray: Array[Float] = Array(this.x, this.y)
2328
}

src/main/scala/vecmatlib/Float3.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,10 @@ trait Float3 extends Float2 {
1212
*/
1313
def z: Float
1414

15+
/**
16+
* Returns an array of length 3 containing the x, y, and z components of this tuple.
17+
*
18+
* @return An array of length 3 containing the x, y and z components of this tuple
19+
*/
1520
override def toArray: Array[Float] = Array(this.x, this.y, this.z)
1621
}

src/main/scala/vecmatlib/Float4.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,10 @@ trait Float4 extends Float3 {
1212
*/
1313
def w: Float
1414

15+
/**
16+
* Returns an array of length 4 containing the x, y, z, and w components of this tuple.
17+
*
18+
* @return An array of length 4 containing the x, y, z, and w components of this tuple
19+
*/
1520
override def toArray: Array[Float] = Array(this.x, this.y, this.z, this.w)
1621
}

src/main/scala/vecmatlib/Int2.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,10 @@ trait Int2 {
1919
*/
2020
def y: Int
2121

22+
/**
23+
* Returns an array of length 2 containing the x and y components of this tuple.
24+
*
25+
* @return An array of length 2 containing the x and y components of this tuple
26+
*/
2227
def toArray: Array[Int] = Array(this.x, this.y)
2328
}

src/main/scala/vecmatlib/Int3.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,10 @@ trait Int3 extends Int2 {
1212
*/
1313
def z: Int
1414

15+
/**
16+
* Returns an array of length 3 containing the x, y, and z components of this tuple.
17+
*
18+
* @return An array of length 3 containing the x, y and z components of this tuple
19+
*/
1520
override def toArray: Array[Int] = Array(this.x, this.y, this.z)
1621
}

src/main/scala/vecmatlib/Int4.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,10 @@ trait Int4 extends Int3 {
1212
*/
1313
def w: Int
1414

15+
/**
16+
* Returns an array of length 4 containing the x, y, z, and w components of this tuple.
17+
*
18+
* @return An array of length 4 containing the x, y, z, and w components of this tuple
19+
*/
1520
override def toArray: Array[Int] = Array(this.x, this.y, this.z, this.w)
1621
}

src/main/scala/vecmatlib/vector/VecDouble.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,5 +151,10 @@ abstract class VecDouble[V <: VecDouble[V]] extends VecAbstract[V] {
151151
*/
152152
def lerp(to: V, weight: Double): V = (this * (1.0 - weight)) + (to * weight)
153153

154+
/**
155+
* Returns an array containing all the elements of this vector.
156+
*
157+
* @return An array containing all the elements of this vector
158+
*/
154159
def toArray: Array[Double]
155160
}

0 commit comments

Comments
 (0)