Moved types to top of files, started 2D texture mapped font rendering.

This commit is contained in:
Marvin Blum
2016-07-16 02:31:53 +02:00
parent 67571025e9
commit ed39081300
11 changed files with 281 additions and 180 deletions

14
pos.go
View File

@@ -8,6 +8,13 @@ type Pos2D struct {
M Mat3
}
// Position component for 3D objects
type Pos3D struct {
Pos, Size, Scale, RotPoint, Rot Vec3
Visible bool
M Mat4
}
// Creates a default initialized Pos2D.
func NewPos2D() *Pos2D {
m := Mat3{}
@@ -38,13 +45,6 @@ func (p *Pos2D) PointInRect(point Vec2) bool {
return point.X > p.Pos.X && point.X < p.Pos.X+p.Size.X*p.Scale.X && point.Y > p.Pos.Y && point.Y < p.Pos.Y+p.Size.Y*p.Scale.Y
}
// Position component for 3D objects
type Pos3D struct {
Pos, Size, Scale, RotPoint, Rot Vec3
Visible bool
M Mat4
}
// Creates a default initialized Pos3D.
func NewPos3D() *Pos3D {
m := Mat4{}