pub struct PyVec3 { /* private fields */ }Implementations§
Source§impl PyVec3
impl PyVec3
pub const ZERO: PyVec3
pub const ONE: PyVec3
pub const NEG_ONE: PyVec3
pub const MIN: PyVec3
pub const MAX: PyVec3
pub const NAN: PyVec3
pub const INFINITY: PyVec3
pub const NEG_INFINITY: PyVec3
pub const X: PyVec3
pub const Y: PyVec3
pub const Z: PyVec3
pub const NEG_X: PyVec3
pub const NEG_Y: PyVec3
pub const NEG_Z: PyVec3
pub fn from_vec3(vec: Vec3) -> Self
pub fn into_vec3(self) -> Vec3
pub const fn vec3(vec: Vec3) -> Self
pub fn get(&self) -> Vec3
Source§impl PyVec3
impl PyVec3
pub fn zero() -> Self
pub fn one() -> Self
pub fn neg_one() -> Self
pub fn min_value() -> Self
pub fn max_value() -> Self
pub fn nan() -> Self
pub fn infinity() -> Self
pub fn neg_infinity() -> Self
pub fn unit_x() -> Self
pub fn unit_y() -> Self
pub fn unit_z() -> Self
pub fn neg_x() -> Self
pub fn neg_y() -> Self
pub fn neg_z() -> Self
pub fn new(x: f32, y: f32, z: f32) -> Self
pub fn splat(value: f32) -> Self
pub fn x(&self) -> PyResult<f32>
pub fn set_x(&mut self, value: f32) -> PyResult<()>
pub fn y(&self) -> PyResult<f32>
pub fn set_y(&mut self, value: f32) -> PyResult<()>
pub fn z(&self) -> PyResult<f32>
pub fn set_z(&mut self, value: f32) -> PyResult<()>
pub fn dot(&self, other: &PyVec3) -> PyResult<f32>
pub fn cross(&self, other: &PyVec3) -> PyResult<Self>
pub fn length(&self) -> PyResult<f32>
pub fn length_squared(&self) -> PyResult<f32>
pub fn normalize(&self) -> PyResult<Self>
pub fn xy(&self) -> PyResult<PyVec2>
pub fn xz(&self) -> PyResult<PyVec2>
pub fn yz(&self) -> PyResult<PyVec2>
pub fn yx(&self) -> PyResult<PyVec2>
pub fn zx(&self) -> PyResult<PyVec2>
pub fn zy(&self) -> PyResult<PyVec2>
pub fn xx(&self) -> PyResult<PyVec2>
pub fn yy(&self) -> PyResult<PyVec2>
pub fn zz(&self) -> PyResult<PyVec2>
pub fn with_x(&self, x: f32) -> PyResult<PyVec3>
pub fn with_y(&self, y: f32) -> PyResult<PyVec3>
pub fn with_z(&self, z: f32) -> PyResult<PyVec3>
pub fn truncate(&self) -> PyResult<PyVec2>
pub fn extend(&self, w: f32) -> PyResult<PyVec4>
pub fn from_array(a: (f32, f32, f32)) -> PyVec3
pub fn to_array(&self) -> PyResult<(f32, f32, f32)>
pub fn abs(&self) -> PyResult<PyVec3>
pub fn signum(&self) -> PyResult<PyVec3>
pub fn copysign(&self, rhs: &PyVec3) -> PyResult<PyVec3>
pub fn is_finite(&self) -> PyResult<bool>
pub fn is_nan(&self) -> PyResult<bool>
pub fn round(&self) -> PyResult<PyVec3>
pub fn trunc(&self) -> PyResult<PyVec3>
pub fn fract(&self) -> PyResult<PyVec3>
pub fn fract_gl(&self) -> PyResult<PyVec3>
pub fn exp(&self) -> PyResult<PyVec3>
pub fn powf(&self, n: f32) -> PyResult<PyVec3>
pub fn recip(&self) -> PyResult<PyVec3>
pub fn lerp(&self, rhs: &PyVec3, s: f32) -> PyResult<PyVec3>
pub fn move_towards(&self, rhs: &PyVec3, d: f32) -> PyResult<PyVec3>
pub fn midpoint(&self, rhs: &PyVec3) -> PyResult<PyVec3>
pub fn project_onto(&self, rhs: &PyVec3) -> PyResult<PyVec3>
pub fn reject_from(&self, rhs: &PyVec3) -> PyResult<PyVec3>
pub fn normalize_or_zero(&self) -> PyResult<PyVec3>
pub fn try_normalize(&self) -> PyResult<Option<PyVec3>>
pub fn distance(&self, rhs: &PyVec3) -> PyResult<f32>
pub fn distance_squared(&self, rhs: &PyVec3) -> PyResult<f32>
pub fn min(&self, rhs: &PyVec3) -> PyResult<PyVec3>
pub fn max(&self, rhs: &PyVec3) -> PyResult<PyVec3>
pub fn clamp(&self, min: &PyVec3, max: &PyVec3) -> PyResult<PyVec3>
pub fn element_sum(&self) -> PyResult<f32>
pub fn element_product(&self) -> PyResult<f32>
pub fn is_normalized(&self) -> PyResult<bool>
pub fn floor(&self) -> PyResult<PyVec3>
pub fn ceil(&self) -> PyResult<PyVec3>
pub fn zxy(&self) -> PyResult<PyVec3>
pub fn xyz(&self) -> PyResult<PyVec3>
pub fn xzy(&self) -> PyResult<PyVec3>
pub fn yxz(&self) -> PyResult<PyVec3>
pub fn yzx(&self) -> PyResult<PyVec3>
pub fn zyx(&self) -> PyResult<PyVec3>
pub fn xxx(&self) -> PyResult<PyVec3>
pub fn xxy(&self) -> PyResult<PyVec3>
pub fn xxz(&self) -> PyResult<PyVec3>
pub fn xyx(&self) -> PyResult<PyVec3>
pub fn xyy(&self) -> PyResult<PyVec3>
pub fn xzx(&self) -> PyResult<PyVec3>
pub fn xzz(&self) -> PyResult<PyVec3>
pub fn yxx(&self) -> PyResult<PyVec3>
pub fn yxy(&self) -> PyResult<PyVec3>
pub fn yyx(&self) -> PyResult<PyVec3>
pub fn yyy(&self) -> PyResult<PyVec3>
pub fn yyz(&self) -> PyResult<PyVec3>
pub fn yzy(&self) -> PyResult<PyVec3>
pub fn yzz(&self) -> PyResult<PyVec3>
pub fn zxx(&self) -> PyResult<PyVec3>
pub fn zxz(&self) -> PyResult<PyVec3>
pub fn zyy(&self) -> PyResult<PyVec3>
pub fn zyz(&self) -> PyResult<PyVec3>
pub fn zzx(&self) -> PyResult<PyVec3>
pub fn zzy(&self) -> PyResult<PyVec3>
pub fn zzz(&self) -> PyResult<PyVec3>
pub fn min_element(&self) -> PyResult<f32>
pub fn max_element(&self) -> PyResult<f32>
pub fn angle_between(&self, other: &PyVec3) -> PyResult<f32>
pub fn any_orthogonal_vector(&self) -> PyResult<PyVec3>
pub fn any_orthonormal_vector(&self) -> PyResult<PyVec3>
pub fn any_orthonormal_pair(&self) -> PyResult<(PyVec3, PyVec3)>
pub fn length_recip(&self) -> PyResult<f32>
pub fn slerp(&self, rhs: &PyVec3, s: f32) -> PyResult<PyVec3>
pub fn clamp_length(&self, min: f32, max: f32) -> PyResult<PyVec3>
pub fn clamp_length_min(&self, min: f32) -> PyResult<PyVec3>
pub fn clamp_length_max(&self, max: f32) -> PyResult<PyVec3>
pub fn project_onto_normalized(&self, rhs: &PyVec3) -> PyResult<PyVec3>
pub fn reject_from_normalized(&self, rhs: &PyVec3) -> PyResult<PyVec3>
pub fn select( mask: (bool, bool, bool), if_true: &PyVec3, if_false: &PyVec3, ) -> PyResult<PyVec3>
pub fn cmpeq(&self, rhs: &PyVec3) -> PyResult<(bool, bool, bool)>
pub fn cmpne(&self, rhs: &PyVec3) -> PyResult<(bool, bool, bool)>
pub fn cmpge(&self, rhs: &PyVec3) -> PyResult<(bool, bool, bool)>
pub fn cmpgt(&self, rhs: &PyVec3) -> PyResult<(bool, bool, bool)>
pub fn cmple(&self, rhs: &PyVec3) -> PyResult<(bool, bool, bool)>
pub fn cmplt(&self, rhs: &PyVec3) -> PyResult<(bool, bool, bool)>
pub fn from_slice(slice: Vec<f32>) -> PyResult<PyVec3>
Trait Implementations§
Source§impl FromBorrowedStorage<ValueStorage<Vec3>> for PyVec3
impl FromBorrowedStorage<ValueStorage<Vec3>> for PyVec3
fn from_borrowed(storage: ValueStorage<Vec3>) -> Self
Source§impl<'py> IntoPyObject<'py> for PyVec3
impl<'py> IntoPyObject<'py> for PyVec3
Source§type Output = Bound<'py, <PyVec3 as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <PyVec3 as IntoPyObject<'py>>::Target>
The smart pointer type to use. Read more
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
Performs the conversion.
Source§impl PyClassImpl for PyVec3
impl PyClassImpl for PyVec3
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
#[pyclass(subclass)]
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
#[pyclass(extends=…)]
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
#[pyclass(mapping)]
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
#[pyclass(sequence)]
Source§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
#[pyclass(immutable_type)]
Source§const RAW_DOC: &'static CStr = c"\x00"
const RAW_DOC: &'static CStr = c"\x00"
Docstring for the class provided on the struct or enum. Read more
Source§const DOC: &'static CStr
const DOC: &'static CStr
Fully rendered class doc, including the
text_signature if a constructor is defined. Read moreSource§type ThreadChecker = SendablePyClass<PyVec3>
type ThreadChecker = SendablePyClass<PyVec3>
This handles following two situations: Read more
type Inventory = Pyo3MethodsInventoryForPyVec3
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Immutable or mutable
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
The closest native ancestor. This is
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
Source§impl PyClassNewTextSignature for PyVec3
impl PyClassNewTextSignature for PyVec3
const TEXT_SIGNATURE: &'static str = "(x, y, z)"
Source§impl PyTypeInfo for PyVec3
impl PyTypeInfo for PyVec3
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Returns the PyTypeObject instance for this type.
Source§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
Returns the safe abstraction over the type object.
impl DerefToPyAny for PyVec3
impl ExtractPyClassWithClone for PyVec3
Auto Trait Implementations§
impl Freeze for PyVec3
impl RefUnwindSafe for PyVec3
impl Send for PyVec3
impl Sync for PyVec3
impl Unpin for PyVec3
impl UnsafeUnpin for PyVec3
impl UnwindSafe for PyVec3
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<'a, 'py, T> FromPyObject<'a, 'py> for T
impl<'a, 'py, T> FromPyObject<'a, 'py> for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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 moreSource§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
Source§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
Converts
self into an owned Python object, dropping type information.Source§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Converts this type into the system output type.
Source§impl<T> PyErrArguments for T
impl<T> PyErrArguments for T
Source§impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
Source§const NAME: &'static str = T::NAME
const NAME: &'static str = T::NAME
👎Deprecated since 0.27.0:
Use ::classinfo_object() instead and format the type name at runtime. Note that using built-in cast features is often better than manual PyTypeCheck usage.
Name of self. This is used in error messages, for example.
Source§impl<T> TypeData for T
impl<T> TypeData for T
Source§fn clone_type_data(&self) -> Box<dyn TypeData>
fn clone_type_data(&self) -> Box<dyn TypeData>
Creates a type-erased clone of this value.