Struct Vector3Array

Source
pub struct Vector3Array(/* private fields */);
Expand description

A reference-counted vector of Vector3 that uses Godot’s pool allocator.

Implementations§

Source§

impl Vector3Array

Source

pub fn new() -> Vector3Array

Creates an empty array.

Source

pub fn from_variant_array(array: &VariantArray) -> Vector3Array

Creates an array by trying to convert each variant.

See Variant::to_vector3.

Source

pub fn push(&mut self, vector: &TypedVector3D<f32, UnknownUnit>)

Appends a vector to the end of the array.

Source

pub fn push_array(&mut self, vectors: &Vector3Array)

Appends each vector to the end of the array.

Source

pub fn insert( &mut self, offset: i32, vector: &TypedVector3D<f32, UnknownUnit>, ) -> bool

Inserts a vector at the given offset.

Source

pub fn invert(&mut self)

Inverts the order of the elements in the array.

Source

pub fn remove(&mut self, idx: i32)

Removes an element at the given offset.

Source

pub fn resize(&mut self, size: i32)

Changes the size of the array, possibly removing elements or pushing default values.

Source

pub fn get(&self, idx: i32) -> TypedVector3D<f32, UnknownUnit>

Returns a copy of the element at the given offset.

Source

pub fn set(&mut self, idx: i32, vector: &TypedVector3D<f32, UnknownUnit>)

Sets the value of the element at the given offset.

Source

pub fn len(&self) -> i32

Returns the number of elements in the array.

Source

pub fn new_ref(&self) -> Vector3Array

Trait Implementations§

Source§

impl Default for Vector3Array

Source§

fn default() -> Vector3Array

Returns the “default value” for a type. Read more
Source§

impl Drop for Vector3Array

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<'l> From<&'l Vector3Array> for Variant

Source§

fn from(val: &'l Vector3Array) -> Variant

Converts to this type from the input type.
Source§

impl ToVariant for Vector3Array

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, 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.