(rc *RenderComponent, sc *SpaceComponent)
| 241 | } |
| 242 | |
| 243 | func (s *blendmapShader) ShouldDraw(rc *RenderComponent, sc *SpaceComponent) bool { |
| 244 | tsc := SpaceComponent{ |
| 245 | Position: sc.Position, |
| 246 | Width: rc.Drawable.Width() * rc.Scale.X, |
| 247 | Height: rc.Drawable.Height() * rc.Scale.Y, |
| 248 | Rotation: sc.Rotation, |
| 249 | } |
| 250 | |
| 251 | c := tsc.Corners() |
| 252 | c[0].MultiplyMatrixVector(s.cullingMatrix) |
| 253 | c[1].MultiplyMatrixVector(s.cullingMatrix) |
| 254 | c[2].MultiplyMatrixVector(s.cullingMatrix) |
| 255 | c[3].MultiplyMatrixVector(s.cullingMatrix) |
| 256 | |
| 257 | return !((c[0].X < -1 && c[1].X < -1 && c[2].X < -1 && c[3].X < -1) || // All points left of the "viewport" |
| 258 | (c[0].X > 1 && c[1].X > 1 && c[2].X > 1 && c[3].X > 1) || // All points right of the "viewport" |
| 259 | (c[0].Y < -1 && c[1].Y < -1 && c[2].Y < -1 && c[3].Y < -1) || // All points above of the "viewport" |
| 260 | (c[0].Y > 1 && c[1].Y > 1 && c[2].Y > 1 && c[3].Y > 1)) // All points below of the "viewport" |
| 261 | } |
| 262 | |
| 263 | func (s *blendmapShader) bindTexturePack(tp *TexturePack) { |
| 264 | engo.Gl.ActiveTexture(engo.Gl.TEXTURE1) |
nothing calls this directly
no test coverage detected