precomputed shade algo, viewport basic render
This commit is contained in:
@ -10,7 +10,7 @@ func (c *Coords) Get() (int, int) {
|
||||
return c.X, c.Y
|
||||
}
|
||||
|
||||
func (c *Coords) DistanceTo(o *Coords) float64 {
|
||||
func (c *Coords) DistanceTo(o Coords) float64 {
|
||||
dx := c.X - o.X
|
||||
dy := c.X - o.Y
|
||||
return math.Sqrt(math.Pow(float64(dx), 2) + math.Pow(float64(dy), 2))
|
||||
|
@ -56,6 +56,6 @@ func (self *Rect) Intersects(other *Rect) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (r *Rect) InBounds (x,y int) bool {
|
||||
return x >= r.X && x <= (r.X + r.W) && y >= r.Y && y <= (r.Y + r.H)
|
||||
func (r *Rect) InBounds (c Coords) bool {
|
||||
return c.X >= r.X && c.X <= (r.X + r.W -1) && c.Y >= r.Y && c.Y <= (r.Y + r.H -1)
|
||||
}
|
Reference in New Issue
Block a user