Skip to content

Commit fc35b11

Browse files
committed
Initialize NativeRopeContext members
Technically not really necessary because they will be initialized when a rope node is loaded, but do it anyway for safety.
1 parent 425cd7f commit fc35b11

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

src/NativeRopeContext.hpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,21 @@ namespace godot
2121
void _constraint();
2222

2323
public:
24-
Node2D* rope;
24+
Node2D* rope = nullptr;
2525
PackedVector2Array points;
2626
PackedVector2Array oldpoints;
2727
PackedFloat32Array seg_lengths;
2828
PackedFloat32Array simulation_weights;
29-
float gravity;
29+
float gravity = 0.0;
3030
Vector2 gravity_direction;
31-
float damping;
32-
float stiffness;
33-
float max_endpoint_distance;
34-
int num_constraint_iterations;
31+
float damping = 0.0;
32+
float stiffness = 0.0;
33+
float max_endpoint_distance = 0.0;
34+
int num_constraint_iterations = 0;
3535
Ref<Curve> damping_curve;
36-
bool fixate_begin;
37-
bool resolve_to_begin;
38-
bool resolve_to_end;
36+
bool fixate_begin = true;
37+
bool resolve_to_begin = false;
38+
bool resolve_to_end = false;
3939
};
4040
}
4141

0 commit comments

Comments
 (0)