From 18740c4c2bfe51f8c2693982d60c233c4c00fae6 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Sun, 30 Jan 2022 16:12:46 -0600 Subject: [PATCH] Restore depricated method in PatchBlockModel --- .../modsupport/impl/PatchBlockModelImpl.java | 15 ++++++++-- .../dynmap/modsupport/PatchBlockModel.java | 30 +++++++++++++++++++ 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/DynmapCore/src/main/java/org/dynmap/modsupport/impl/PatchBlockModelImpl.java b/DynmapCore/src/main/java/org/dynmap/modsupport/impl/PatchBlockModelImpl.java index 80f26e16..b94a4e5f 100644 --- a/DynmapCore/src/main/java/org/dynmap/modsupport/impl/PatchBlockModelImpl.java +++ b/DynmapCore/src/main/java/org/dynmap/modsupport/impl/PatchBlockModelImpl.java @@ -45,13 +45,22 @@ public class PatchBlockModelImpl extends BlockModelImpl implements PatchBlockMod patches.add(pi); return pi; } - + @Override + @Deprecated public String addPatch(double x0, double y0, double z0, double xu, double yu, - double zu, double xv, double yv, double zv, SideVisible sidevis) { - return addPatch(x0, y0, z0, xu, yu, zu, xv, yv, zv, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, sidevis); + double zu, double xv, double yv, double zv, double umin, + double umax, double vmin, double vmax, double uplusvmax, + SideVisible sidevis) { + return addPatch(x0, y0, z0, xu, yu, zu, xv, yv, zv, umin, umax, vmin, vmin, vmax, ((uplusvmax - umax) < vmax) ? uplusvmax - umax : vmax, sidevis); } + @Override + public String addPatch(double x0, double y0, double z0, double xu, double yu, double zu, double xv, double yv, + double zv, SideVisible sidevis) { + return addPatch(x0, y0, z0, xu, yu, zu, xv, yv, zv, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, sidevis); + } + @Override public String addPatch(double x0, double y0, double z0, double xu, double yu, double zu, double xv, double yv, double zv) { diff --git a/DynmapCoreAPI/src/main/java/org/dynmap/modsupport/PatchBlockModel.java b/DynmapCoreAPI/src/main/java/org/dynmap/modsupport/PatchBlockModel.java index 38aa6946..af967a7c 100644 --- a/DynmapCoreAPI/src/main/java/org/dynmap/modsupport/PatchBlockModel.java +++ b/DynmapCoreAPI/src/main/java/org/dynmap/modsupport/PatchBlockModel.java @@ -6,6 +6,36 @@ import org.dynmap.renderer.RenderPatchFactory.SideVisible; * Patch block model */ public interface PatchBlockModel extends BlockModel { + /** + * Add patch with given attributes. + * + * Definition is a 2D parallelogram surface, with origin <x0,y0,z0> within the block, and defined by two edge vectors - + * one with and end point of <xu,yu,zu>, and a second with an end point of <xv,yv,zv>. The patch is + * defined within the unit vector range umin to umax (parallel to the U vecotr) and vmin to vmax + * (parallel to the V vector). + * The surface can be visible via one side (SideVisible.TOP, SideVisible.BOTTOM) or both sides (SideVisible.BOTH). + * + * @param x0 - X coordinate of origin of patch + * @param y0 - Y coordinate of origin of patch + * @param z0 - Z coordinate of origin of patch + * @param xu - X coordinate of end of U vector + * @param yu - Y coordinate of end of U vector + * @param zu - Z coordinate of end of U vector + * @param xv - X coordinate of end of V vector + * @param yv - Y coordinate of end of V vector + * @param zv - Z coordinate of end of V vector + * @param umin - lower bound for visibility along U vector (use 0.0 by default) + * @param umax - upper bound for visibility along U vector (use 1.0 by default) + * @param vmin - lower bound for visibility along V vector (use 0.0 by default) + * @param vmax - upper bound for visibility along V vector (use 1.0 by default) + * @param uplusvmax - upper bound for visibility for U+V (use 100.0 by default: <=1.0 for triangle) + * @param sidevis - Controls which sides of the surface are visible (U cross V defines normal - TOP is from that side, BOTTOM is opposite side) + * @return patch ID + */ + @Deprecated + public String addPatch(double x0, double y0, double z0, double xu, + double yu, double zu, double xv, double yv, double zv, double umin, + double umax, double vmin, double vmax, double uplusvmax, SideVisible sidevis); /** * Add patch with given attributes. *