From d69faa48529e312bd6c64f24db7179b793605061 Mon Sep 17 00:00:00 2001 From: Dejvino Date: Wed, 1 Feb 2017 01:37:19 +0100 Subject: [PATCH] Themeless: made map texture a grid, added grid-aligned rocks instead of grass. --- assets/Textures/map-high.png | Bin 0 -> 558 bytes assets/Textures/map-low.png | Bin 0 -> 559 bytes assets/Textures/map-mid.png | Bin 0 -> 559 bytes assets/Textures/solid-grass.png | Bin 1753 -> 0 bytes assets/Textures/solid-road.png | Bin 1795 -> 0 bytes assets/Textures/solid-stone.png | Bin 1860 -> 0 bytes src/roadtrip/RoadTrip.java | 9 +++- src/roadtrip/RoadTripPlanner.java | 9 +++- src/roadtrip/view/GameWorldView.java | 74 ++++++++++++++++++--------- src/roadtrip/view/HideControl.java | 43 ++++++++++++++-- src/roadtrip/view/TerrainView.java | 6 +-- 11 files changed, 106 insertions(+), 35 deletions(-) create mode 100644 assets/Textures/map-high.png create mode 100644 assets/Textures/map-low.png create mode 100644 assets/Textures/map-mid.png delete mode 100644 assets/Textures/solid-grass.png delete mode 100644 assets/Textures/solid-road.png delete mode 100644 assets/Textures/solid-stone.png diff --git a/assets/Textures/map-high.png b/assets/Textures/map-high.png new file mode 100644 index 0000000000000000000000000000000000000000..5752d57ca90cc0e7f63a2097662acd082101d0d2 GIT binary patch literal 558 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7uRSjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sDEfH31!Z9ZwBAbW|YuPggQMpjX6^YcMXKY&8AnIRD+&iT2y zsd*(pE(3#eQEFmIYKlU6W=V#EyQgnJie4%^(6V+<7srr_xVLvV@*Z*!U~qI6FLClp zy;kn1-Xd^`Gc_SmlJlWZn)*)tgwkJc_|E@+ZQELUCoO=rL7U;uJN|-wbGA)SocFx6 z&+yvHOy&n%4B-qrm=1_CtYatuDT!emD51M=AKZStYp>4!?alkYx3K0i$kf}$TxSD1 rt&jh~=ZBN+YX9FFBu-^o;Cq=VVW-qR5eBOVpt$mM^>bP0l+XkK&n>9o literal 0 HcmV?d00001 diff --git a/assets/Textures/map-low.png b/assets/Textures/map-low.png new file mode 100644 index 0000000000000000000000000000000000000000..7dc6c4b15e3ebb967d3820b516a01f338dec2ec3 GIT binary patch literal 559 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7uRSjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sDEfH31!Z9ZwBAbW|YuPggQMpjWRrQK7)L8i)PhD4M&=jZ08 z=9K`s3=Gaisfi`2DGKG8B^e6tp1uJoda3L{%Q`$=978JN-rn8Fd&oh6;b6O%fTW^p z5R>f%sfETa4yxD7T zQf;QK%w&GR#SjjX5oK7%P{7)t%@D&lP(o+lKDhlQDt_Ai+XwGgA8ImV=-V&1E*s>+ rXuReDGore-e7mighCnSmd4SaUb9TZufu6{1-oD!MgTe~DWM4f8{Mb2 literal 0 HcmV?d00001 diff --git a/assets/Textures/solid-grass.png b/assets/Textures/solid-grass.png deleted file mode 100644 index db8fca51ed0aead4935e1f8f92a8984aeadb6bc5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1753 zcmWkvdsNbC8vYOzvM3yPrpBx&XPR-QY`2Zgyn&;wIwraTQ6h??)riN-Pq~zelCzVI zdn{+n+`J@nN)#w;jyb7l+H|qaMK=+zpe0SLAh>3Lh~WPGKb;yAes{scO3m1;r?O3 zp7N@hC>Yw6Nj=4h$j#0^lf!|h07T@UN#mT!!1FUX-{PZU;u10f&Y%JCh>wX3r=FiO zH8QS@CTxjBe&Zf}FWcImGVyQxFYYUIw;0u3JepnH?7JSW4~?POAyYiD)VWgRJFw&! zo`&FLGTPFA)96~-7VYO%HliR@W*RP8FJ?XX_0YN87p1{PeoYS;*`>U-nl6WIz&O)X z$TV9zr!NA0|3Ger4SVtd13Fb#PaiPu8=kb%$f=EOjx{O9-AxFh-Y8=WREAi}?0NpW zdY#`yr$yW`M-gxU^}o?yr62R`TEi0a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dA$2otQ64Q|PxyCzaH@O+MoZx*bmt_k7%_eXJU!%Jsn5abnnM+;_UrVX&0J zeTU#OP)pa$g3e!D)Z~4Qu_Pob#aA>q`Ne>E>|vJ?)jgaRG+uS{M~>Czh9H5;bmrER zIxv61O+C{qA4~B1G*q@S3Hy(vdojN|eBP&5qVAyEFo^}*z6A>cY}FNktl(W@JHO@r zpnRFEKMXGwJ%i{LFOJ?vobRpTuA486hE>2ut@=HPe~@A8Y5S>-@3h_*x9k~?B< zl>S`*u1M8Y#xeVa_KCVfH`-0K?Pb%=F}0;g>q1eS2>!sAmyxVRKcS&TQBuG^nD%0p zcWgo(XjqQ1phf#}vP_{rand4FwU<%6CbZ-4ARG~-N8Mnxi7S23de+d=Iu4tGiK58}Cx{Nt{Td?I~|KwL&HEVZkg t>ohrcT+i42f$h6jtt_^zk%aZrM6sA`czF9aJpAQ=nB(L~`B$v6{{sO-VJH9q diff --git a/assets/Textures/solid-road.png b/assets/Textures/solid-road.png deleted file mode 100644 index 863bac7dd8935d805dd85339dbaf334536790403..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1795 zcmV+e2mJVnP)R$hzSZ`EtM|9?(BAI>(B$P|qg_5FKEzpY3u6cRgK=*;BcMyM{uo(gp$2YC3>xW2n`vuFgRD z)$aOybv##GWNPi<{=6VSH~_QGui7v-u3lYlSFcCw29y`0jzd^R|jyF$ZG$m@*XHIv`cRY0z?PU>grK5idz4liXE(ePsLQy zxqz$Z8w7|KFzW|XHcR#EyKH-^#!nR?-MWTd&J_d*0%(3MrG-=1Q?>nF^$MySNR0>R z#v23y(jMyo?s~dw)4F*AU7PCa5ZxHZUG)J~T_Fe%9l*<9pRQ#~*=RRrZ%XH=avHiW zK;i+?Y8+tN&!_!j%J%NgDO5R@o7WHo2nXe58Fj94p?*HlP3T{oK>i-P_Tpa<_8AjFf zKf5-ud)`@`fznNa06_r8ucd9Y8z--N7ph-Q=NhUUrF(u5AUeQ|f9mQ9XXW3kUI<+~ zdDplH0ipwF``D><_jc6-=w644RH7<{x@!m7J2-8I1Gt$%(^<6io;)ft(RB({Tc5Rn zG>rpLtemchQGLUyJO`?7BF&k)2%H*0X*CYu*79|2sGDK5nnAm5@Y#CG>i0o_aDY8A zZPZ@3lukf%hVFP#{dYN25a8+vu$pO8wRWejPvr>Qe==>Su;c`03?>jzU2P1XLp@dn-gshlDR5CrJWJT)#~-socDPRX>6N zS4RMPuimQdqiX2T=c{}4(EW3Dlj`vxKsW$fPrsXgPwNKVwFf#{cZx%};~O0y?R^eF zD{rn}>qg1aoP}B|abqwkJt3=sY5yUBYP(cFoT`X1<=@jWfV6(%#z=+(q}?OH+xIu= zukT;I9mjFQZ79tV-20zh%}lk~^j^YG5a8|j@nWQ1gabUb$v4@?y6fw^>JUst-KsX4 z-h;{10fGXT^#XprSvQNNt6DW358!$k)b*)62$%ar2S|I20ROiYx7M3U*)%F1fYSQa lya$(4xV4H`EeLS&_6=u@K?A(e{Wbsq002ovPDHLkV1o40aZ>;Q diff --git a/assets/Textures/solid-stone.png b/assets/Textures/solid-stone.png deleted file mode 100644 index f14e5032f5d1d7b0b0cfe266a0d56840d5b3a6e7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1860 zcmV-K2fO%*P)bo09AM6wMVy-` z3yH8l%sv_fK&s&jr}t5g_Y3vcFe-8ts#-9E0Xa z+57LhZzI6$2r%;DQ4*-e=CisxJCd_=5A@sz{ky1|7@fxmU=?sYf>x1L(~+_4o1fL) z)b(V2c=h}2=gtSP#Smc20jfHm_OY~Y?TUk_aRoKQD0;p_1aK5^;yA#Mw{M3pK-9;m zzOTvws~XVkhNr!e@6kUA0=#VAh_&dGu44C;4<3z3Di7hT=ZSCto8th( z&*}O3tgcn{bTzU_A)C72=>I5j0Gkn@?8B)_8C6GTeQ?)Y2A#u5$2W`sjsxU;2K|Ps zvHfiIvC2KDoWp9qgL?m-3$T4efM~TUJs&;N^^~fhI7D}ze^(q}bRHvsIl#5CdP=8L zx>$`H5O0D%(EON%bC=UAyt)T4q$snfUK{gbt}a! zs+{GsJD~&jr{XBS5#_R{H@^KDO$MyW<*X-=7h{_KpDEvFNIgqjfgT5!B~F*8*10V+5ET z0lISZx^mdmzJyUkqxuF`b$>SQkbT~c1K1v`fYAu!NXrvwSX9zu(;(*!=-)#|V(somrnrt?#Gm z__Nm~q}KkeB0^N{7y--y&h25N_VVrK7~S~*-Rm7><1j`5bAX;a^sFxJ>M=yk9niIU z>Y72>HH$nOXp3=xvsS+B>ic)K&Zl*H_Pp8u#|U5!!1Uyyb+#IJ$og2CPVvJBIsJdsu=-hM}VwvKdW}G z+xJp&1Zus6>h-AzVFWM&Xsozv-8{8MF&kr7>jEQ}y!ITeI&(~e6m_=q<767s5yv^1K2(X2N>zzst%@o`q{df>QSWTM`YJo+}kz+ z%#Hw5PGHnWR(ldr*OQISQ@WmBA%x-%Mu6E7pxP%-^{I62T(%ycK7N;xwSc$VvfOU( z+h4xEek6gmzt`@6dWZwiy=uDi`m;W~+qZU|ugYnx0zCS29Du6TqjL5rU9EBqHTF;V z@D8Lh0!%#mA98@G&b_L3kop}R+gH1t(>ay*KYzsWi~y64{NFeL?Zec#Le`h5Ifc~k zsQoI>`&XSGJ+Bd9!cqSL0kS%?YG>8%b>|?ea}(LRhRE}I^yf$aPb0vjBmXx9$m;Cs z$fDONqsgG@9J~7)%g_ndD?r!$hXXksu4`Ex{acX$0000 children; private boolean hidden; private BoundingVolume prevBv; + + private TargetProvider targetProvider; + public HideControl(float distanceToHide) { + this(distanceToHide, null); + } + + public HideControl(float distanceToHide, TargetProvider targetProvider) { + this.distanceToHide = distanceToHide; + this.targetProvider = targetProvider; + } + + public void setTargetProvider(TargetProvider targetProvider) + { + this.targetProvider = targetProvider; + } + @Override public Control cloneForSpatial(Spatial spatial) { @@ -29,8 +46,18 @@ public class HideControl extends AbstractControl @Override protected void controlRender(RenderManager rm, ViewPort vp) { - Camera cam = vp.getCamera(); - BoundingVolume bv = spatial.getWorldBound(); + if (targetProvider == null) { + final Camera cam = vp.getCamera(); + targetProvider = new TargetProvider() { + + @Override + public Vector3f getTarget() { + return cam.getLocation(); + } + }; + } + + /*BoundingVolume bv = spatial.getWorldBound(); if (bv == null) { bv = prevBv; @@ -38,9 +65,10 @@ public class HideControl extends AbstractControl prevBv = bv; } - float distance = bv.distanceTo(cam.getLocation()); + float distance = bv.distanceTo(targetProvider.getTarget());*/ + float distance = spatial.getWorldTranslation().distance(targetProvider.getTarget()); - if (distance > HideControl.DISTANCE_HIDE) { + if (distance > distanceToHide) { if (!hidden) { for (int i = 0; i < children.size(); i++) { children.get(i).removeFromParent(); @@ -74,4 +102,9 @@ public class HideControl extends AbstractControl children = new ArrayList<>(((Node) spatial).getChildren()); } + + public interface TargetProvider + { + Vector3f getTarget(); + } } diff --git a/src/roadtrip/view/TerrainView.java b/src/roadtrip/view/TerrainView.java index 733d7da..734d0b6 100644 --- a/src/roadtrip/view/TerrainView.java +++ b/src/roadtrip/view/TerrainView.java @@ -10,9 +10,9 @@ import roadtrip.model.TerrainDataProvider; public class TerrainView { public Material mat_terrain; public FineTerrainGrid terrainGrid; - public float grassScale = 64; - public float dirtScale = 64; - public float rockScale = 64; + public float texMidScale = 64; + public float texLowScale = 64; + public float texHighScale = 64; public TerrainDataProvider terrainDataProvider; public TerrainView(TerrainDataProvider terrainDataProvider) {