[−][src]Struct gdnative::api::MeshDataTool
core class MeshDataTool
inherits Reference
(reference counted).
Official documentation
See the documentation of this class in the Godot engine's official documentation.
Memory management
The lifetime of this object is automatically managed through reference counting.
Class hierarchy
MeshDataTool inherits methods from:
Safety
All types in the Godot API have "interior mutability" in Rust parlance.
To enforce that the official thread-safety guidelines are
followed, the typestate pattern is used in the Ref
and TRef
smart pointers,
and the Instance
API. The typestate Access
in these types tracks whether the
access is unique, shared, or exclusive to the current thread. For more information,
see the type-level documentation on Ref
.
Implementations
impl MeshDataTool
[src]
pub fn new() -> Ref<MeshDataTool, Unique>
[src]
Creates a new instance of this object.
This is a reference-counted type. The returned object is automatically managed
by Ref
.
pub fn clear(&self)
[src]
Clears all data currently in MeshDataTool.
pub fn commit_to_surface(
&self,
mesh: impl AsArg<ArrayMesh>
) -> Result<(), GodotError>
[src]
&self,
mesh: impl AsArg<ArrayMesh>
) -> Result<(), GodotError>
Adds a new surface to specified [Mesh] with edited data.
pub fn create_from_surface(
&self,
mesh: impl AsArg<ArrayMesh>,
surface: i64
) -> Result<(), GodotError>
[src]
&self,
mesh: impl AsArg<ArrayMesh>,
surface: i64
) -> Result<(), GodotError>
Uses specified surface of given [Mesh] to populate data for MeshDataTool.
Requires [Mesh] with primitive type [constant Mesh.PRIMITIVE_TRIANGLES].
pub fn get_edge_count(&self) -> i64
[src]
Returns the number of edges in this [Mesh].
pub fn get_edge_faces(&self, idx: i64) -> TypedArray<i32>
[src]
Returns array of faces that touch given edge.
pub fn get_edge_meta(&self, idx: i64) -> Variant
[src]
Returns meta information assigned to given edge.
pub fn get_edge_vertex(&self, idx: i64, vertex: i64) -> i64
[src]
Returns index of specified vertex connected to given edge.
Vertex argument can only be 0 or 1 because edges are comprised of two vertices.
pub fn get_face_count(&self) -> i64
[src]
Returns the number of faces in this [Mesh].
pub fn get_face_edge(&self, idx: i64, edge: i64) -> i64
[src]
Returns specified edge associated with given face.
Edge argument must 2 or less because a face only has three edges.
pub fn get_face_meta(&self, idx: i64) -> Variant
[src]
Returns the metadata associated with the given face.
pub fn get_face_normal(&self, idx: i64) -> Vector3D<f32, UnknownUnit>
[src]
Calculates and returns the face normal of the given face.
pub fn get_face_vertex(&self, idx: i64, vertex: i64) -> i64
[src]
Returns the specified vertex of the given face.
Vertex argument must be 2 or less because faces contain three vertices.
pub fn get_format(&self) -> i64
[src]
Returns the [Mesh]'s format. Format is an integer made up of [Mesh] format flags combined together. For example, a mesh containing both vertices and normals would return a format of [code]3[/code] because [constant ArrayMesh.ARRAY_FORMAT_VERTEX] is [code]1[/code] and [constant ArrayMesh.ARRAY_FORMAT_NORMAL] is [code]2[/code].
See [enum ArrayMesh.ArrayFormat] for a list of format flags.
pub fn get_material(&self) -> Option<Ref<Material, Shared>>
[src]
Returns the material assigned to the [Mesh].
pub fn get_vertex(&self, idx: i64) -> Vector3D<f32, UnknownUnit>
[src]
Returns the vertex at given index.
pub fn get_vertex_bones(&self, idx: i64) -> TypedArray<i32>
[src]
Returns the bones of the given vertex.
pub fn get_vertex_color(&self, idx: i64) -> Color
[src]
Returns the color of the given vertex.
pub fn get_vertex_count(&self) -> i64
[src]
Returns the total number of vertices in [Mesh].
pub fn get_vertex_edges(&self, idx: i64) -> TypedArray<i32>
[src]
Returns an array of edges that share the given vertex.
pub fn get_vertex_faces(&self, idx: i64) -> TypedArray<i32>
[src]
Returns an array of faces that share the given vertex.
pub fn get_vertex_meta(&self, idx: i64) -> Variant
[src]
Returns the metadata associated with the given vertex.
pub fn get_vertex_normal(&self, idx: i64) -> Vector3D<f32, UnknownUnit>
[src]
Returns the normal of the given vertex.
pub fn get_vertex_tangent(&self, idx: i64) -> Plane
[src]
Returns the tangent of the given vertex.
pub fn get_vertex_uv(&self, idx: i64) -> Vector2D<f32, UnknownUnit>
[src]
Returns the UV of the given vertex.
pub fn get_vertex_uv2(&self, idx: i64) -> Vector2D<f32, UnknownUnit>
[src]
Returns the UV2 of the given vertex.
pub fn get_vertex_weights(&self, idx: i64) -> TypedArray<f32>
[src]
Returns bone weights of the given vertex.
pub fn set_edge_meta(&self, idx: i64, meta: impl OwnedToVariant)
[src]
Sets the metadata of the given edge.
pub fn set_face_meta(&self, idx: i64, meta: impl OwnedToVariant)
[src]
Sets the metadata of the given face.
pub fn set_material(&self, material: impl AsArg<Material>)
[src]
Sets the material to be used by newly-constructed [Mesh].
pub fn set_vertex(&self, idx: i64, vertex: Vector3D<f32, UnknownUnit>)
[src]
Sets the position of the given vertex.
pub fn set_vertex_bones(&self, idx: i64, bones: TypedArray<i32>)
[src]
Sets the bones of the given vertex.
pub fn set_vertex_color(&self, idx: i64, color: Color)
[src]
Sets the color of the given vertex.
pub fn set_vertex_meta(&self, idx: i64, meta: impl OwnedToVariant)
[src]
Sets the metadata associated with the given vertex.
pub fn set_vertex_normal(&self, idx: i64, normal: Vector3D<f32, UnknownUnit>)
[src]
Sets the normal of the given vertex.
pub fn set_vertex_tangent(&self, idx: i64, tangent: Plane)
[src]
Sets the tangent of the given vertex.
pub fn set_vertex_uv(&self, idx: i64, uv: Vector2D<f32, UnknownUnit>)
[src]
Sets the UV of the given vertex.
pub fn set_vertex_uv2(&self, idx: i64, uv2: Vector2D<f32, UnknownUnit>)
[src]
Sets the UV2 of the given vertex.
pub fn set_vertex_weights(&self, idx: i64, weights: TypedArray<f32>)
[src]
Sets the bone weights of the given vertex.
Methods from Deref<Target = Reference>
pub fn init_ref(&self) -> bool
[src]
Initializes the internal reference counter. Use this only if you really know what you are doing.
Returns whether the initialization was successful.
Trait Implementations
impl Debug for MeshDataTool
[src]
impl Deref for MeshDataTool
[src]
impl DerefMut for MeshDataTool
[src]
impl GodotObject for MeshDataTool
[src]
type RefKind = RefCounted
The memory management kind of this type. This modifies the behavior of the
Ref
smart pointer. See its type-level documentation for more
information. Read more
fn class_name() -> &'static str
[src]
fn null() -> Null<Self>
[src]
fn new() -> Ref<Self, Unique> where
Self: Instanciable,
[src]
Self: Instanciable,
fn cast<T>(&self) -> Option<&T> where
T: GodotObject + SubClass<Self>,
[src]
T: GodotObject + SubClass<Self>,
fn upcast<T>(&self) -> &T where
Self: SubClass<T>,
T: GodotObject,
[src]
Self: SubClass<T>,
T: GodotObject,
unsafe fn assume_shared(&self) -> Ref<Self, Shared>
[src]
unsafe fn assume_thread_local(&self) -> Ref<Self, ThreadLocal> where
Self: GodotObject<RefKind = RefCounted>,
[src]
Self: GodotObject<RefKind = RefCounted>,
unsafe fn assume_unique(&self) -> Ref<Self, Unique>
[src]
impl Instanciable for MeshDataTool
[src]
fn construct() -> Ref<MeshDataTool, Unique>
[src]
impl SubClass<Object> for MeshDataTool
[src]
impl SubClass<Reference> for MeshDataTool
[src]
Auto Trait Implementations
impl RefUnwindSafe for MeshDataTool
impl !Send for MeshDataTool
impl !Sync for MeshDataTool
impl Unpin for MeshDataTool
impl UnwindSafe for MeshDataTool
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SubClass<T> for T where
T: GodotObject,
[src]
T: GodotObject,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,