use std::marker;
use std::time::Instant;
use amethyst::assets::Handle;
use amethyst::core::cgmath::{
Array, EuclideanSpace, InnerSpace, Quaternion, Rotation, Vector3, Zero,
};
use amethyst::core::{GlobalTransform, Transform};
use amethyst::ecs::prelude::{Entities, Entity, Join, ReadExpect, System, WriteStorage};
use amethyst::renderer::{Material, Mesh};
use amethyst_rhusics::{AsTransform, Convert};
use collision::{Bound, ComputeBound, Primitive, Union};
use rand::Rand;
use rhusics_core::{
BodyPose, CollisionMode, CollisionShape, CollisionStrategy, Inertia, Mass, PhysicalEntity,
Pose, Velocity,
};
use rhusics_ecs::PhysicalEntityParts;
use super::{Emitter, Graphics, ObjectType};
/// Primitive emission system.
///
/// Will spawn new primitives regularly, based on the `Emitter`s in the `World`.
///
/// Showcase how to use `RigidBodyParts` to setup new collidable entities
///
/// ### Type parameters:
///
/// - `P`: Collision primitive (see `collision::primitive` for more information)
/// - `B`: Bounding volume (usually `Aabb2`, `Aabb3` or `Sphere`)
/// - `R`: Rotational quantity (`Basis2` or `Quaternion`)
/// - `A`: Angular velocity quantity (`Scalar` or `Vector3`)
/// - `I`: Inertia tensor (`Scalar` or `Matrix3`)
pub struct EmissionSystem
{
primitive: P,
m: marker::PhantomData<(B, R, A, I)>,
}
impl
EmissionSystem
{
pub fn new(primitive: P) -> Self {
Self {
primitive,
m: marker::PhantomData,
}
}
}
impl<'a, P, B, R, A, I> System<'a> for EmissionSystem
where
B: Bound + Union + Clone + Send + Sync + 'static,
P: Primitive + ComputeBound + Clone + Send + Sync + 'static,
P::Point: EuclideanSpace + Convert