Skip to main content

PyVec3

Struct PyVec3 

Source
pub struct PyVec3 { /* private fields */ }

Implementations§

Source§

impl PyVec3

Source

pub const ZERO: PyVec3

Source

pub const ONE: PyVec3

Source

pub const NEG_ONE: PyVec3

Source

pub const MIN: PyVec3

Source

pub const MAX: PyVec3

Source

pub const NAN: PyVec3

Source

pub const INFINITY: PyVec3

Source

pub const NEG_INFINITY: PyVec3

Source

pub const X: PyVec3

Source

pub const Y: PyVec3

Source

pub const Z: PyVec3

Source

pub const NEG_X: PyVec3

Source

pub const NEG_Y: PyVec3

Source

pub const NEG_Z: PyVec3

Source

pub fn from_vec3(vec: Vec3) -> Self

Source

pub fn into_vec3(self) -> Vec3

Source

pub const fn vec3(vec: Vec3) -> Self

Source

pub fn get(&self) -> Vec3

Source§

impl PyVec3

Source

pub fn zero() -> Self

Source

pub fn one() -> Self

Source

pub fn neg_one() -> Self

Source

pub fn min_value() -> Self

Source

pub fn max_value() -> Self

Source

pub fn nan() -> Self

Source

pub fn infinity() -> Self

Source

pub fn neg_infinity() -> Self

Source

pub fn unit_x() -> Self

Source

pub fn unit_y() -> Self

Source

pub fn unit_z() -> Self

Source

pub fn neg_x() -> Self

Source

pub fn neg_y() -> Self

Source

pub fn neg_z() -> Self

Source

pub fn new(x: f32, y: f32, z: f32) -> Self

Source

pub fn splat(value: f32) -> Self

Source

pub fn x(&self) -> PyResult<f32>

Source

pub fn set_x(&mut self, value: f32) -> PyResult<()>

Source

pub fn y(&self) -> PyResult<f32>

Source

pub fn set_y(&mut self, value: f32) -> PyResult<()>

Source

pub fn z(&self) -> PyResult<f32>

Source

pub fn set_z(&mut self, value: f32) -> PyResult<()>

Source

pub fn dot(&self, other: &PyVec3) -> PyResult<f32>

Source

pub fn cross(&self, other: &PyVec3) -> PyResult<Self>

Source

pub fn length(&self) -> PyResult<f32>

Source

pub fn length_squared(&self) -> PyResult<f32>

Source

pub fn normalize(&self) -> PyResult<Self>

Source

pub fn xy(&self) -> PyResult<PyVec2>

Source

pub fn xz(&self) -> PyResult<PyVec2>

Source

pub fn yz(&self) -> PyResult<PyVec2>

Source

pub fn yx(&self) -> PyResult<PyVec2>

Source

pub fn zx(&self) -> PyResult<PyVec2>

Source

pub fn zy(&self) -> PyResult<PyVec2>

Source

pub fn xx(&self) -> PyResult<PyVec2>

Source

pub fn yy(&self) -> PyResult<PyVec2>

Source

pub fn zz(&self) -> PyResult<PyVec2>

Source

pub fn with_x(&self, x: f32) -> PyResult<PyVec3>

Source

pub fn with_y(&self, y: f32) -> PyResult<PyVec3>

Source

pub fn with_z(&self, z: f32) -> PyResult<PyVec3>

Source

pub fn truncate(&self) -> PyResult<PyVec2>

Source

pub fn extend(&self, w: f32) -> PyResult<PyVec4>

Source

pub fn from_array(a: (f32, f32, f32)) -> PyVec3

Source

pub fn to_array(&self) -> PyResult<(f32, f32, f32)>

Source

pub fn abs(&self) -> PyResult<PyVec3>

Source

pub fn signum(&self) -> PyResult<PyVec3>

Source

pub fn copysign(&self, rhs: &PyVec3) -> PyResult<PyVec3>

Source

pub fn is_finite(&self) -> PyResult<bool>

Source

pub fn is_nan(&self) -> PyResult<bool>

Source

pub fn round(&self) -> PyResult<PyVec3>

Source

pub fn trunc(&self) -> PyResult<PyVec3>

Source

pub fn fract(&self) -> PyResult<PyVec3>

Source

pub fn fract_gl(&self) -> PyResult<PyVec3>

Source

pub fn exp(&self) -> PyResult<PyVec3>

Source

pub fn powf(&self, n: f32) -> PyResult<PyVec3>

Source

pub fn recip(&self) -> PyResult<PyVec3>

