1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use std::rc::Rc;
use std::cell::RefCell;
use alga::general::Real;
use ncollide::query::Contact;
use object::RigidBody;
use detection::joint::{Fixed, BallInSocket};
use math::Point;
pub enum Constraint<N: Real> {
RBRB(Rc<RefCell<RigidBody<N>>>, Rc<RefCell<RigidBody<N>>>, Contact<Point<N>>),
BallInSocket(Rc<RefCell<BallInSocket<N>>>),
Fixed(Rc<RefCell<Fixed<N>>>),
}
impl<N: Real> Clone for Constraint<N> {
fn clone(&self) -> Constraint<N> {
match *self {
Constraint::RBRB(ref a, ref b, ref c) => Constraint::RBRB(a.clone(), b.clone(), c.clone()),
Constraint::BallInSocket(ref bis) => Constraint::BallInSocket(bis.clone()),
Constraint::Fixed(ref f) => Constraint::Fixed(f.clone()),
}
}
}