Skip to content

Commit

Permalink
Delta time fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kraifpatrik committed Nov 15, 2020
1 parent 7716633 commit e959805
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs_src/QuickstartGuide/QuickstartPlayingAnimations.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if (anim_current != _anim_last)
animation_player.play(anim_current, true);
}

animation_player.update();
animation_player.update(delta_time);
```

Also do not forget to destroy the `BBMOD_AnimationPlayer` when the instance is destroyed,
Expand Down
2 changes: 1 addition & 1 deletion docs_src/QuickstartGuide/QuickstartTransformingBones.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This can be achieved with methods [set_node_rotation](./BBMOD_AnimationPlayer.se
var _arm_id = mod_character.find_node_id("arm_right");
var _rotation = ce_quaternion_create_from_axisangle([0, 1, 0], direction_up);
animation_player.set_node_rotation(_arm_id, _rotation);
animation_player.update();
animation_player.update(delta_time);
```

Please note that in this example we are using a method [find_node_id](./BBMOD_Model.find_node_id.html) to obtain a bone's id from its name. This is just for extra clarity of the example, but as the method's documentation states, you shouldn't be using it in production, as it can slow down your game. You should instead use the ids available from the `_log.txt` files.
6 changes: 3 additions & 3 deletions scripts/bbmod_animation_player/bbmod_animation_player.gml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ global.__bbmod_anim_stack = ds_stack_create();
/// animation_player.play(OResourceManager.anim_idle, true);
///
/// /// @desc Step event of OCharacter
/// animation_player.update();
/// animation_player.update(delta_time);
///
/// /// @desc Draw event of OCharacter
/// bbmod_material_reset();
Expand Down Expand Up @@ -381,7 +381,7 @@ function BBMOD_AnimationPlayer(_model, _paused) constructor
return self;
}

/// @func update()
/// @func update(_delta_time)
/// @desc Updates the animation player. This should be called every frame in
/// the step event.
/// @param {real} _delta_time The `delta_time`.
Expand Down Expand Up @@ -626,7 +626,7 @@ function bbmod_animation_player_update(_anim_player, _current_time, _interpolate
_anim_player.InterpolateFrames = !is_undefined(_interpolate_frames)
? _interpolate_frames
: true;
_anim_player.update();
_anim_player.update(delta_time);
}

/// @func bbmod_get_transform(_animation_player)
Expand Down

0 comments on commit e959805

Please sign in to comment.