Source

pub fn lerp(&self, rhs: &PyVec3, s: f32) -> PyResult<PyVec3>

Source

pub fn move_towards(&self, rhs: &PyVec3, d: f32) -> PyResult<PyVec3>

Source

pub fn midpoint(&self, rhs: &PyVec3) -> PyResult<PyVec3>

Source

pub fn project_onto(&self, rhs: &PyVec3) -> PyResult<PyVec3>

Source

pub fn reject_from(&self, rhs: &PyVec3) -> PyResult<PyVec3>

Source

pub fn normalize_or_zero(&self) -> PyResult<PyVec3>

Source

pub fn try_normalize(&self) -> PyResult<Option<PyVec3>>

Source

pub fn distance(&self, rhs: &PyVec3) -> PyResult<f32>

Source

pub fn distance_squared(&self, rhs: &PyVec3) -> PyResult<f32>

Source

pub fn min(&self, rhs: &PyVec3) -> PyResult<PyVec3>

Source

pub fn max(&self, rhs: &PyVec3) -> PyResult<PyVec3>

Source

pub fn clamp(&self, min: &PyVec3, max: &PyVec3) -> PyResult<PyVec3>

Source

pub fn element_sum(&self) -> PyResult<f32>

Source

pub fn element_product(&self) -> PyResult<f32>

Source

pub fn is_normalized(&self) -> PyResult<bool>

Source

pub fn floor(&self) -> PyResult<PyVec3>

Source

pub fn ceil(&self) -> PyResult<PyVec3>

Source

pub fn zxy(&self) -> PyResult<PyVec3>

Source

pub fn xyz(&self) -> PyResult<PyVec3>

Source

pub fn xzy(&self) -> PyResult<PyVec3>

Source

pub fn yxz(&self) -> PyResult<PyVec3>

Source

pub fn yzx(&self) -> PyResult<PyVec3>

Source

pub fn zyx(&self) -> PyResult<PyVec3>

Source

pub fn xxx(&self) -> PyResult<PyVec3>

Source

pub fn xxy(&self) -> PyResult<PyVec3>

Source

pub fn xxz(&self) -> PyResult<PyVec3>

Source

pub fn xyx(&self) -> PyResult<PyVec3>

Source

pub fn xyy(&self) -> PyResult<PyVec3>

Source

pub fn xzx(&self) -> PyResult<PyVec3>

Source

pub fn xzz(&self) -> PyResult<PyVec3>

Source

pub fn yxx(&self) -> PyResult<PyVec3>

Source

pub fn yxy(&self) -> PyResult<PyVec3>

Source

pub fn yyx(&self) -> PyResult<PyVec3>

Source

pub fn yyy(&self) -> PyResult<PyVec3>

Source

pub fn yyz(&self) -> PyResult<PyVec3>

Source

pub fn yzy(&self) -> PyResult<PyVec3>

Source

pub fn yzz(&self) -> PyResult<PyVec3>

Source

pub fn zxx(&self) -> PyResult<PyVec3>

Source

pub fn zxz(&self) -> PyResult<PyVec3>

Source

pub fn zyy(&self) -> PyResult<PyVec3>

Source

pub fn zyz(&self) -> PyResult<PyVec3>

Source

pub fn zzx(&self) -> PyResult<PyVec3>

Source

pub fn zzy(&self) -> PyResult<PyVec3>

Source

pub fn zzz(&self) -> PyResult<PyVec3>

Source

pub fn min_element(&self) -> PyResult<f32>

Source

pub fn max_element(&self) -> PyResult<f32>

Source

pub fn angle_between(&self, other: &PyVec3) -> PyResult<f32>

Source

pub fn any_orthogonal_vector(&self) -> PyResult<PyVec3>

Source

pub fn any_orthonormal_vector(&self) -> PyResult<PyVec3>

Source

pub fn any_orthonormal_pair(&self) -> PyResult<(PyVec3, PyVec3)>

Source

pub fn length_recip(&self) -> PyResult<f32>

Source

pub fn slerp(&self, rhs: &PyVec3, s: f32) -> PyResult<PyVec3>

Source

pub fn clamp_length(&self, min: f32, max: f32) -> PyResult<PyVec3>

Source

pub fn clamp_length_min(&self, min: f32) -> PyResult<PyVec3>

Source

pub fn clamp_length_max(&self, max: f32) -> PyResult<PyVec3>

Source

pub fn project_onto_normalized(&self, rhs: &PyVec3) -> PyResult<PyVec3>

Source

