Struct gdnative_bindings_lily::SurfaceTool [−][src]
pub struct SurfaceTool { /* fields omitted */ }
Expand description
core class SurfaceTool
inherits Reference
(reference counted).
Official documentation
See the documentation of this class in the Godot engine’s official documentation. The method descriptions are generated from it and typically contain code samples in GDScript, not Rust.
Memory management
The lifetime of this object is automatically managed through reference counting.
Class hierarchy
SurfaceTool 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
Creates a new instance of this object.
This is a reference-counted type. The returned object is automatically managed
by Ref
.
Adds an array of bones for the next vertex to use. bones
must contain 4 integers.
Adds an index to index array if you are using indexed vertices. Does not need to be called before adding vertices.
Specifies a normal for the next vertex to use.
Specifies whether the current vertex (if using only vertex arrays) or current index (if also using index arrays) should use smooth normals for normal calculation.
Specifies a tangent for the next vertex to use.
pub fn add_triangle_fan(
&self,
vertices: Vector3Array,
uvs: Vector2Array,
colors: ColorArray,
uv2s: Vector2Array,
normals: Vector3Array,
tangents: VariantArray
)
pub fn add_triangle_fan(
&self,
vertices: Vector3Array,
uvs: Vector2Array,
colors: ColorArray,
uv2s: Vector2Array,
normals: Vector3Array,
tangents: VariantArray
)
Inserts a triangle fan made of array data into Mesh being constructed. Requires the primitive type be set to [constant Mesh.PRIMITIVE_TRIANGLES].
Default Arguments
uvs
-PoolVector2Array( )
colors
-PoolColorArray( )
uv2s
-PoolVector2Array( )
normals
-PoolVector3Array( )
tangents
-[ ]
Specifies an optional second set of UV coordinates to use for the next vertex.
Specifies the position of current vertex. Should be called after specifying other vertex properties (e.g. Color, UV).
Specifies weight values for next vertex to use. weights
must contain 4 values.
Called before adding any vertices. Takes the primitive type as an argument (e.g. [constant Mesh.PRIMITIVE_TRIANGLES]).
Returns a constructed ArrayMesh from current information passed in. If an existing ArrayMesh is passed in as an argument, will add an extra surface to the existing ArrayMesh.
Default flag is [constant Mesh.ARRAY_COMPRESS_DEFAULT]. See ARRAY_COMPRESS_*
constants in [enum Mesh.ArrayFormat] for other flags.
Default Arguments
existing
-null
flags
-97280
Commits the data to the same format used by [method ArrayMesh.add_surface_from_arrays]. This way you can further process the mesh data using the ArrayMesh API.
Creates a vertex array from an existing Mesh.
pub fn create_from_blend_shape(
&self,
existing: impl AsArg<Mesh>,
surface: i64,
blend_shape: impl Into<GodotString>
)
pub fn create_from_blend_shape(
&self,
existing: impl AsArg<Mesh>,
surface: i64,
blend_shape: impl Into<GodotString>
)
Creates a vertex array from the specified blend shape of an existing Mesh. This can be used to extract a specific pose from a blend shape.
Generates normals from vertices so you do not have to do it manually. If flip
is true
, the resulting normals will be inverted.
Requires the primitive type to be set to [constant Mesh.PRIMITIVE_TRIANGLES].
Default Arguments
flip
-false
Generates a tangent vector for each vertex. Requires that each vertex have UVs and normals set already.
Shrinks the vertex array by creating an index array (avoids reusing vertices).
Methods from Deref<Target = Reference>
Trait Implementations
type RefKind = RefCounted
type RefKind = RefCounted
Creates an explicitly null reference of Self
as a method argument. This makes type
inference easier for the compiler compared to Option
. Read more
Creates a new instance of Self
using a zero-argument constructor, as a Unique
reference. Read more
Performs a dynamic reference downcast to target type. Read more
Performs a static reference upcast to a supertype that is guaranteed to be valid. Read more
Creates a persistent reference to the same Godot object with shared thread access. Read more
unsafe fn assume_thread_local(&self) -> Ref<Self, ThreadLocal> where
Self: GodotObject<RefKind = RefCounted>,
unsafe fn assume_thread_local(&self) -> Ref<Self, ThreadLocal> where
Self: GodotObject<RefKind = RefCounted>,
Creates a persistent reference to the same Godot object with thread-local thread access. Read more
Creates a persistent reference to the same Godot object with unique access. Read more
Recovers a instance ID previously returned by Object::get_instance_id
if the object is
still alive. See also TRef::try_from_instance_id
. Read more
Auto Trait Implementations
impl RefUnwindSafe for SurfaceTool
impl !Send for SurfaceTool
impl !Sync for SurfaceTool
impl Unpin for SurfaceTool
impl UnwindSafe for SurfaceTool