use dom_struct::dom_struct;
use crate::dom::bindings::codegen::Bindings::XRPoseBinding::XRPoseMethods;
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
use crate::dom::bindings::root::{Dom, DomRoot};
use crate::dom::dompointreadonly::DOMPointReadOnly;
use crate::dom::globalscope::GlobalScope;
use crate::dom::xrrigidtransform::XRRigidTransform;
use crate::dom::xrsession::ApiRigidTransform;
use crate::script_runtime::CanGc;
#[dom_struct]
pub struct XRPose {
reflector_: Reflector,
transform: Dom<XRRigidTransform>,
}
impl XRPose {
pub fn new_inherited(transform: &XRRigidTransform) -> XRPose {
XRPose {
reflector_: Reflector::new(),
transform: Dom::from_ref(transform),
}
}
#[allow(unused)]
pub fn new(
global: &GlobalScope,
transform: ApiRigidTransform,
can_gc: CanGc,
) -> DomRoot<XRPose> {
let transform = XRRigidTransform::new(global, transform, can_gc);
reflect_dom_object(
Box::new(XRPose::new_inherited(&transform)),
global,
CanGc::note(),
)
}
}
impl XRPoseMethods<crate::DomTypeHolder> for XRPose {
fn Transform(&self) -> DomRoot<XRRigidTransform> {
DomRoot::from_ref(&self.transform)
}
fn GetLinearVelocity(&self) -> Option<DomRoot<DOMPointReadOnly>> {
None
}
fn GetAngularVelocity(&self) -> Option<DomRoot<DOMPointReadOnly>> {
None
}
fn EmulatedPosition(&self) -> bool {
false
}
}