pub struct Camera3d { /* private fields */ }Expand description
Validated 3D view and projection used for stereometry rendering.
Implementations§
Source§impl Camera3d
impl Camera3d
Sourcepub fn look_at(
position: Vec3,
target: Vec3,
up_hint: Vec3,
projection: Projection3d,
) -> Result<Self, Pseudo3dError>
pub fn look_at( position: Vec3, target: Vec3, up_hint: Vec3, projection: Projection3d, ) -> Result<Self, Pseudo3dError>
Builds a camera looking from position toward target.
up_hint must not be zero or parallel to the view direction.
Sourcepub const fn projection(self) -> Projection3d
pub const fn projection(self) -> Projection3d
Returns the current perspective or orthographic projection.
Sourcepub fn project_world(
self,
point: Vec3,
viewport: LogicalViewport,
) -> Result<ProjectedPoint3d, Pseudo3dError>
pub fn project_world( self, point: Vec3, viewport: LogicalViewport, ) -> Result<ProjectedPoint3d, Pseudo3dError>
Projects a world point into logical screen coordinates.
Points behind the camera return an error. Outside-frustum points whose
projection remains representable return finite coordinates with
inside_view set to false, allowing host-side classification without
losing the projected anchor; extreme finite inputs may instead return
Pseudo3dError::ArithmeticOverflow. In the v0.2 retained renderer,
explicit display edges are clipped separately. StrictPortable surface
rendering generates bounded canonical clipping geometry, rejecting
uncertain topology; Native delegates surface clipping to the GPU.