use crate::core::object_ref::ObjectRef;
use crate::core::Object3D;
use crate::math::Plane;
use crate::objects::Payload;
#[derive(Clone, Debug)]
pub struct ClippingGroup {
pub clipping_planes: Vec<Plane>,
pub enabled: bool,
pub clip_intersection: bool,
pub clip_shadows: bool,
}
impl Default for ClippingGroup {
fn default() -> Self {
Self {
clipping_planes: Vec::new(),
enabled: true,
clip_intersection: false,
clip_shadows: false,
}
}
}
impl ClippingGroup {
#[allow(clippy::new_ret_no_self)] pub fn new() -> ObjectRef {
Self::of(Self::default())
}
pub fn of(group: Self) -> ObjectRef {
let mut object = Object3D {
object_type: "ClippingGroup",
is_group: true,
..Default::default()
};
object.payload = Payload::ClippingGroup(group);
object.into_node()
}
}