h
This commit is contained in:
parent
13106ad8b2
commit
b4b989f5f7
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||||
|
|
||||||
public partial class XRHand : XRController3D
|
public partial class XRHand : XRController3D
|
||||||
{
|
{
|
||||||
List<Generic6DofJoint3D> joints = new();
|
List<PinJoint3D> joints = new();
|
||||||
|
|
||||||
[Export]
|
[Export]
|
||||||
RigidBody3D rb;
|
RigidBody3D rb;
|
||||||
|
@ -51,15 +51,19 @@ public partial class XRHand : XRController3D
|
||||||
|
|
||||||
GD.Print("Picked up ", body);
|
GD.Print("Picked up ", body);
|
||||||
|
|
||||||
Generic6DofJoint3D joint = new();
|
PinJoint3D joint = new();
|
||||||
joint.NodeA = body.GetPath();
|
joint.NodeA = body.GetPath();
|
||||||
joint.NodeB = rb.GetPath();
|
joint.NodeB = rb.GetPath();
|
||||||
joints.Add(joint);
|
joints.Add(joint);
|
||||||
rb.AddChild(joint);
|
rb.AddChild(joint);
|
||||||
joint.Position = Vector3.Zero;
|
joint.Position = Vector3.Zero;
|
||||||
joint.SetParamX(Generic6DofJoint3D.Param.LinearLimitSoftness, 5f);
|
|
||||||
joint.SetParamY(Generic6DofJoint3D.Param.LinearLimitSoftness, 5f);
|
PinJoint3D joint2 = new();
|
||||||
joint.SetParamZ(Generic6DofJoint3D.Param.LinearLimitSoftness, 5f);
|
joint2.NodeB = body.GetPath();
|
||||||
|
joint2.NodeA = rb.GetPath();
|
||||||
|
joints.Add(joint);
|
||||||
|
body.AddChild(joint);
|
||||||
|
joint.Position = Vector3.Zero;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue