/*
- * Sixth 3D engine. Copyright ©2012-2016, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
+ * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 3 of the GNU Lesser General Public License
import eu.svjatoslav.sixth.e3d.geometry.Point2D;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
-import eu.svjatoslav.sixth.e3d.geometry.Polygon;
import eu.svjatoslav.sixth.e3d.gui.RenderingContext;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.AbstractCoordinateShape;
import eu.svjatoslav.sixth.e3d.renderer.raster.slicer.PolygonCoordinate;
import java.awt.*;
+import static eu.svjatoslav.sixth.e3d.geometry.Polygon.pointWithinPolygon;
+
public class TexturedPolygon extends AbstractCoordinateShape {
public final Texture texture;
x2 = renderBuffer.width - 1;
int renderBufferOffset = ((y * renderBuffer.width) + x1) * 4;
- final byte[] renderBufferBytes = renderBuffer.bytes;
+ final byte[] renderBufferBytes = renderBuffer.pixels;
final double twidth = tx2 - tx1;
final double theight = ty2 - ty1;
projectedPoint3.roundToInteger();
if (mouseInteractionController != null)
- if (renderBuffer.mouseClick != null)
- if (Polygon.pointWithinPolygon(
- renderBuffer.mouseClick.coordinate, projectedPoint1,
+ if (renderBuffer.mouseEvent != null)
+ if (pointWithinPolygon(
+ renderBuffer.mouseEvent.coordinate, projectedPoint1,
projectedPoint2, projectedPoint3))
- renderBuffer.clickedItem = mouseInteractionController;
+ renderBuffer.objectUnderMouse = mouseInteractionController;
// Show polygon boundaries (for debugging)
if (showBorders)