Skip to content

Search

ドキュメント

softbody3d

A deformable 3D body: particles linked by elastic constraints, laid out by kind and made of what the material rows say. The node is drawn from the…

このページの内容

3d · physics · render · 35 properties · 3D

A deformable 3D body: particles linked by elastic constraints, laid out by kind and made of what the material rows say. The node is drawn from the solver's positions.

In a scene, softbody3d is the node key that applies it. A script reaches each property below as a field on node.softbody3d: reading one asks the running component, and assigning one leaves the rest alone. The whole table is node.softbody3d.get() and node.softbody3d.set(table).

Properties

property type default description
can_sleep bool true Let the body stop being simulated once it settles
collides bool true Meet the world at all; off, the body passes through everything and only its pins and ties hold it
collision_layer flags ["1"] The layers this collider is on One of 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32.
collision_mask flags [] The layers it collides with; empty means every layer One of 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32.
color color [0.8,0.8,0.8,1] What the body is drawn in when its node has nothing of its own to deform, as a cloth or a rope has not
contact_force_threshold float 0 How hard a contact must be before on_contact_force is called At least 0.
contact_pairs flags ["dynamic_dynamic","dynamic_kinematic","dynamic_static"] Which pairs of body kinds this collider is tested against; a sensor watching kinematic platforms needs more than the default One of dynamic_dynamic, dynamic_kinematic, dynamic_static, kinematic_kinematic, kinematic_static, static_static.
dominance int 0 Which body wins a contact: a higher one is never pushed by a lower one Range -127–127.
edge_springs list [] Edges with a spring of their own, its frequency in hertz and its damping ratio, instead of the edge or bend rows', each named by the two particles it joins
enabled bool true Take part in the simulation; off leaves the body where it is with no contacts or constraints until it is on again, without a rebuild
gravity_scale float 1 How much gravity pulls on the particles
kind enum box How the body's particles and elements are laid out One of box, sphere, cloth, cloth_tube, rope, volumetric, triangle_mesh, custom.
linear_damping float 0 Air friction on the particles At least 0.
mass float 1 What the whole body weighs, spread over its particles At least 0.
masses list [] Each particle's own mass, by index; empty spreads mass over them evenly
max_tears_per_step int 0 The most edges that may tear in one step, which paces a crack; 0 is no limit At least 0.
mesh asset · mesh — Geometry for a triangle_mesh or volumetric body, and the skin a body with cells carries when its soft_skin3d asks for one
min_piece int 0 The smallest piece, in elements, a tear may split off; 0 lets rapier choose At least 0.
orientation enum auto How the surface meets what is inside it: solid encloses matter and pushes bodies out, shell holds bodies in, auto is solid when the surface is closed One of auto, solid, shell.
particle_radius float 0 How thick the particles are; 0 takes what the layout works out At least 0.
physics_material asset · physics_material — What the surface is made of: friction, bounce and how each combines; empty takes a physics_material at its defaults
pinned_particles list [] The particles held where they are, by index: a cloth hangs from these, and softbody_particles says how many there are to choose from
regions list [] Parts of the body with a material of their own, each the particles it covers: soft_material for its edge spring and shape matching, empty keeping the body's; stiffness_scale on the cells wholly inside, tear_resistance on its edges and cells, and pinned to hold it still. Each is a soft_frame body joints may attach to
seams list [] Structural edges added between particles the layout left apart, each as long as its two particles stand at the start
self_collision bool false Let the body's own surface collide with itself, which stops a cloth passing through its own fold
sensor bool false Report contacts and push nothing: the body passes through what it touches
soft_material asset · soft_material — What the body is made of: its cells, springs, volume, yield and tearing; empty takes a soft_material at its defaults
solver enum constraints Which solver runs the elasticity: sequential constraints, or an implicit Euler step over the whole body One of constraints, fem.
solver_iterations int 3 Extra iterations inside each substep, for the same Range 0–64.
solver_layer flags ["1"] Layers for the solver alone: a pair can be detected but not resolved One of 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32.
solver_mask flags [] Which solver layers this one pushes against; empty means all of them One of 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32.
solver_substeps int 0 Extra solver substeps for this body and everything it touches Range 0–64.
tear_resistance list [] Edges that tear sooner or later than the rest, each named by the two particles it joins: below 1 is a perforation, above 1 a seam
tension_only enum none Which edges resist stretching only, so the body folds freely and never pushes itself open: none, all, or the tension_only_edges listed One of none, all, listed.
tension_only_edges list [] The edges that resist stretching only when tension_only is listed, each named by the two particles it joins

Asset types this component references: mesh, physics_material, soft_material.

Script functions

Methods of node.softbody3d, the handle a node carrying this component exposes. Every handle also has get(), set(table), patch(table), has() and remove().

From physics3d:

