pub struct MeshSurface {
pub mesh: Arc<Mesh>,
pub transform: Mat4,
pub material: Material,
pub casts_shadow: bool,
pub solid: bool,
}Expand description
A composable’s content drawn on a mesh placed in a scene.
Fields§
§mesh: Arc<Mesh>The mesh the content is drawn on.
transform: Mat4Places the mesh in the scene.
material: MaterialHow the content meets the scene’s light and what lies behind it.
casts_shadow: boolWhether the surface casts a shadow from the scene’s light. Every lit and unlit surface takes the shadows that fall on it.
solid: boolWhether an eye that walks into the surface (see
EyeWorld::walk) stops there. A doorway in
the surface’s content lets it through.
Implementations§
Source§impl MeshSurface
impl MeshSurface
Sourcepub fn cast(&self, ray: Ray, size: Size) -> Option<SurfaceHit>
pub fn cast(&self, ray: Ray, size: Size) -> Option<SurfaceHit>
The content of a composable of size on the mesh: the content point
where the ray meets the mesh, the triangle it meets, and how far along
the ray.
Sourcepub fn cast_plane(&self, ray: Ray, triangle: u32, size: Size) -> Option<Point>
pub fn cast_plane(&self, ray: Ray, triangle: u32, size: Size) -> Option<Point>
The content point of a composable of size where the ray meets the
plane of triangle: a drag that leaves the mesh’s edge goes on along
it.
Sourcepub fn content_transform(
&self,
camera: &Camera,
viewport: Size,
size: Size,
) -> Option<ProjectiveTransform>
pub fn content_transform( &self, camera: &Camera, viewport: Size, size: Size, ) -> Option<ProjectiveTransform>
The projective map that carries the content of a composable of
size from the mesh to the bounds of viewport that camera shows.
It is exact for a flat mesh; for a curved one it follows the plane
that touches the mesh at the content’s middle. It sends the part
nearer than the camera’s near plane to w below NEAR_PLANE, which
ProjectiveTransform::front_polygon cuts away. None for content
of no size, or for a mesh with no texture plane.
Sourcepub fn content_to_scene(&self, size: Size) -> Option<Mat4>
pub fn content_to_scene(&self, size: Size) -> Option<Mat4>
The map from the content space of a composable of size on the mesh
into the scene: x and y in the content’s pixels from its top left, z
into the surface, away from the side it shows its content to, a unit
as long as a content pixel. A mesh surface inside this content is
placed in that space. It is exact for a flat mesh; for a curved one it
follows the plane that touches the mesh at the content’s middle.
None for content of no size, or for a mesh with no texture plane.
Sourcepub fn placed_by(&self, to_scene: &Mat4) -> MeshSurface
pub fn placed_by(&self, to_scene: &Mat4) -> MeshSurface
This surface with its transform followed by to_scene: a surface
inside another’s content, placed in the scene through the other’s
content_to_scene. Glass keeps its
thickness in the units of the space it is placed from.
Trait Implementations§
Source§impl Clone for MeshSurface
impl Clone for MeshSurface
Source§fn clone(&self) -> MeshSurface
fn clone(&self) -> MeshSurface
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MeshSurface
impl Debug for MeshSurface
Source§impl PartialEq for MeshSurface
impl PartialEq for MeshSurface
impl StructuralPartialEq for MeshSurface
Auto Trait Implementations§
impl Freeze for MeshSurface
impl RefUnwindSafe for MeshSurface
impl Send for MeshSurface
impl Sync for MeshSurface
impl Unpin for MeshSurface
impl UnsafeUnpin for MeshSurface
impl UnwindSafe for MeshSurface
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more