MCPcopy Create free account
hub / github.com/PerroEngine/Perro / expect_bool

Function expect_bool

perro_source/core/perro_animation/src/panim/fields.rs:419–423  ·  view source on GitHub ↗
(value: &SceneValue, key: &str, line_no: usize)

Source from the content-addressed store, hash-verified

417 if let Some(v) = value.as_f32()
418 && v.is_finite()
419 && v.fract() == 0.0
420 && v >= i32::MIN as f32
421 && v <= i32::MAX as f32
422 {
423 return Ok(v as i32);
424 }
425 Err(format!("line {}: `{}` expects i32", line_no, key))
426}

Callers 4

parse_node_2d_actionFunction · 0.85
parse_node_3d_actionFunction · 0.85
parse_camera_3d_actionFunction · 0.85
parse_light_3d_actionFunction · 0.85

Calls 1

as_boolMethod · 0.45

Tested by

no test coverage detected