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

Function set_image_tint

perro_editor/res/scripts/ui/editor_ui.rs:3862–3875  ·  view source on GitHub ↗
(
    ctx: &mut ScriptContext<'_, API>,
    name: &str,
    tint: &str,
)

Source from the content-addressed store, hash-verified

3860 return values;
3861 }
3862 if let Some(values) = scene_value_override_components(data, "rotation")
3863 && values.len() == 4
3864 {
3865 let parsed = values
3866 .iter()
3867 .filter_map(|value| value.parse::<f32>().ok())
3868 .collect::<Vec<_>>();
3869 if let [x, y, z, w] = parsed.as_slice() {
3870 return quat_to_euler_deg_components(*x, *y, *z, *w);
3871 }
3872 }
3873 vec!["0".to_string(), "0".to_string(), "0".to_string()]
3874}
3875
3876pub fn quat_to_euler_deg_components(x: f32, y: f32, z: f32, w: f32) -> Vec<String> {
3877 let len = (x * x + y * y + z * z + w * w).sqrt();
3878 if len <= 0.0 {

Callers 1

refresh_chrome_viewFunction · 0.85

Calls 1

find_namedFunction · 0.85

Tested by

no test coverage detected