Skyquakers/godot-rope3d
소개
Dynamic Physical 3D Rope in Godot that interacts with Rigidbody3D
디자인 및 미디어측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 0
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalGodot Rope3D
Physical 3D rope based on PinJoint3D that interacts with RigidBody3D
Installation
Via asset library
Usage
GUI
- Instantiate child scene. Adding child node will not work because Rope3D scene has children
- click Rope3D
- Select start point, end point, adjust other values
- Reference the
Rope3Dnode in code, callrope.make()when you need it
Code
const RopeScene: PackedScene = preload("res://addons/rope3d/Rope3D.tscn")
@onready var start_point = $RigidBody/Node3D
@onready var end_point = $AnotherRigidBody/AnotherNode3D
func _ready():
var rope = RopeScene.instantiate()
rope.start_point = start_point
rope.end_point = end_point
rope.rope_length = 6.0
rope.radius = 0.1
rope.resolution = 6.0 # number of pinjoints
# adjust pin joint attributes
rope.bias = 0.3
rope.damping = 1.0
rope.impulse_clamp = 0.01
var ok = rope.can_make()
if ok:
add_child(rope)
rope.make()
Rope Making Fails
Due to dynamic generating, there are many situations that rope.make() can raise errors
- The
rope_lengthis shorter then distance between twoNode3Ds resolutioncannot be less then one- The size of segment is longer than the rope
- Two global positions of
Node3Dand the turning point position cannot constitude to a triangle, as shown in the figure below
If you want to make gameplays that allows player to create rope on the fly, make sure to check the boolean result of rope.make() or rope.can_make()
Without Physics
If you do not need physics, you can simply instantiate a RopeMesh and operate the curve points of the child Path3D
RopeMesh is an ImmediateMesh that draws a 3d rope from Path3D
verlet rope C#, ImmediateMesh rope with particle verlet integration simulation, is highly recommended if you don't need RigidBody3D interaction and use C# for your project.
How it works
관련 프로젝트 살펴보기
불러오는 중…