Fix wrong name offset if two entities both had block models, but of differeing height

This commit is contained in:
UnknownShadow200 2017-06-18 15:10:17 +10:00
parent cbaca0c922
commit 7c0bec9bf2
3 changed files with 12 additions and 2 deletions

View File

@ -67,7 +67,7 @@ namespace ClassicalSharp.Entities {
/// <summary> Returns the size of the model that is used for collision detection. </summary>
public Vector3 Size;
void UpdateModel() {
protected void UpdateModel() {
BlockModel model = Model as BlockModel;
if (model != null)
model.CalcState(Utils.FastByte(ModelName));

View File

@ -82,7 +82,8 @@ namespace ClassicalSharp.Entities {
IGraphicsApi gfx = game.Graphics;
gfx.BindTexture(nameTex.ID);
Vector3 pos;
Vector3 pos;
UpdateModel();
Vector3.TransformY(Model.NameYOffset, ref transform, out pos);
float scale = Math.Min(1, Model.NameScale * ModelScale) / 70f;

View File

@ -11,12 +11,21 @@
Copyright 2014-2017 ClassicalSharp | Licensed under BSD-3
*/
#define IModel_QuadVertices 4
#define IModel_BoxVertices (Face_Count * IModel_QuadVertices)
/* Order in which axis rotations are applied to a part. */
typedef Int32 RotateOrder;
#define RotateOrder_ZYX 0
#define RotateOrder_XZY 1
/* Skin layout a humanoid skin texture can have. */
typedef Int32 SkinType;
#define SkinType_64x32 0
#define SkinType_64x64 1
#define SkinType_64x64Slim 2
#define SkinType_Invalid 3
/* Describes a vertex within a model. */
typedef struct ModelVertex {