WithPhysics

Trait WithPhysics 

Source
pub trait WithPhysics {
    // Required methods
    fn with_dynamic_physical_entity<P, Y, R, V, A, I, B, T>(
        self,
        shape: CollisionShape<P, T, B, Y>,
        pose: T,
        velocity: Velocity<V, A>,
        physical_entity: PhysicalEntity<V::Scalar>,
        mass: Mass<V::Scalar, I>,
    ) -> Self
       where T: Pose<P::Point, R> + Clone + Component + Send + Sync + 'static,
             P: Primitive + Send + Sync + 'static,
             B: Bound<Point = P::Point> + Send + Sync + 'static,
             P::Point: EuclideanSpace<Scalar = V::Scalar> + Send + Sync + 'static,
             V::Scalar: BaseFloat + Send + Sync + 'static,
             R: Rotation<P::Point> + Send + Sync + 'static,
             V: VectorSpace + Zero + Clone + Send + Sync + 'static,
             A: Copy + Zero + Clone + Send + Sync + 'static,
             Y: Send + Sync + 'static,
             I: Send + Sync + 'static;
    fn with_static_physical_entity<S, P, Y, R, I, B, T>(
        self,
        shape: CollisionShape<P, T, B, Y>,
        pose: T,
        physical_entity: PhysicalEntity<S>,
        mass: Mass<S, I>,
    ) -> Self
       where T: Pose<P::Point, R> + Clone + Component + Send + Sync + 'static,
             S: BaseFloat + Send + Sync + 'static,
             P: Primitive + Send + Sync + 'static,
             B: Bound<Point = P::Point> + Send + Sync + 'static,
             P::Point: EuclideanSpace<Scalar = S> + Send + Sync + 'static,
             R: Rotation<P::Point> + Send + Sync + 'static,
             Y: Send + Sync + 'static,
             I: Send + Sync + 'static;
}
Expand description

Adds physical entity builder functions to EntityBuilder

Required Methods§

Source

fn with_dynamic_physical_entity<P, Y, R, V, A, I, B, T>( self, shape: CollisionShape<P, T, B, Y>, pose: T, velocity: Velocity<V, A>, physical_entity: PhysicalEntity<V::Scalar>, mass: Mass<V::Scalar, I>, ) -> Self
where T: Pose<P::Point, R> + Clone + Component + Send + Sync + 'static, P: Primitive + Send + Sync + 'static, B: Bound<Point = P::Point> + Send + Sync + 'static, P::Point: EuclideanSpace<Scalar = V::Scalar> + Send + Sync + 'static, V::Scalar: BaseFloat + Send + Sync + 'static, R: Rotation<P::Point> + Send + Sync + 'static, V: VectorSpace + Zero + Clone + Send + Sync + 'static, A: Copy + Zero + Clone + Send + Sync + 'static, Y: Send + Sync + 'static, I: Send + Sync + 'static,

Add dynamic physical entity components to entity

§Type parameters:
  • P: Collision Primitive
  • Y: Collider
  • R: Rotational quantity
  • V: Vector
  • A: Angular velocity
  • I: Inertia
  • B: Bounding volume
  • T: Transform
Source

fn with_static_physical_entity<S, P, Y, R, I, B, T>( self, shape: CollisionShape<P, T, B, Y>, pose: T, physical_entity: PhysicalEntity<S>, mass: Mass<S, I>, ) -> Self
where T: Pose<P::Point, R> + Clone + Component + Send + Sync + 'static, S: BaseFloat + Send + Sync + 'static, P: Primitive + Send + Sync + 'static, B: Bound<Point = P::Point> + Send + Sync + 'static, P::Point: EuclideanSpace<Scalar = S> + Send + Sync + 'static, R: Rotation<P::Point> + Send + Sync + 'static, Y: Send + Sync + 'static, I: Send + Sync + 'static,

Add static physical entity components to entity

§Type parameters:
  • S: Scalar (f32 or f64)
  • P: Collision Primitive
  • Y: Collider
  • R: Rotational quantity
  • I: Inertia
  • B: Bounding volume
  • T: Transform

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'a> WithPhysics for EntityBuilder<'a>

Source§

fn with_dynamic_physical_entity<P, Y, R, V, A, I, B, T>( self, shape: CollisionShape<P, T, B, Y>, pose: T, velocity: Velocity<V, A>, physical_entity: PhysicalEntity<V::Scalar>, mass: Mass<V::Scalar, I>, ) -> Self
where T: Pose<P::Point, R> + Clone + Component + Send + Sync + 'static, P: Primitive + Send + Sync + 'static, B: Bound<Point = P::Point> + Send + Sync + 'static, P::Point: EuclideanSpace<Scalar = V::Scalar> + Send + Sync + 'static, R: Rotation<P::Point> + Send + Sync + 'static, V: VectorSpace + Zero + Clone + Send + Sync + 'static, V::Scalar: BaseFloat + Send + Sync + 'static, A: Copy + Clone + Zero + Send + Sync + 'static, Y: Send + Sync + 'static, I: Send + Sync + 'static,

Source§

fn with_static_physical_entity<S, P, Y, R, I, B, T>( self, shape: CollisionShape<P, T, B, Y>, pose: T, physical_entity: PhysicalEntity<S>, mass: Mass<S, I>, ) -> Self
where T: Pose<P::Point, R> + Clone + Component + Send + Sync + 'static, S: BaseFloat + Send + Sync + 'static, P: Primitive + Send + Sync + 'static, B: Bound<Point = P::Point> + Send + Sync + 'static, P::Point: EuclideanSpace<Scalar = S> + Send + Sync + 'static, R: Rotation<P::Point> + Send + Sync + 'static, Y: Send + Sync + 'static, I: Send + Sync + 'static,

Implementors§