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
sourceimpl 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<R, P> ReadPrimitive<R> for P where
R: Read + ReadEndian<P>,
P: Default,
impl<R, P> ReadPrimitive<R> for P where
R: Read + ReadEndian<P>,
P: Default,
sourcefn 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()
.
sourcefn read_from_big_endian(read: &mut R) -> Result<Self, Error>
fn read_from_big_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian()
.
sourcefn read_from_native_endian(read: &mut R) -> Result<Self, Error>
fn read_from_native_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian()
.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more