Advertisement
MWisBest

Fix ridiculous particle RAM usage.

Jul 3rd, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 18.60 KB | None | 0 0
  1. From 8891556d77bf6ad2d14e874d5b6d8d7f48ee056f Mon Sep 17 00:00:00 2001
  2. From: Kyle Repinski <repinski23@gmail.com>
  3. Date: Sat, 1 Jul 2017 05:32:54 -0500
  4. Subject: [PATCH] Particle: Add and use Vec3dM to save memory allocations.
  5.  
  6. This saves roughly 2MB/sec of RAM just in a small field of torches.
  7.  
  8. Note: The 'if (this.particleAngle != 0.0F)' path (doParticleRenderCalc)
  9.       is only used by falling dust, but is verified to work properly.
  10. ---
  11. .../net/minecraft/client/particle/Particle.java    |  68 +++-
  12.  src/minecraft/net/minecraft/util/math/Vec3dM.java  | 343 +++++++++++++++++++++
  13.  2 files changed, 395 insertions(+), 16 deletions(-)
  14.  create mode 100644 src/minecraft/net/minecraft/util/math/Vec3dM.java
  15.  
  16. diff --git a/src/minecraft/net/minecraft/client/particle/Particle.java b/src/minecraft/net/minecraft/client/particle/Particle.java
  17. index a5ddf8a..b7e1fa7 100644
  18. --- a/src/minecraft/net/minecraft/client/particle/Particle.java
  19. +++ b/src/minecraft/net/minecraft/client/particle/Particle.java
  20. @@ -9,6 +9,7 @@ import net.minecraft.util.math.AxisAlignedBB;
  21.  import net.minecraft.util.math.BlockPos;
  22.  import net.minecraft.util.math.MathHelper;
  23.  import net.minecraft.util.math.Vec3d;
  24. +import net.minecraft.util.math.Vec3dM;
  25.  import net.minecraft.world.World;
  26.  
  27.  public class Particle
  28. @@ -192,11 +193,11 @@ public class Particle
  29.       */
  30.      public void renderParticle(BufferBuilder buffer, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ)
  31.      {
  32. -        float f = (float)this.particleTextureIndexX / 16.0F;
  33. -        float f1 = f + 0.0624375F;
  34. -        float f2 = (float)this.particleTextureIndexY / 16.0F;
  35. -        float f3 = f2 + 0.0624375F;
  36. -        float f4 = 0.1F * this.particleScale;
  37. +        float f;
  38. +        float f1;
  39. +        float f2;
  40. +        float f3;
  41. +
  42.  
  43.          if (this.particleTexture != null)
  44.          {
  45. @@ -205,14 +206,34 @@ public class Particle
  46.              f2 = this.particleTexture.getMinV();
  47.              f3 = this.particleTexture.getMaxV();
  48.          }
  49. +        else
  50. +        {
  51. +            f = (float)this.particleTextureIndexX / 16.0F;
  52. +            f1 = f + 0.0624375F;
  53. +            f2 = (float)this.particleTextureIndexY / 16.0F;
  54. +            f3 = f2 + 0.0624375F;
  55. +        }
  56.  
  57. +        float f4 = 0.1F * this.particleScale;
  58.          float f5 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)partialTicks - interpPosX);
  59.          float f6 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)partialTicks - interpPosY);
  60.          float f7 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)partialTicks - interpPosZ);
  61.          int i = this.getBrightnessForRender(partialTicks);
  62.          int j = i >> 16 & 65535;
  63.          int k = i & 65535;
  64. -        Vec3d[] avec3d = new Vec3d[] {new Vec3d((double)(-rotationX * f4 - rotationXY * f4), (double)(-rotationZ * f4), (double)(-rotationYZ * f4 - rotationXZ * f4)), new Vec3d((double)(-rotationX * f4 + rotationXY * f4), (double)(rotationZ * f4), (double)(-rotationYZ * f4 + rotationXZ * f4)), new Vec3d((double)(rotationX * f4 + rotationXY * f4), (double)(rotationZ * f4), (double)(rotationYZ * f4 + rotationXZ * f4)), new Vec3d((double)(rotationX * f4 - rotationXY * f4), (double)(-rotationZ * f4), (double)(rotationYZ * f4 - rotationXZ * f4))};
  65. +
  66. +        double x1 = (double)(-rotationX  * f4 - rotationXY * f4);
  67. +        double y1 = (double)(-rotationZ  * f4);
  68. +        double z1 = (double)(-rotationYZ * f4 - rotationXZ * f4);
  69. +        double x2 = (double)(-rotationX  * f4 + rotationXY * f4);
  70. +        double y2 = (double)( rotationZ  * f4);
  71. +        double z2 = (double)(-rotationYZ * f4 + rotationXZ * f4);
  72. +        double x3 = (double)( rotationX  * f4 + rotationXY * f4);
  73. +        double y3 = y2;
  74. +        double z3 = (double)( rotationYZ * f4 + rotationXZ * f4);
  75. +        double x4 = (double)( rotationX  * f4 - rotationXY * f4);
  76. +        double y4 = y1;
  77. +        double z4 = (double)( rotationYZ * f4 - rotationXZ * f4);
  78.  
  79.          if (this.particleAngle != 0.0F)
  80.          {
  81. @@ -221,18 +242,33 @@ public class Particle
  82.              float f10 = MathHelper.sin(f8 * 0.5F) * (float)cameraViewDir.x;
  83.              float f11 = MathHelper.sin(f8 * 0.5F) * (float)cameraViewDir.y;
  84.              float f12 = MathHelper.sin(f8 * 0.5F) * (float)cameraViewDir.z;
  85. -            Vec3d vec3d = new Vec3d((double)f10, (double)f11, (double)f12);
  86. -
  87. -            for (int l = 0; l < 4; ++l)
  88. -            {
  89. -                avec3d[l] = vec3d.scale(2.0D * avec3d[l].dotProduct(vec3d)).add(avec3d[l].scale((double)(f9 * f9) - vec3d.dotProduct(vec3d))).add(vec3d.crossProduct(avec3d[l]).scale((double)(2.0F * f9)));
  90. -            }
  91. +            double d10 = (double)f10;
  92. +            double d11 = (double)f11;
  93. +            double d12 = (double)f12;
  94. +            Vec3dM temp = new Vec3dM(d10, d11, d12);
  95. +
  96. +            temp = temp.doParticleRenderCalc( x1, y1, z1, d10, d11, d12, f9 );
  97. +            x1 = temp.xCoord;
  98. +            y1 = temp.yCoord;
  99. +            z1 = temp.zCoord;
  100. +            temp = temp.doParticleRenderCalc( x2, y2, z2, d10, d11, d12, f9 );
  101. +            x2 = temp.xCoord;
  102. +            y2 = temp.yCoord;
  103. +            z2 = temp.zCoord;
  104. +            temp = temp.doParticleRenderCalc( x3, y3, z3, d10, d11, d12, f9 );
  105. +            x3 = temp.xCoord;
  106. +            y3 = temp.yCoord;
  107. +            z3 = temp.zCoord;
  108. +            temp = temp.doParticleRenderCalc( x4, y4, z4, d10, d11, d12, f9 );
  109. +            x4 = temp.xCoord;
  110. +            y4 = temp.yCoord;
  111. +            z4 = temp.zCoord;
  112.          }
  113.  
  114. -        buffer.pos((double)f5 + avec3d[0].x, (double)f6 + avec3d[0].y, (double)f7 + avec3d[0].z).tex((double)f1, (double)f3).color(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha).lightmap(j, k).endVertex();
  115. -        buffer.pos((double)f5 + avec3d[1].x, (double)f6 + avec3d[1].y, (double)f7 + avec3d[1].z).tex((double)f1, (double)f2).color(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha).lightmap(j, k).endVertex();
  116. -        buffer.pos((double)f5 + avec3d[2].x, (double)f6 + avec3d[2].y, (double)f7 + avec3d[2].z).tex((double)f, (double)f2).color(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha).lightmap(j, k).endVertex();
  117. -        buffer.pos((double)f5 + avec3d[3].x, (double)f6 + avec3d[3].y, (double)f7 + avec3d[3].z).tex((double)f, (double)f3).color(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha).lightmap(j, k).endVertex();
  118. +        buffer.pos((double)f5 + x1, (double)f6 + y1, (double)f7 + z1).tex((double)f1, (double)f3).color(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha).lightmap(j, k).endVertex();
  119. +        buffer.pos((double)f5 + x2, (double)f6 + y2, (double)f7 + z2).tex((double)f1, (double)f2).color(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha).lightmap(j, k).endVertex();
  120. +        buffer.pos((double)f5 + x3, (double)f6 + y3, (double)f7 + z3).tex((double)f, (double)f2).color(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha).lightmap(j, k).endVertex();
  121. +        buffer.pos((double)f5 + x4, (double)f6 + y4, (double)f7 + z4).tex((double)f, (double)f3).color(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha).lightmap(j, k).endVertex();
  122.      }
  123.  
  124.      /**
  125. diff --git a/src/minecraft/net/minecraft/util/math/Vec3dM.java b/src/minecraft/net/minecraft/util/math/Vec3dM.java
  126. new file mode 100644
  127. index 0000000..c11c0df
  128. --- /dev/null
  129. +++ b/src/minecraft/net/minecraft/util/math/Vec3dM.java
  130. @@ -0,0 +1,343 @@
  131. +package net.minecraft.util.math;
  132. +
  133. +import javax.annotation.Nullable;
  134. +
  135. +public class Vec3dM
  136. +{
  137. +    public static final Vec3dM ZERO = new Vec3dM(0.0D, 0.0D, 0.0D);
  138. +
  139. +    /** X coordinate of Vec3D */
  140. +    public double xCoord;
  141. +
  142. +    /** Y coordinate of Vec3D */
  143. +    public double yCoord;
  144. +
  145. +    /** Z coordinate of Vec3D */
  146. +    public double zCoord;
  147. +
  148. +    public Vec3dM(double x, double y, double z)
  149. +    {
  150. +        if (x == -0.0D)
  151. +        {
  152. +            x = 0.0D;
  153. +        }
  154. +
  155. +        if (y == -0.0D)
  156. +        {
  157. +            y = 0.0D;
  158. +        }
  159. +
  160. +        if (z == -0.0D)
  161. +        {
  162. +            z = 0.0D;
  163. +        }
  164. +
  165. +        this.xCoord = x;
  166. +        this.yCoord = y;
  167. +        this.zCoord = z;
  168. +    }
  169. +
  170. +    public Vec3dM(Vec3i vector)
  171. +    {
  172. +        this((double)vector.getX(), (double)vector.getY(), (double)vector.getZ());
  173. +    }
  174. +
  175. +    /**
  176. +     * Returns a new vector with the result of the specified vector minus this.
  177. +     */
  178. +    public Vec3dM subtractReverse(Vec3dM vec)
  179. +    {
  180. +        this.xCoord = vec.xCoord - this.xCoord;
  181. +        this.yCoord = vec.yCoord - this.yCoord;
  182. +        this.zCoord = vec.zCoord - this.zCoord;
  183. +        return this;
  184. +    }
  185. +
  186. +    /**
  187. +     * Normalizes the vector to a length of 1 (except if it is the zero vector)
  188. +     */
  189. +    public Vec3dM normalize()
  190. +    {
  191. +        double d0 = (double)MathHelper.sqrt(this.xCoord * this.xCoord + this.yCoord * this.yCoord + this.zCoord * this.zCoord);
  192. +        return d0 < 1.0E-4D ? ZERO : new Vec3dM(this.xCoord / d0, this.yCoord / d0, this.zCoord / d0);
  193. +    }
  194. +
  195. +    public double dotProduct(Vec3dM vec)
  196. +    {
  197. +        return this.xCoord * vec.xCoord + this.yCoord * vec.yCoord + this.zCoord * vec.zCoord;
  198. +    }
  199. +
  200. +    public double dotProduct(double x, double y, double z)
  201. +    {
  202. +        return this.xCoord * x + this.yCoord * y + this.zCoord * z;
  203. +    }
  204. +
  205. +    /**
  206. +     * Returns a new vector with the result of this vector x the specified vector.
  207. +     */
  208. +    public Vec3dM crossProduct(Vec3dM vec)
  209. +    {
  210. +        double newX = this.yCoord * vec.zCoord - this.zCoord * vec.yCoord;
  211. +        double newY = this.zCoord * vec.xCoord - this.xCoord * vec.zCoord;
  212. +        double newZ = this.xCoord * vec.yCoord - this.yCoord * vec.xCoord;
  213. +        this.xCoord = newX;
  214. +        this.yCoord = newY;
  215. +        this.zCoord = newZ;
  216. +        return this;
  217. +    }
  218. +
  219. +    public Vec3dM subtract(Vec3dM vec)
  220. +    {
  221. +        return this.subtract(vec.xCoord, vec.yCoord, vec.zCoord);
  222. +    }
  223. +
  224. +    public Vec3dM subtract(double x, double y, double z)
  225. +    {
  226. +        return this.addVector(-x, -y, -z);
  227. +    }
  228. +
  229. +    public Vec3dM add(Vec3dM vec)
  230. +    {
  231. +        return this.addVector(vec.xCoord, vec.yCoord, vec.zCoord);
  232. +    }
  233. +
  234. +    /**
  235. +     * Adds the specified x,y,z vector components to this vector and returns the resulting vector. Does not change this
  236. +     * vector.
  237. +     */
  238. +    public Vec3dM addVector(double x, double y, double z)
  239. +    {
  240. +        this.xCoord += x;
  241. +        this.yCoord += y;
  242. +        this.zCoord += z;
  243. +        return this;
  244. +    }
  245. +
  246. +    /**
  247. +     * Euclidean distance between this and the specified vector, returned as double.
  248. +     */
  249. +    public double distanceTo(Vec3dM vec)
  250. +    {
  251. +        double d0 = vec.xCoord - this.xCoord;
  252. +        double d1 = vec.yCoord - this.yCoord;
  253. +        double d2 = vec.zCoord - this.zCoord;
  254. +        return (double)MathHelper.sqrt(d0 * d0 + d1 * d1 + d2 * d2);
  255. +    }
  256. +
  257. +    /**
  258. +     * The square of the Euclidean distance between this and the specified vector.
  259. +     */
  260. +    public double squareDistanceTo(Vec3dM vec)
  261. +    {
  262. +        double d0 = vec.xCoord - this.xCoord;
  263. +        double d1 = vec.yCoord - this.yCoord;
  264. +        double d2 = vec.zCoord - this.zCoord;
  265. +        return d0 * d0 + d1 * d1 + d2 * d2;
  266. +    }
  267. +
  268. +    public double squareDistanceTo(double xIn, double yIn, double zIn)
  269. +    {
  270. +        double d0 = xIn - this.xCoord;
  271. +        double d1 = yIn - this.yCoord;
  272. +        double d2 = zIn - this.zCoord;
  273. +        return d0 * d0 + d1 * d1 + d2 * d2;
  274. +    }
  275. +
  276. +    public Vec3dM scale(double p_186678_1_)
  277. +    {
  278. +        this.xCoord *= p_186678_1_;
  279. +        this.yCoord *= p_186678_1_;
  280. +        this.zCoord *= p_186678_1_;
  281. +        return this;
  282. +    }
  283. +
  284. +    /**
  285. +     * Returns the length of the vector.
  286. +     */
  287. +    public double lengthVector()
  288. +    {
  289. +        return (double)MathHelper.sqrt(this.xCoord * this.xCoord + this.yCoord * this.yCoord + this.zCoord * this.zCoord);
  290. +    }
  291. +
  292. +    public double lengthSquared()
  293. +    {
  294. +        return this.xCoord * this.xCoord + this.yCoord * this.yCoord + this.zCoord * this.zCoord;
  295. +    }
  296. +
  297. +    @Nullable
  298. +
  299. +    /**
  300. +     * Returns a new vector with x value equal to the second parameter, along the line between this vector and the
  301. +     * passed in vector, or null if not possible.
  302. +     */
  303. +    public Vec3dM getIntermediateWithXValue(Vec3dM vec, double x)
  304. +    {
  305. +        double d0 = vec.xCoord - this.xCoord;
  306. +        double d1 = vec.yCoord - this.yCoord;
  307. +        double d2 = vec.zCoord - this.zCoord;
  308. +
  309. +        if (d0 * d0 < 1.0000000116860974E-7D)
  310. +        {
  311. +            return null;
  312. +        }
  313. +        else
  314. +        {
  315. +            double d3 = (x - this.xCoord) / d0;
  316. +            return d3 >= 0.0D && d3 <= 1.0D ? new Vec3dM(this.xCoord + d0 * d3, this.yCoord + d1 * d3, this.zCoord + d2 * d3) : null;
  317. +        }
  318. +    }
  319. +
  320. +    @Nullable
  321. +
  322. +    /**
  323. +     * Returns a new vector with y value equal to the second parameter, along the line between this vector and the
  324. +     * passed in vector, or null if not possible.
  325. +     */
  326. +    public Vec3dM getIntermediateWithYValue(Vec3dM vec, double y)
  327. +    {
  328. +        double d0 = vec.xCoord - this.xCoord;
  329. +        double d1 = vec.yCoord - this.yCoord;
  330. +        double d2 = vec.zCoord - this.zCoord;
  331. +
  332. +        if (d1 * d1 < 1.0000000116860974E-7D)
  333. +        {
  334. +            return null;
  335. +        }
  336. +        else
  337. +        {
  338. +            double d3 = (y - this.yCoord) / d1;
  339. +            return d3 >= 0.0D && d3 <= 1.0D ? new Vec3dM(this.xCoord + d0 * d3, this.yCoord + d1 * d3, this.zCoord + d2 * d3) : null;
  340. +        }
  341. +    }
  342. +
  343. +    @Nullable
  344. +
  345. +    /**
  346. +     * Returns a new vector with z value equal to the second parameter, along the line between this vector and the
  347. +     * passed in vector, or null if not possible.
  348. +     */
  349. +    public Vec3dM getIntermediateWithZValue(Vec3dM vec, double z)
  350. +    {
  351. +        double d0 = vec.xCoord - this.xCoord;
  352. +        double d1 = vec.yCoord - this.yCoord;
  353. +        double d2 = vec.zCoord - this.zCoord;
  354. +
  355. +        if (d2 * d2 < 1.0000000116860974E-7D)
  356. +        {
  357. +            return null;
  358. +        }
  359. +        else
  360. +        {
  361. +            double d3 = (z - this.zCoord) / d2;
  362. +            return d3 >= 0.0D && d3 <= 1.0D ? new Vec3dM(this.xCoord + d0 * d3, this.yCoord + d1 * d3, this.zCoord + d2 * d3) : null;
  363. +        }
  364. +    }
  365. +
  366. +    public boolean equals(Object p_equals_1_)
  367. +    {
  368. +        if (this == p_equals_1_)
  369. +        {
  370. +            return true;
  371. +        }
  372. +        else if (!(p_equals_1_ instanceof Vec3dM))
  373. +        {
  374. +            return false;
  375. +        }
  376. +        else
  377. +        {
  378. +            Vec3dM vec3d = (Vec3dM)p_equals_1_;
  379. +            return Double.compare(vec3d.xCoord, this.xCoord) != 0 ? false : (Double.compare(vec3d.yCoord, this.yCoord) != 0 ? false : Double.compare(vec3d.zCoord, this.zCoord) == 0);
  380. +        }
  381. +    }
  382. +
  383. +    public int hashCode()
  384. +    {
  385. +        long j = Double.doubleToLongBits(this.xCoord);
  386. +        int i = (int)(j ^ j >>> 32);
  387. +        j = Double.doubleToLongBits(this.yCoord);
  388. +        i = 31 * i + (int)(j ^ j >>> 32);
  389. +        j = Double.doubleToLongBits(this.zCoord);
  390. +        i = 31 * i + (int)(j ^ j >>> 32);
  391. +        return i;
  392. +    }
  393. +
  394. +    public String toString()
  395. +    {
  396. +        return "(" + this.xCoord + ", " + this.yCoord + ", " + this.zCoord + ")";
  397. +    }
  398. +
  399. +    public Vec3dM rotatePitch(float pitch)
  400. +    {
  401. +        float f = MathHelper.cos(pitch);
  402. +        float f1 = MathHelper.sin(pitch);
  403. +        double newY = this.yCoord * (double)f + this.zCoord * (double)f1;
  404. +        double newZ = this.zCoord * (double)f - this.yCoord * (double)f1;
  405. +        this.yCoord = newY;
  406. +        this.zCoord = newZ;
  407. +        return this;
  408. +    }
  409. +
  410. +    public Vec3dM rotateYaw(float yaw)
  411. +    {
  412. +        float f = MathHelper.cos(yaw);
  413. +        float f1 = MathHelper.sin(yaw);
  414. +        double newX = this.xCoord * (double)f + this.zCoord * (double)f1;
  415. +        double newZ = this.zCoord * (double)f - this.xCoord * (double)f1;
  416. +        this.xCoord = newX;
  417. +        this.zCoord = newZ;
  418. +        return this;
  419. +    }
  420. +
  421. +    /**
  422. +     * returns a Vec3d from given pitch and yaw degrees as Vec2f
  423. +     */
  424. +    public static Vec3dM fromPitchYawVector(Vec2f p_189984_0_)
  425. +    {
  426. +        return fromPitchYaw(p_189984_0_.x, p_189984_0_.y);
  427. +    }
  428. +
  429. +    /**
  430. +     * returns a Vec3d from given pitch and yaw degrees
  431. +     */
  432. +    public static Vec3dM fromPitchYaw(float p_189986_0_, float p_189986_1_)
  433. +    {
  434. +        float f = MathHelper.cos(-p_189986_1_ * 0.017453292F - (float)Math.PI);
  435. +        float f1 = MathHelper.sin(-p_189986_1_ * 0.017453292F - (float)Math.PI);
  436. +        float f2 = -MathHelper.cos(-p_189986_0_ * 0.017453292F);
  437. +        float f3 = MathHelper.sin(-p_189986_0_ * 0.017453292F);
  438. +        return new Vec3dM((double)(f1 * f2), (double)f3, (double)(f * f2));
  439. +    }
  440. +
  441. +    public Vec3dM doParticleRenderCalc(double avec3dX, double avec3dY, double avec3dZ, double vec3dX, double vec3dY, double vec3dZ, float f9)
  442. +    {
  443. +        this.xCoord = vec3dX;
  444. +        this.yCoord = vec3dY;
  445. +        this.zCoord = vec3dZ;
  446. +
  447. +        // vec3d.scale(2.0D * avec3d[l].dotProduct(vec3d))
  448. +        double avec3d_l_dotProduct_vec3d = avec3dX * vec3dX + avec3dY * vec3dY + avec3dZ * vec3dZ;
  449. +        double scale0scale = 2.0D * avec3d_l_dotProduct_vec3d;
  450. +        this.xCoord *= scale0scale;
  451. +        this.yCoord *= scale0scale;
  452. +        this.zCoord *= scale0scale;
  453. +
  454. +        // .add(avec3d[l].scale((double)(f9 * f9) - vec3d.dotProduct(vec3d)))
  455. +        double vec3d_dotProduct_vec3d = vec3dX * vec3dX + vec3dY * vec3dY + vec3dZ * vec3dZ;
  456. +        double add1scale = (double)(f9 * f9) - vec3d_dotProduct_vec3d;
  457. +        this.xCoord += (avec3dX * add1scale);
  458. +        this.yCoord += (avec3dY * add1scale);
  459. +        this.zCoord += (avec3dZ * add1scale);
  460. +
  461. +        // .add(vec3d.crossProduct(avec3d[l]).scale((double)(2.0F * f9)));
  462. +        double vec3d_crossProduct_avec3d_l_X = vec3dY * avec3dZ - vec3dZ * avec3dY;
  463. +        double vec3d_crossProduct_avec3d_l_Y = vec3dZ * avec3dX - vec3dX * avec3dZ;
  464. +        double vec3d_crossProduct_avec3d_l_Z = vec3dX * avec3dY - vec3dY * avec3dX;
  465. +        double add2scale = (double)(2.0F * f9);
  466. +
  467. +        this.xCoord += (vec3d_crossProduct_avec3d_l_X * add2scale);
  468. +        this.yCoord += (vec3d_crossProduct_avec3d_l_Y * add2scale);
  469. +        this.zCoord += (vec3d_crossProduct_avec3d_l_Z * add2scale);
  470. +
  471. +        return this;
  472. +    }
  473. +}
  474. --
  475. 2.10.1.windows.1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement