@ -155,11 +155,11 @@ func read_string() -> String:
# Optimized way to write a bone transform, since bones are likely to not contain offset or scale.
func write_bone_pose ( value : Transform3D ) - > void :
var pos : = valu e. origin
var rot : = valu e. basis . get_euler ( )
var scale : = valu e. basis . get_scale ( )
var has_pos : = ! pos . is_zero_approx ( )
func write_bone_pose ( pose : Transform3D , rest : Transform3D ) - > void :
var pos : = pos e. origin
var rot : = pos e. basis . get_euler ( )
var scale : = pos e. basis . get_scale ( )
var has_pos : = ! pos . is_equal_approx ( rest . origin )
var has_rot : = ! rot . is_zero_approx ( )
var has_scale : = ! scale . is_equal_approx ( Vector3 . ONE )
var has_scale3 : = ! is_equal_approx ( scale . x , scale . y ) or ! is_equal_approx ( scale . x , scale . y )
@ -169,7 +169,7 @@ func write_bone_pose(value: Transform3D) -> void:
if has_scale3 : write_vector16 ( scale )
elif has_scale : write_float16 ( ( scale . x + scale . y + scale . z ) / 3 )
func read_bone_pose ( ) - > Transform3D :
func read_bone_pose ( rest : Transform3D ) - > Transform3D :
var pos : = Vector3 . ZERO
var rot : = Vector3 . ZERO
var scale : = Vector3 . ONE
@ -177,7 +177,7 @@ func read_bone_pose() -> Transform3D:
var has_rot : = read_bit ( )
var has_scale : = read_bit ( )
var has_scale3 : = read_bit ( )
if has_pos : pos = read_vector16 ( )
pos = read_vector16 ( ) if has_pos else rest . origin
if has_rot : rot = Vector3 ( read_range16 ( ) * TAU , read_range16 ( ) * TAU , read_range16 ( ) * TAU )
if has_scale3 : scale = read_vector16 ( )
elif has_scale : var s : = read_float16 ( ) ; scale = Vector3 ( s , s , s )