Except that it is Java, and it isn't equivalent.
Ah. I missed that part (probably should watch the video now, huh?). I'm not familiar with Java, other than it is loosely based on C++.
I'd say its more based on plain C while trying to come up with the OO aspect on its own rather than basing it on C++ (hence no :: or -> operator, abstract instead of virtual, interfaces and so on).
At first I thought that it was a Vec3 from LWJGL default types but it isnt. I have no idea what that Vec3.nevTemp does (it looks like "nev" instead of "new" to me).
If it returns a new Vec3, then it isn't getting assigned to anything. And if it doesn't returns a new Vec3, it looks like a global static method that does something on other static stuff. Which kinda looks ugly since if other thread dares to touch the same Vec3 static, bad things could happen.
I guess it depends on experience? I looked at that line and it made perfect sense to me. "Vec3" tells me to expect x,y and z coordinates. A "d" in the variable name tells me it is a delta variable. He's constructing a new vector from an old vector, while translating it by delta values scaled by time. Without looking at the video, I would say this is part of a 3D animation system.
Where is the new vector going? It's not assigning a return value to anything. I wonder, is in unfinished code, or does Minecraft have global / thread local temp variables to avoid allocations?
As far as I know, in Java, if something is static, its static to that class in that applicaton, so no "thread globals" (unless I misunderstood what you're saying).
Edited by TheChubu, 14 July 2013 - 02:01 PM.