Conversation
|
|
||
| int rot = Mth::floor(0.5f + (mob.m_rot.yaw * 4.0f / 360.0f)) & 3; | ||
| if (rot == 1 || rot == 3) | ||
| source.getLevel().setData(pos, 1); |
There was a problem hiding this comment.
the whole rot nonsense or setData? setData is corrected
| bindTexture(C_TERRAIN_NAME); | ||
| constexpr float ss = 0.75f; | ||
| tileMatrix->scale(ss); | ||
| tileMatrix->translate(Vec3(0.0f, 0.3125f, 0.0f)); |
BrentDaMage
left a comment
There was a problem hiding this comment.
Partial review, because I got tired
| m_shadowRadius = 0.5f; | ||
| } | ||
|
|
||
| void MinecartRenderer::render(const Entity& entity, const Vec3& pos, float rot, float a) |
There was a problem hiding this comment.
Try to abstract parts of this function out if possible. or just put comments explaining what each section is doing.
There was a problem hiding this comment.
I suppose the if (cart.getOnRailPos(...)) piece could be abstracted into its own function; or simply a comment 'adjust for positioning based on attached rail'
kind've seems self-explanatory to me but i've been single-mindedly fixing all of the minecart code
…ract render a little
|
Minecarts don't replicate velocity? Clientside check? Need to compare with Java |
| float v0 = yt * C_RATIO; | ||
| float v1 = (yt + 15.99f) * C_RATIO; | ||
|
|
||
| float x0 = (float)(pos.x + 1); |
There was a problem hiding this comment.
I think we can probably make this use TilePos::above() below, north, south, etc.
| m_vel.z = velDist * var14 / var16; | ||
| if (RailTile::isPoweredRail(rail) && !hasPower) | ||
| { | ||
| float velDist = Mth::sqrt(m_vel.x * m_vel.x + m_vel.z * m_vel.z); |
There was a problem hiding this comment.
I think this is distanceSqrt
There was a problem hiding this comment.
are you referring to the Vec3 function or do you want the variable named 'distanceSqrt'? It seems less descriptive if the latter.
I have been changing my mind with variable names a bit after understanding more and more of what is going on in here though.
There was a problem hiding this comment.
no, as in there's a function in Vec3 somewhere
Split from Wilylcaro
Refactored to work with current base and name variables/improve logic