@@ -74,7 +74,7 @@ void PhysicalBoneSimulator3D::_pose_updated() {
7474 return ;
7575 }
7676 // If this triggers that means that we likely haven't rebuilt the bone list yet.
77- if (skeleton->get_bone_count () != bones.size ()) {
77+ if (skeleton->get_bone_count () != ( int ) bones.size ()) {
7878 // NOTE: this is re-entrant and will call _pose_updated again.
7979 _bone_list_changed ();
8080 } else {
@@ -85,8 +85,8 @@ void PhysicalBoneSimulator3D::_pose_updated() {
8585}
8686
8787void PhysicalBoneSimulator3D::_bone_pose_updated (Skeleton3D *p_skeleton, int p_bone_id) {
88- ERR_FAIL_INDEX ( p_bone_id, bones.size ());
89- bones. write [p_bone_id].global_pose = p_skeleton->get_bone_global_pose (p_bone_id);
88+ ERR_FAIL_UNSIGNED_INDEX (( uint32_t ) p_bone_id, bones.size ());
89+ bones[p_bone_id].global_pose = p_skeleton->get_bone_global_pose (p_bone_id);
9090}
9191
9292void PhysicalBoneSimulator3D::_set_active (bool p_active) {
@@ -96,7 +96,7 @@ void PhysicalBoneSimulator3D::_set_active(bool p_active) {
9696}
9797
9898void PhysicalBoneSimulator3D::_reset_physical_bones_state () {
99- for (int i = 0 ; i < bones.size (); i += 1 ) {
99+ for (uint32_t i = 0 ; i < bones.size (); i += 1 ) {
100100 if (bones[i].physical_bone ) {
101101 bones[i].physical_bone ->reset_physics_simulation_state ();
102102 }
@@ -140,15 +140,15 @@ void PhysicalBoneSimulator3D::bind_physical_bone_to_bone(int p_bone, PhysicalBon
140140 ERR_FAIL_INDEX (p_bone, bone_size);
141141 ERR_FAIL_COND (bones[p_bone].physical_bone );
142142 ERR_FAIL_NULL (p_physical_bone);
143- bones. write [p_bone].physical_bone = p_physical_bone;
143+ bones[p_bone].physical_bone = p_physical_bone;
144144
145145 _rebuild_physical_bones_cache ();
146146}
147147
148148void PhysicalBoneSimulator3D::unbind_physical_bone_from_bone (int p_bone) {
149149 const int bone_size = bones.size ();
150150 ERR_FAIL_INDEX (p_bone, bone_size);
151- bones. write [p_bone].physical_bone = nullptr ;
151+ bones[p_bone].physical_bone = nullptr ;
152152
153153 _rebuild_physical_bones_cache ();
154154}
@@ -193,7 +193,7 @@ void PhysicalBoneSimulator3D::_rebuild_physical_bones_cache() {
193193 for (int i = 0 ; i < b_size; ++i) {
194194 PhysicalBone3D *parent_pb = _get_physical_bone_parent (i);
195195 if (parent_pb != bones[i].cache_parent_physical_bone ) {
196- bones. write [i].cache_parent_physical_bone = parent_pb;
196+ bones[i].cache_parent_physical_bone = parent_pb;
197197 if (bones[i].physical_bone ) {
198198 bones[i].physical_bone ->_on_bone_parent_changed ();
199199 }
@@ -361,15 +361,15 @@ Transform3D PhysicalBoneSimulator3D::get_bone_global_pose(int p_bone) const {
361361void PhysicalBoneSimulator3D::set_bone_global_pose (int p_bone, const Transform3D &p_pose) {
362362 const int bone_size = bones.size ();
363363 ERR_FAIL_INDEX (p_bone, bone_size);
364- bones. write [p_bone].global_pose = p_pose;
364+ bones[p_bone].global_pose = p_pose;
365365}
366366
367367void PhysicalBoneSimulator3D::_process_modification (double p_delta) {
368368 Skeleton3D *skeleton = get_skeleton ();
369369 if (!skeleton) {
370370 return ;
371371 }
372- ERR_FAIL_COND (skeleton->get_bone_count () != bones.size ());
372+ ERR_FAIL_COND (skeleton->get_bone_count () != ( int ) bones.size ());
373373 for (int i = 0 ; i < skeleton->get_bone_count (); i++) {
374374 if (!bones[i].physical_bone ) {
375375 continue ;
0 commit comments