more trait impls for SmoothAngle + property editor

This commit is contained in:
Dmitry
2022-09-12 19:37:53 +03:00
parent 52effcc9dc
commit 6cdf0e31e9
2 changed files with 10 additions and 5 deletions
+6 -4
View File
@@ -7,13 +7,15 @@ pub mod plane;
pub mod ray;
pub mod triangulator;
use crate::algebra::{RealField, SimdRealField};
use crate::{
algebra::{Matrix3, Matrix4, Scalar, UnitQuaternion, Vector2, Vector3},
algebra::{
Matrix3, Matrix4, RealField, Scalar, SimdRealField, UnitQuaternion, Vector2, Vector3,
},
inspect::prelude::*,
math::ray::IntersectionResult,
num_traits::{NumAssign, Zero},
reflect::Reflect,
visitor::{Visit, VisitResult, Visitor},
visitor::prelude::*,
};
use std::ops::{Index, IndexMut};
@@ -846,7 +848,7 @@ pub fn get_closest_point_triangle_set<P: PositionProvider>(
closest_index
}
#[derive(Debug, PartialEq, Visit)]
#[derive(Debug, PartialEq, Visit, Reflect, Inspect, Clone)]
pub struct SmoothAngle {
/// Current angle in radians.
pub angle: f32,
+4 -1
View File
@@ -3,7 +3,7 @@ use crate::{
algebra::{UnitQuaternion, Vector2, Vector3, Vector4},
color::Color,
inspect::{Inspect, PropertyInfo, PropertyValue},
math::Rect,
math::{Rect, SmoothAngle},
pool::Handle,
},
inspector::{
@@ -218,6 +218,9 @@ impl PropertyEditorDefinitionContainer {
reg_array_property_editor! { container, usize, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
reg_array_property_editor! { container, isize, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
// SmoothAngle
container.register_inheritable_inspectable::<SmoothAngle>();
container
}