pub struct Sphere {
pub radius: Float,
pub z_min: Float,
pub z_max: Float,
pub theta_min: Float,
pub theta_max: Float,
pub phi_max: Float,
pub object_to_world: Transform,
pub world_to_object: Transform,
pub reverse_orientation: bool,
pub transform_swaps_handedness: bool,
pub material: Option<Arc<Material>>,
}
Fields§
§radius: Float
§z_min: Float
§z_max: Float
§theta_min: Float
§theta_max: Float
§phi_max: Float
§object_to_world: Transform
§world_to_object: Transform
§reverse_orientation: bool
§transform_swaps_handedness: bool
§material: Option<Arc<Material>>
Implementations§
source§impl Sphere
impl Sphere
pub fn new( object_to_world: Transform, world_to_object: Transform, reverse_orientation: bool, radius: Float, z_min: Float, z_max: Float, phi_max: Float ) -> Self
pub fn object_bound(&self) -> Bounds3f
pub fn world_bound(&self) -> Bounds3f
pub fn intersect( &self, r: &Ray, t_hit: &mut Float, isect: &mut SurfaceInteraction<'_> ) -> bool
pub fn intersect_p(&self, r: &Ray) -> bool
pub fn get_reverse_orientation(&self) -> bool
pub fn get_transform_swaps_handedness(&self) -> bool
pub fn get_object_to_world(&self) -> Transform
pub fn area(&self) -> Float
pub fn sample(&self, u: Point2f, pdf: &mut Float) -> InteractionCommon
pub fn sample_with_ref_point( &self, iref: &InteractionCommon, u: Point2f, pdf: &mut Float ) -> InteractionCommon
pub fn pdf_with_ref_point(&self, iref: &dyn Interaction, wi: &Vector3f) -> Float
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Sphere
impl Send for Sphere
impl Sync for Sphere
impl Unpin for Sphere
impl !UnwindSafe for Sphere
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
Mutably borrows from an owned value. Read more
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for Pwhere
R: Read + ReadEndian<P>,
P: Default,
impl<R, P> ReadPrimitive<R> for Pwhere R: Read + ReadEndian<P>, P: Default,
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.