[][src]Struct gdnative::api::SoftBody

pub struct SoftBody { /* fields omitted */ }

core class SoftBody inherits MeshInstance (unsafe).

Official documentation

See the documentation of this class in the Godot engine's official documentation.

Memory management

Non reference counted objects such as the ones of this type are usually owned by the engine.

SoftBody is a reference-only type. Persistent references can only exist in the unsafe Ref<SoftBody> form.

In the cases where Rust code owns an object of this type, for example if the object was just created on the Rust side and not passed to the engine yet, ownership should be either given to the engine or the object must be manually destroyed using Ref::free, or Ref::queue_free if it is a Node.

Class hierarchy

SoftBody 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 SoftBody[src]

pub fn new() -> Ref<SoftBody, Unique>[src]

Creates a new instance of this object.

Because this type is not reference counted, the lifetime of the returned object is not automatically managed.

Immediately after creation, the object is owned by the caller, and can be passed to the engine (in which case the engine will be responsible for destroying the object) or destroyed manually using Ref::free, or preferably Ref::queue_free if it is a Node.

pub fn add_collision_exception_with(&self, body: impl AsArg<Node>)[src]

Adds a body to the list of bodies that this body can't collide with.

pub fn areaAngular_stiffness(&self) -> f64[src]

pub fn get_collision_exceptions(&self) -> VariantArray<Shared>[src]

Returns an array of nodes that were added as collision exceptions for this body.

pub fn collision_layer(&self) -> i64[src]

The physics layers this SoftBody is in.
			Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the collision_mask property.
			A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.

pub fn get_collision_layer_bit(&self, bit: i64) -> bool[src]

Returns an individual bit on the collision mask.

pub fn collision_mask(&self) -> i64[src]

The physics layers this SoftBody scans for collisions. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.

pub fn get_collision_mask_bit(&self, bit: i64) -> bool[src]

Returns an individual bit on the collision mask.

pub fn damping_coefficient(&self) -> f64[src]

pub fn drag_coefficient(&self) -> f64[src]

pub fn linear_stiffness(&self) -> f64[src]

pub fn parent_collision_ignore(&self) -> NodePath[src]

[NodePath] to a [CollisionObject] this SoftBody should avoid clipping.

pub fn pose_matching_coefficient(&self) -> f64[src]

pub fn pressure_coefficient(&self) -> f64[src]

pub fn simulation_precision(&self) -> i64[src]

Increasing this value will improve the resulting simulation, but can affect performance. Use with care.

pub fn total_mass(&self) -> f64[src]

The SoftBody's mass.

pub fn volume_stiffness(&self) -> f64[src]

pub fn is_ray_pickable(&self) -> bool[src]

If [code]true[/code], the [SoftBody] will respond to [RayCast]s.

pub fn remove_collision_exception_with(&self, body: impl AsArg<Node>)[src]

Removes a body from the list of bodies that this body can't collide with.

pub fn set_areaAngular_stiffness(&self, areaAngular_stiffness: f64)[src]

pub fn set_collision_layer(&self, collision_layer: i64)[src]

The physics layers this SoftBody is in.
			Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the collision_mask property.
			A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.

pub fn set_collision_layer_bit(&self, bit: i64, value: bool)[src]

Sets individual bits on the layer mask. Use this if you only need to change one layer's value.

pub fn set_collision_mask(&self, collision_mask: i64)[src]

The physics layers this SoftBody scans for collisions. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.

pub fn set_collision_mask_bit(&self, bit: i64, value: bool)[src]

Sets individual bits on the collision mask. Use this if you only need to change one layer's value.

pub fn set_damping_coefficient(&self, damping_coefficient: f64)[src]

pub fn set_drag_coefficient(&self, drag_coefficient: f64)[src]

pub fn set_linear_stiffness(&self, linear_stiffness: f64)[src]

pub fn set_parent_collision_ignore(
    &self,
    parent_collision_ignore: impl Into<NodePath>
)
[src]

[NodePath] to a [CollisionObject] this SoftBody should avoid clipping.

pub fn set_pose_matching_coefficient(&self, pose_matching_coefficient: f64)[src]

pub fn set_pressure_coefficient(&self, pressure_coefficient: f64)[src]

pub fn set_ray_pickable(&self, ray_pickable: bool)[src]

If [code]true[/code], the [SoftBody] will respond to [RayCast]s.

pub fn set_simulation_precision(&self, simulation_precision: i64)[src]

Increasing this value will improve the resulting simulation, but can affect performance. Use with care.

pub fn set_total_mass(&self, mass: f64)[src]

The SoftBody's mass.

pub fn set_volume_stiffness(&self, volume_stiffness: f64)[src]

Methods from Deref<Target = MeshInstance>

pub fn create_convex_collision(&self)[src]

This helper creates a [StaticBody] child node with a [ConvexPolygonShape] collision shape calculated from the mesh geometry. It's mainly used for testing.

pub fn create_debug_tangents(&self)[src]

This helper creates a [MeshInstance] child node with gizmos at every vertex calculated from the mesh geometry. It's mainly used for testing.

pub fn create_trimesh_collision(&self)[src]

This helper creates a [StaticBody] child node with a [ConcavePolygonShape] collision shape calculated from the mesh geometry. It's mainly used for testing.

pub fn mesh(&self) -> Option<Ref<Mesh, Shared>>[src]

The [Mesh] resource for the instance.

pub fn skeleton_path(&self) -> NodePath[src]

[NodePath] to the [Skeleton] associated with the instance.

pub fn skin(&self) -> Option<Ref<Skin, Shared>>[src]

Sets the skin to be used by this instance.

pub fn get_surface_material(
    &self,
    surface: i64
) -> Option<Ref<Material, Shared>>
[src]

Returns the [Material] for a surface of the [Mesh] resource.

pub fn get_surface_material_count(&self) -> i64[src]

Returns the number of surface materials.

pub fn set_mesh(&self, mesh: impl AsArg<Mesh>)[src]

The [Mesh] resource for the instance.

pub fn set_skeleton_path(&self, skeleton_path: impl Into<NodePath>)[src]

[NodePath] to the [Skeleton] associated with the instance.

pub fn set_skin(&self, skin: impl AsArg<Skin>)[src]

Sets the skin to be used by this instance.

pub fn set_surface_material(&self, surface: i64, material: impl AsArg<Material>)[src]

Sets the [Material] for a surface of the [Mesh] resource.

Trait Implementations

impl Debug for SoftBody[src]

impl Deref for SoftBody[src]

type Target = MeshInstance

The resulting type after dereferencing.

impl DerefMut for SoftBody[src]

impl GodotObject for SoftBody[src]

type RefKind = ManuallyManaged

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

impl Instanciable for SoftBody[src]

impl QueueFree for SoftBody[src]

impl SubClass<GeometryInstance> for SoftBody[src]

impl SubClass<MeshInstance> for SoftBody[src]

impl SubClass<Node> for SoftBody[src]

impl SubClass<Object> for SoftBody[src]

impl SubClass<Spatial> for SoftBody[src]

impl SubClass<VisualInstance> for SoftBody[src]

Auto Trait Implementations

impl RefUnwindSafe for SoftBody

impl !Send for SoftBody

impl !Sync for SoftBody

impl Unpin for SoftBody

impl UnwindSafe for SoftBody

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SubClass<T> for T where
    T: GodotObject
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.