Struct gdnative_physics::common::Vector2Array [−]
pub struct Vector2Array(_);
A reference-counted vector of Vector2
that uses Godot's pool allocator.
Methods
impl Vector2Array
impl Vector2Array
pub fn new() -> Vector2Array
pub fn new() -> Vector2Array
Creates an empty array.
pub fn from_variant_array(array: &VariantArray) -> Vector2Array
pub fn from_variant_array(array: &VariantArray) -> Vector2Array
Creates an array by trying to convert each variant
See Variant::to_vector2
.
pub fn push(&mut self, vector: &TypedVector2D<f32, UnknownUnit>)
pub fn push(&mut self, vector: &TypedVector2D<f32, UnknownUnit>)
Appends a vector to the end of the array.
pub fn push_array(&mut self, vectors: &Vector2Array)
pub fn push_array(&mut self, vectors: &Vector2Array)
Appends each vector to the end of the array.
pub fn insert(
&mut self,
offset: i32,
vector: &TypedVector2D<f32, UnknownUnit>
) -> bool
pub fn insert(
&mut self,
offset: i32,
vector: &TypedVector2D<f32, UnknownUnit>
) -> bool
Inserts a vector at the given offset.
pub fn invert(&mut self)
pub fn invert(&mut self)
Inverts the order of the elements in the array.
pub fn remove(&mut self, idx: i32)
pub fn remove(&mut self, idx: i32)
Removes an element at the given offset.
pub fn resize(&mut self, size: i32)
pub fn resize(&mut self, size: i32)
Changes the size of the array, possibly removing elements or pushing default values.
pub fn get(&self, idx: i32) -> TypedVector2D<f32, UnknownUnit>
pub fn get(&self, idx: i32) -> TypedVector2D<f32, UnknownUnit>
Returns a copy of the element at the given offset.
pub fn set(&mut self, idx: i32, vector: &TypedVector2D<f32, UnknownUnit>)
pub fn set(&mut self, idx: i32, vector: &TypedVector2D<f32, UnknownUnit>)
Sets the value of the element at the given offset.
pub fn len(&self) -> i32
pub fn len(&self) -> i32
Returns the number of elements in the array.
pub fn new_ref(&self) -> Vector2Array
pub fn new_ref(&self) -> Vector2Array
Trait Implementations
impl ToVariant for Vector2Array
impl ToVariant for Vector2Array
fn to_variant(&self) -> Variant
fn to_variant(&self) -> Variant
fn from_variant(variant: &Variant) -> Option<Vector2Array>
fn from_variant(variant: &Variant) -> Option<Vector2Array>
impl<'l> From<&'l Vector2Array> for Variant
impl<'l> From<&'l Vector2Array> for Variant
fn from(val: &'l Vector2Array) -> Variant
fn from(val: &'l Vector2Array) -> Variant
Performs the conversion.
impl Default for Vector2Array
impl Default for Vector2Array
fn default() -> Vector2Array
fn default() -> Vector2Array
Returns the "default value" for a type. Read more
impl Drop for Vector2Array
impl Drop for Vector2Array
Auto Trait Implementations
impl Send for Vector2Array
impl Send for Vector2Array
impl Sync for Vector2Array
impl Sync for Vector2Array