Advertisement
theosib

Entities glitching into walls

Jan 5th, 2018
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.70 KB | None | 0 0
  1. Correct entity width: 0.6
  2.  
  3. *** First we move an entity around the way vanilla code does and see the problem...
  4.  
  5. Starting out at some place in the world:
  6.  
  7. Xmin=1.8,Xmax=2.4000000238418577,w=0.6000000238418577
  8. Xcenter=2.1000000119209288
  9.  
  10. Have the entity get shoved around for a while...
  11.  
  12. Shifting Xmin and Xmax both by:
  13. +0.01562500000000011
  14. +0.015625000000000114
  15. +0.01562500000000011
  16. +0.015625000000000114
  17. +0.01562500000000011
  18. +0.015625000000000114
  19. +0.01562500000000011
  20. +0.015625000000000114
  21. +0.01562500000000011
  22. +0.015625000000000114
  23. +0.01562500000000011
  24. +0.015625000000000114
  25. +0.015625000000000003
  26. +0.015625000000000222
  27.  
  28. Finally ended up at:
  29. Xmin=2.0187500000000034,Xmax=2.6187500238418577,w=0.6000000238418544
  30. Xcenter=2.3187500119209306
  31. new width is 0.6000000238418544, 3.552713678800501E-15 smaller than it should be
  32.  
  33. Imagine it got shoved one last time, against a wall to the west:
  34. New bounding box and computed center:
  35. Xmin=2.0,Xmax=2.6000000238418544,w=0.6000000238418544
  36. Xcenter=2.300000011920927
  37.  
  38. Only the center is saved to disk. When reloaded, we get this:
  39. Reloaded center and computed faces:
  40. Xcenter=2.300000011920927
  41. Xmin=1.9999999999999982,Xmax=2.600000023841856,w=0.6000000238418579
  42. The west face now intersects the wall by -1.7763568394002505E-15
  43.  
  44. Imagine instead it got shoved one last time, against a wall to the east:
  45. New bounding box and computed center:
  46. Xmin=2.3999999761581456,Xmax=3.0,w=0.6000000238418544
  47. Xcenter=2.699999988079073
  48.  
  49. Only the center is saved to disk. When reloaded, we get this:
  50. Reloaded center and computed faces:
  51. Xcenter=2.699999988079073
  52. Xmin=2.399999976158144,Xmax=3.0000000000000018,w=0.6000000238418579
  53. The east face now intersects the wall by 1.7763568394002505E-15
  54.  
  55.  
  56. *** Now try again with code that maintains consistency between bounds and center...
  57.  
  58. Starting out at some place in the world:
  59.  
  60. Xmin=1.8,Xmax=2.4000000238418577,w=0.6000000238418577
  61. Xcenter=2.1000000119209288
  62.  
  63. Have the entity get shoved around for a while...
  64.  
  65. Shifting Xmin and Xmax both by:
  66. +0.01562500000000011
  67. +0.015625000000000114
  68. +0.015625000000000114
  69. +0.015625000000000114
  70. +0.015625000000000114
  71. +0.015625000000000114
  72. +0.015625000000000114
  73. +0.015625000000000114
  74. +0.015625000000000114
  75. +0.015625000000000114
  76. +0.015625000000000114
  77. +0.015625000000000114
  78. -0.015625000000000226
  79. +0.015625000000000114
  80. -0.015625000000000222
  81. +0.015625000000000114
  82. -0.015625000000000226
  83. +0.015625000000000114
  84. -0.015625000000000222
  85. +0.015625000000000114
  86. -0.015625000000000226
  87. +0.015625000000000114
  88. -0.015625000000000222
  89. +0.015625000000000114
  90. -0.015625000000000226
  91. +0.015625000000000114
  92. -0.015625000000000222
  93. +0.015625000000000114
  94. -0.015625000000000226
  95. +0.015625000000000114
  96. -0.015625000000000222
  97. +0.015625000000000114
  98. -0.015625000000000226
  99. +0.015625000000000114
  100. -0.015625000000000222
  101. +0.015625000000000114
  102. -0.015625000000000226
  103. +0.015625000000000114
  104. -0.015625000000000222
  105. +0.015625000000000114
  106. -0.015625000000000226
  107. +0.015625000000000114
  108. -0.015625000000000222
  109. +0.015625000000000114
  110. -0.015625000000000226
  111. +0.015625000000000114
  112. -0.015625000000000222
  113. +0.015625000000000114
  114. -0.015625000000000226
  115. +0.015625000000000114
  116. -0.015625000000000222
  117. +0.015625000000000114
  118. -0.015625000000000226
  119. +0.015625000000000114
  120. -0.015625000000000222
  121. +0.015625000000000114
  122. -0.015625000000000226
  123. +0.015625000000000114
  124. -0.015625000000000222
  125. +0.015625000000000114
  126. -0.015625000000000226
  127. +0.015625000000000114
  128. -0.015625000000000222
  129. +0.015625000000000114
  130. -0.015625000000000226
  131. +0.015625000000000114
  132. -0.015625000000000222
  133. +0.015625000000000114
  134. -0.015625000000000226
  135. +0.015625000000000114
  136. -0.015625000000000222
  137. +0.015625000000000114
  138. -0.015625000000000226
  139. +0.015625000000000114
  140. -0.015625000000000222
  141. +0.015625000000000114
  142. -0.015625000000000226
  143. +0.015625000000000114
  144. -0.015625000000000222
  145. +0.015625000000000114
  146. -0.015625000000000226
  147. +0.015625000000000114
  148. -0.015625000000000222
  149. +0.015625000000000114
  150. -0.015625000000000226
  151. +0.015625000000000114
  152. -0.015625000000000222
  153. +0.015625000000000114
  154. -0.015625000000000226
  155. +0.015625000000000114
  156. -0.015625000000000222
  157. +0.015625000000000114
  158. -0.015625000000000226
  159. +0.015625000000000114
  160. -0.015625000000000222
  161. +0.015625000000000114
  162. -0.015625000000000226
  163. +0.015625000000000114
  164. -0.015625000000000222
  165. +0.015625000000000114
  166.  
  167. Finally ended up at:
  168. Xmin=1.9874999999999803,Xmax=2.587500023841838,w=0.6000000238418579
  169. Xcenter=2.2875000119209092
  170. new width is 0.6000000238418579, 0.0 smaller than it should be
  171.  
  172. Imagine it got shoved one last time, against a wall to the west:
  173. New bounding box and computed center:
  174. Xmin=1.0,Xmax=1.600000023841858,w=0.6000000238418579
  175. Xcenter=1.300000011920929
  176.  
  177. Only the center is saved to disk. When reloaded, we get this:
  178. Reloaded center and computed faces:
  179. Xcenter=1.300000011920929
  180. Xmin=1.0,Xmax=1.600000023841858,w=0.6000000238418579
  181. The west face now intersects the wall by 0.0
  182.  
  183. Imagine instead it got shoved one last time, against a wall to the east:
  184. New bounding box and computed center:
  185. Xmin=2.399999976158142,Xmax=3.0,w=0.6000000238418579
  186. Xcenter=2.699999988079071
  187.  
  188. Only the center is saved to disk. When reloaded, we get this:
  189. Reloaded center and computed faces:
  190. Xcenter=2.699999988079071
  191. Xmin=2.399999976158142,Xmax=3.0,w=0.6000000238418579
  192. The east face now intersects the wall by 0.0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement