mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 11:48:55 +01:00
Hide Color.Dim / Geometry.Dim
This commit is contained in:
parent
05c0cb5531
commit
4c79f1bccd
@ -1,13 +1,13 @@
|
|||||||
package matrix
|
package matrix
|
||||||
|
|
||||||
type affine interface {
|
type affine interface {
|
||||||
Dim() int
|
dim() int
|
||||||
element(i, j int) float64
|
element(i, j int) float64
|
||||||
setElement(i, j int, element float64)
|
setElement(i, j int, element float64)
|
||||||
}
|
}
|
||||||
|
|
||||||
func isIdentity(matrix affine) bool {
|
func isIdentity(matrix affine) bool {
|
||||||
dim := matrix.Dim()
|
dim := matrix.dim()
|
||||||
for i := 0; i < dim-1; i++ {
|
for i := 0; i < dim-1; i++ {
|
||||||
for j := 0; j < dim; j++ {
|
for j := 0; j < dim; j++ {
|
||||||
element := matrix.element(i, j)
|
element := matrix.element(i, j)
|
||||||
@ -22,8 +22,8 @@ func isIdentity(matrix affine) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func mul(lhs, rhs, result affine) {
|
func mul(lhs, rhs, result affine) {
|
||||||
dim := lhs.Dim()
|
dim := lhs.dim()
|
||||||
if dim != rhs.Dim() {
|
if dim != rhs.dim() {
|
||||||
panic("diffrent-sized matrices can't be multiplied")
|
panic("diffrent-sized matrices can't be multiplied")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ func ColorI() Color {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (matrix *Color) Dim() int {
|
func (matrix *Color) dim() int {
|
||||||
return ColorDim
|
return ColorDim
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ func GeometryI() Geometry {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (matrix *Geometry) Dim() int {
|
func (matrix *Geometry) dim() int {
|
||||||
return GeometryDim
|
return GeometryDim
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user