Debug + PartialEq impls

This commit is contained in:
Dmitry
2021-08-10 16:20:13 +03:00
parent cc9355d5f9
commit 62c6804d73
4 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ use crate::{
};
use nalgebra::Point3;
#[derive(Copy, Clone)]
#[derive(Copy, Clone, Debug, PartialEq)]
pub struct Frustum {
/// 0 - left, 1 - right, 2 - top, 3 - bottom, 4 - far, 5 - near
planes: [Plane; 6],
+1
View File
@@ -757,6 +757,7 @@ pub fn get_closest_point_triangle_set<P: PositionProvider>(
closest_index
}
#[derive(Debug, PartialEq)]
pub struct SmoothAngle {
/// Current angle in radians.
pub angle: f32,
+1 -1
View File
@@ -1,7 +1,7 @@
use crate::algebra::Vector3;
use crate::visitor::{Visit, VisitResult, Visitor};
#[derive(Copy, Clone, Debug)]
#[derive(Copy, Clone, Debug, PartialEq)]
pub struct Plane {
pub normal: Vector3<f32>,
pub d: f32,
+5
View File
@@ -565,6 +565,11 @@ impl NavmeshAgent {
self.target = new_target;
}
/// Returns current target of the agent.
pub fn target(&self) -> Vector3<f32> {
self.target
}
/// Warps agent to a new position.
pub fn warp(&mut self, new_position: Vector3<f32>) {
if new_position.metric_distance(&self.last_warp_position) >= self.recalculation_threshold {