oxiphysics-collision 0.1.2

Collision detection algorithms for the OxiPhysics engine
Documentation
//! # TranslatedShape - Trait Implementations
//!
//! This module contains trait implementations for `TranslatedShape`.
//!
//! ## Implemented Traits
//!
//! - `ConvexShape`
//!
//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)

use super::functions::{ConvexShape, vadd};
use super::types::TranslatedShape;

impl ConvexShape for TranslatedShape<'_> {
    fn support(&self, dir: [f64; 3]) -> [f64; 3] {
        vadd(self.shape.support(dir), self.offset)
    }
    fn centre(&self) -> [f64; 3] {
        vadd(self.shape.centre(), self.offset)
    }
}