Skip to content

Commit

Permalink
scene: Add an optional yaw to the entity/character placement
Browse files Browse the repository at this point in the history
In the "entity"/"character" instance arrays, add an optional 5th element
that is the model's rotation.

Signed-off-by: Alexander Shishkin <[email protected]>
  • Loading branch information
virtuoso committed Oct 5, 2024
1 parent 018b5f1 commit 87e9bbb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/scene.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,11 @@ static int model_new_from_json(struct scene *scene, JsonNode *node)
if (!pos || pos->tag != JSON_NUMBER)
continue; /* XXX */
e->scale = pos->number_;
/* rotation: optional */
if (pos && pos->tag == JSON_NUMBER)
e->ry = to_radians(pos->number_);
else
e->ry = 0;

if (terrain_clamp)
phys_ground_entity(e);
Expand Down

0 comments on commit 87e9bbb

Please sign in to comment.