pub fn reject_from_normalized(&self, rhs: &PyVec3) -> PyResult<PyVec3>

Source

pub fn select( mask: (bool, bool, bool), if_true: &PyVec3, if_false: &PyVec3, ) -> PyResult<PyVec3>

Source

pub fn cmpeq(&self, rhs: &PyVec3) -> PyResult<(bool, bool, bool)>

Source

pub fn cmpne(&self, rhs: &PyVec3) -> PyResult<(bool, bool, bool)>

Source

pub fn cmpge(&self, rhs: &PyVec3) -> PyResult<(bool, bool, bool)>

Source

pub fn cmpgt(&self, rhs: &PyVec3) -> PyResult<(bool, bool, bool)>

Source

pub fn cmple(&self, rhs: &PyVec3) -> PyResult<(bool, bool, bool)>

Source

pub fn cmplt(&self, rhs: &PyVec3) -> PyResult<(bool, bool, bool)>

Source

pub fn from_slice(slice: Vec<f32>) -> PyResult<PyVec3>

Trait Implementations§

Source§

impl Clone for PyVec3

Source§

fn clone(&self) -> PyVec3

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PyVec3

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<&PyVec3> for Vec3

Source§

fn from(py_vec: &PyVec3) -> Self

Converts to this type from the input type.
Source§

impl From<Dir3> for PyVec3

Source§

fn from(dir: Dir3) -> Self

Converts to this type from the input type.
Source§

impl From<PyVec3> for Vec3

Source§

fn from(py_vec: PyVec3) -> Self

Converts to this type from the input type.
Source§

impl From<Vec3> for PyVec3

Source§

fn from(vec: Vec3) -> Self

Converts to this type from the input type.
Source§

impl FromBorrowedStorage<ValueStorage<Vec3>> for PyVec3

Source§

impl<'py> IntoPyObject<'py> for PyVec3

Source§

type Target = PyVec3

The Python output type
Source§

type Output = Bound<'py, <PyVec3 as IntoPyObject<'py>>::Target>

The smart pointer type to use. Read more
Source§

type Error = PyErr

The type returned in the event of a conversion error.
Source§

fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>

Performs the conversion.
Source§

impl PyClass for PyVec3

Source§

type Frozen = False

Whether the pyclass is frozen. Read more
Source§

impl PyClassImpl for PyVec3

Source§

const IS_BASETYPE: bool = false

#[pyclass(subclass)]
Source§

const IS_SUBCLASS: bool = false

#[pyclass(extends=…)]
Source§

const IS_MAPPING: bool = false

#[pyclass(mapping)]
Source§

const IS_SEQUENCE: bool = false

#[pyclass(sequence)]
Source§

const IS_IMMUTABLE_TYPE: bool = false

#[pyclass(immutable_type)]
Source§

const RAW_DOC: &'static CStr = c"\x00"

Docstring for the class provided on the struct or enum. Read more
Source§

const DOC: &'static CStr

Fully rendered class doc, including the text_signature if a constructor is defined. Read more
Source§

type BaseType = PyAny

Base class
Source§

type ThreadChecker = SendablePyClass<PyVec3>

This handles following two situations: Read more
Source§

type Inventory = Pyo3MethodsInventoryForPyVec3

Source§

type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild

Immutable or mutable
Source§

type Dict = PyClassDummySlot

Specify this class has #[pyclass(dict)] or not.
Source§

type WeakRef = PyClassDummySlot

Specify this class has #[pyclass(weakref)] or not.
Source§

type BaseNativeType = PyAny

The closest native ancestor. This is PyAny by default, and when you declare #[pyclass(extends=PyDict)], it’s PyDict.
Source§

fn items_iter() -> PyClassItemsIter

Source§

fn lazy_type_object() -> &'static LazyTypeObject<Self>

Source§

fn dict_offset() -> Option<isize>

Source§

fn weaklist_offset() -> Option<isize>

Source§

impl PyClassNewTextSignature for PyVec3

Source§

const TEXT_SIGNATURE: &'static str = "(x, y, z)"

Source§

impl PyClass__add__SlotFragment<PyVec3> for PyClassImplCollector<PyVec3>

Source§

