public BoxCollider(RigidBody body) { var shape = (BoxShape)body.CollisionShape; if (shape == null) { throw new ArgumentException("The body shape does not match the collider!", "body.CollisionShape"); } Model = Primitives.Cube(shape.HalfExtentsWithMargin.X, shape.HalfExtentsWithMargin.Y, shape.HalfExtentsWithMargin.Z, MeshMaterial.Green); Body = body; _size = new Vector3(shape.HalfExtentsWithMargin.X, shape.HalfExtentsWithMargin.Y, shape.HalfExtentsWithMargin.Z); }
Polytope GenerateCube() => Primitives.Cube(2);