method what it does
add_particle_force(int, Vec3) Push one particle with force each step until reset_softbody_forces.
add_softbody_force(Vec3) Push every free particle with force each step until reset_softbody_forces.
apply_particle_impulse(int, Vec3) Strike one particle.
apply_softbody_impulse(Vec3) Change every free particle's velocity by impulse at once, as a kick to the whole body.
apply_softbody_impulse_at(Vec3, Vec3, float) Strike the particles within radius of point, less the further they are; a radius of 0 strikes them all.
apply_softbody_radial_impulse(Vec3, float, float) Push the particles within radius away from center, as a blast does.
attach_particle(int, Node) Tie one particle to a node's rigid body where it is now: the body and the particle pull on each other.
cut_softbody([Vec3]) -> [physics3d::SoftTear] Cut the body along a blade at once, as softbody_crossing reads it; answers a record for each piece it changed, the one on_tear hears.
detach_particle(int) -> bool Untie one particle from every body it was attached to; answers whether it was attached.
has_pending_tears() -> bool Whether some edge or cell is marked to tear at the end of the next step.
pin_particle(int) Hold one particle where it is, which is how a cloth hangs from a hook.
reset_plasticity() Undo every permanent set the body took: rest lengths, rest angles and rest shapes go back to how it was built, and it springs back from where it is.
reset_softbody_forces() Take back every force add_softbody_force and add_particle_force gave the body.
set_cell_tear_resistance(int, float) The same for one cell's tear strain.
set_edge_tear_resistance(int, float) How many times the material's threshold one edge takes to tear; 1 is the material's.
set_particle_damaged(int, bool) Mark one particle as damaged or mend it: a damaged particle tears as an outside one does, which seeds where a crack starts.
set_particle_position(int, Vec3) Put one particle at at with no change of velocity.
set_particle_target(int, Vec3) Move a held particle to at over the next step, with the velocity that takes, which is how a cloth is dragged.
set_particle_velocity(int, Vec3) Set one particle's velocity; a held one keeps moving at it.
softbody_attachments() -> [physics3d::SoftAttachment] Every particle tied to a rigid body.
softbody_boundary() -> [[int]] The body's surface as particle indices: segments in 2D, triangles in 3D.
softbody_cell(int) -> physics3d::SoftCell Everything one cell holds.
softbody_cells() -> [[int]] Every cell as its particle indices: triangles in 2D, tetrahedra in 3D.
softbody_center() -> Vec3 The centre of mass of the body and its pieces, which is where it is when a deformable body has no one position.
softbody_contacts() -> physics3d::SoftContacts What the body's surface touched in the last step.
softbody_crossing([Vec3]) -> physics3d::SoftCrossing The edges and cells a blade meets, without cutting: the blade is a segment's two points in 2D, a triangle's three in 3D.
softbody_dihedral(int) -> physics3d::SoftDihedral Everything one hinge holds.
softbody_dihedrals() -> [[int]] Every bending hinge between two surface triangles, as four particle indices: the shared edge, then the two opposite particles.
softbody_edge(int) -> physics3d::SoftEdge Everything one edge holds.
softbody_edges() -> [[int]] Every edge as the two particle indices it joins, in the order softbody_stress reports them.
softbody_mass() -> float What the whole body weighs, every piece included.
softbody_particle(int) -> physics3d::SoftParticle Everything one particle holds.
softbody_particle_radius() -> float How thick the particles are: what was asked for, or what the layout worked out.
softbody_particles() -> int How many particles the body has, every piece torn off it included: a generator decides, not the author.
softbody_position(int) -> Vec3 Where one particle is, in world space.
softbody_rest_volume() -> float How much they enclose at rest.
softbody_sleeping() -> bool Whether the body has come to rest and stopped being simulated.
softbody_stress() -> [float] Each edge's load as a fraction of its tear threshold, smoothed over tear_smoothing: 0 slack, 1 tearing; the larger of its stretch over tear_strain and its force over tear_force, and 0 while neither is set.
softbody_velocity(int) -> Vec3 How fast one particle is moving, in world space.
softbody_volume() -> float How much space the body and every piece torn off it enclose right now, against softbody_rest_volume for how far it is squeezed.
softbody_volume_pieces() -> [physics3d::SoftVolumePiece] Each closed piece of the surface whose volume is held; an open sheet has none.
tear_cell(int) Tear one cell at the end of the next step: a particle near its middle splits across its main stretch.
tear_edge(int) Tear one edge at the end of the next step.
tear_softbody([int], [int]) -> [physics3d::SoftTear] Tear the given edges and cells at once; answers a record for each piece it changed, the one on_tear hears.
unpin_particle(int) Let a held particle go; it keeps the velocity it had.
wake_softbody() Start simulating a resting body again.

本当によろしいですか?