unsafe fn __add__( self, py: Python<'_>, _raw_slf: *mut PyObject, arg0: *mut PyObject, ) -> PyResult<*mut PyObject>

Safety: _slf and _other must be valid non-null Python objects Read more
Source§

impl PyClass__mul__SlotFragment<PyVec3> for PyClassImplCollector<PyVec3>

Source§

unsafe fn __mul__( self, py: Python<'_>, _raw_slf: *mut PyObject, arg0: *mut PyObject, ) -> PyResult<*mut PyObject>

Safety: _slf and _other must be valid non-null Python objects Read more
Source§

impl PyClass__rmul__SlotFragment<PyVec3> for PyClassImplCollector<PyVec3>

Source§

unsafe fn __rmul__( self, py: Python<'_>, _raw_slf: *mut PyObject, arg0: *mut PyObject, ) -> PyResult<*mut PyObject>

Safety: _slf and _other must be valid non-null Python objects Read more
Source§

impl PyClass__sub__SlotFragment<PyVec3> for PyClassImplCollector<PyVec3>

Source§

unsafe fn __sub__( self, py: Python<'_>, _raw_slf: *mut PyObject, arg0: *mut PyObject, ) -> PyResult<*mut PyObject>

Safety: _slf and _other must be valid non-null Python objects Read more
Source§

impl PyClass__truediv__SlotFragment<PyVec3> for PyClassImplCollector<PyVec3>

Source§

unsafe fn __truediv__( self, py: Python<'_>, _raw_slf: *mut PyObject, arg0: *mut PyObject, ) -> PyResult<*mut PyObject>

Safety: _slf and _other must be valid non-null Python objects Read more
Source§

impl PyTypeInfo for PyVec3

Source§

const NAME: &'static str = "Vec3"

Class name.
Source§

const MODULE: Option<&'static str> = ::core::option::Option::None

Module name, if any.
Source§

fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject

Returns the PyTypeObject instance for this type.
Source§

fn type_object(py: Python<'_>) -> Bound<'_, PyType>

Returns the safe abstraction over the type object.
Source§

fn is_type_of(object: &Bound<'_, PyAny>) -> bool

Checks if object is an instance of this type or a subclass of this type.
Source§

fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool

Checks if object is an instance of this type.
Source§

impl TryFrom<&PyVec3> for Dir3

Source§

type Error = PyErr

The type returned in the event of a conversion error.
Source§

fn try_from(py_vec: &PyVec3) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<PyVec3> for Dir3

Source§

type Error = PyErr

The type returned in the event of a conversion error.
Source§

fn try_from(py_vec: PyVec3) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl DerefToPyAny for PyVec3

Source§

impl ExtractPyClassWithClone for PyVec3

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

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>

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)

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)

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
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<'a, 'py, T> FromPyObject<'a, 'py> for T
where T: PyClass + Clone + ExtractPyClassWithClone,

Source§

type Error = PyClassGuardError<'a, 'py>

The type returned in the event of a conversion error. Read more
Source§

fn extract( obj: Borrowed<'a, 'py, PyAny>, ) -> Result<T, <T as FromPyObject<'a, 'py>>::Error>

Extracts Self from the bound smart pointer obj. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<'py, T> IntoPyObjectExt<'py> for T
where T: IntoPyObject<'py>,

Source§

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§

fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>

Converts self into an owned Python object, dropping type information and unbinding it from the 'py lifetime.
Source§

fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>

Converts self into a Python object. Read more
Source§

impl<T> IntoResult<T> for T

Source§

fn into_result(self) -> Result<T, RunSystemError>

Converts this type into the system output type.
Source§

impl<A> Is for A
where A: Any,

Source§

fn is<T>() -> bool
where T: Any,

Checks if the current type “is” another type, using a TypeId equality comparison. This is most useful in the context of generic logic. Read more
Source§

impl<T> PyErrArguments for T
where T: for<'py> IntoPyObject<'py> + Send + Sync,

Source§

fn arguments(self, py: Python<'_>) -> Py<PyAny>

Arguments for exception
Source§

impl<T> PyTypeCheck for T
where T: PyTypeInfo,

Source§

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§

fn type_check(object: &Bound<'_, PyAny>) -> bool

Checks if object is an instance of Self, which may include a subtype. Read more
Source§

fn classinfo_object(py: Python<'_>) -> Bound<'_, PyAny>

Returns the expected type as a possible argument for the isinstance and issubclass function. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> TypeData for T
where T: 'static + Send + Sync + Clone,

Source§

fn clone_type_data(&self) -> Box<dyn TypeData>

Creates a type-erased clone of this value.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ConditionalSend for T
where T: Send,

Source§

impl<'py, T> FromPyObjectOwned<'py> for T
where T: for<'a> FromPyObject<'a, 'py>,

Source§

impl<T> Settings for T
where T: 'static + Send + Sync,

Source§

impl<T> Ungil for T
where T: Send,