Skip to content

Commit

Permalink
stage 1 of model rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownShadow200 committed Jan 11, 2019
1 parent 99ba3ab commit 2155a6b
Show file tree
Hide file tree
Showing 4 changed files with 163 additions and 108 deletions.
8 changes: 3 additions & 5 deletions src/Entity.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ void Entity_SetModel(struct Entity* e, const String* model) {
if (!e->Model) Entity_SetBlockModel(e, &name);

Entity_ParseScale(e, &scale);
e->Model->RecalcProperties(e);
Entity_UpdateModelBounds(e);

skin = String_FromRawArray(e->SkinNameRaw);
Expand All @@ -154,8 +153,8 @@ void Entity_SetModel(struct Entity* e, const String* model) {

void Entity_UpdateModelBounds(struct Entity* e) {
struct Model* model = e->Model;
model->GetCollisionSize(&e->Size);
model->GetPickingBounds(&e->ModelAABB);
model->GetCollisionSize(e);
model->GetPickingBounds(e);

Vector3_Mul3By(&e->Size, &e->ModelScale);
Vector3_Mul3By(&e->ModelAABB.Min, &e->ModelScale);
Expand Down Expand Up @@ -538,8 +537,7 @@ static void Player_DrawName(struct Player* p) {
Gfx_BindTexture(p->NameTex.ID);

model = e->Model;
model->RecalcProperties(e);
Vector3_TransformY(&pos, model->NameYOffset, &e->Transform);
Vector3_TransformY(&pos, model->GetNameY(e), &e->Transform);

scale = model->NameScale * e->ModelScale.Y;
scale = scale > 1.0f ? (1.0f/70.0f) : (scale/70.0f);
Expand Down
Loading

0 comments on commit 2155a6b

Please sign in to comment.