| 171 | } |
| 172 | } |
| 173 | pub fn compound_end(&mut self) -> f64 { |
| 174 | if self.compound_children.is_empty() { return 0.0; } |
| 175 | let shapes: Vec<bj_shape> = self.compound_children.iter().map(|(s, _)| *s).collect(); |
| 176 | let xforms: Vec<BjTransform> = self.compound_children.iter().map(|(_, x)| *x).collect(); |
| 177 | let s = unsafe { |
| 178 | bj_shape_compound_static(shapes.as_ptr(), xforms.as_ptr(), shapes.len() as u32) |
| 179 | }; |
| 180 | self.compound_children.clear(); |
| 181 | if s == BJ_INVALID { 0.0 } else { self.shapes.alloc(s) } |
| 182 | } |
| 183 | |
| 184 | // -------------------------------------------------------- World |
| 185 | |