summaryrefslogtreecommitdiff
path: root/servers/physics/collision_object_sw.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'servers/physics/collision_object_sw.cpp')
-rw-r--r--servers/physics/collision_object_sw.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/servers/physics/collision_object_sw.cpp b/servers/physics/collision_object_sw.cpp
index f7a58a9cf2..09f72ff39b 100644
--- a/servers/physics/collision_object_sw.cpp
+++ b/servers/physics/collision_object_sw.cpp
@@ -53,7 +53,7 @@ void CollisionObjectSW::set_shape(int p_index, ShapeSW *p_shape) {
ERR_FAIL_INDEX(p_index, shapes.size());
shapes[p_index].shape->remove_owner(this);
- shapes[p_index].shape = p_shape;
+ shapes.write[p_index].shape = p_shape;
p_shape->add_owner(this);
if (!pending_shape_update_list.in_list()) {
@@ -66,8 +66,8 @@ void CollisionObjectSW::set_shape_transform(int p_index, const Transform &p_tran
ERR_FAIL_INDEX(p_index, shapes.size());
- shapes[p_index].xform = p_transform;
- shapes[p_index].xform_inv = p_transform.affine_inverse();
+ shapes.write[p_index].xform = p_transform;
+ shapes.write[p_index].xform_inv = p_transform.affine_inverse();
if (!pending_shape_update_list.in_list()) {
PhysicsServerSW::singleton->pending_shape_update_list.add(&pending_shape_update_list);
}
@@ -97,7 +97,7 @@ void CollisionObjectSW::remove_shape(int p_index) {
continue;
//should never get here with a null owner
space->get_broadphase()->remove(shapes[i].bpid);
- shapes[i].bpid = 0;
+ shapes.write[i].bpid = 0;
}
shapes[p_index].shape->remove_owner(this);
shapes.remove(p_index);
@@ -117,7 +117,7 @@ void CollisionObjectSW::_set_static(bool p_static) {
if (!space)
return;
for (int i = 0; i < get_shape_count(); i++) {
- Shape &s = shapes[i];
+ const Shape &s = shapes[i];
if (s.bpid > 0) {
space->get_broadphase()->set_static(s.bpid, _static);
}
@@ -128,7 +128,7 @@ void CollisionObjectSW::_unregister_shapes() {
for (int i = 0; i < shapes.size(); i++) {
- Shape &s = shapes[i];
+ Shape &s = shapes.write[i];
if (s.bpid > 0) {
space->get_broadphase()->remove(s.bpid);
s.bpid = 0;
@@ -143,7 +143,7 @@ void CollisionObjectSW::_update_shapes() {
for (int i = 0; i < shapes.size(); i++) {
- Shape &s = shapes[i];
+ Shape &s = shapes.write[i];
if (s.bpid == 0) {
s.bpid = space->get_broadphase()->create(this, i);
space->get_broadphase()->set_static(s.bpid, _static);
@@ -170,7 +170,7 @@ void CollisionObjectSW::_update_shapes_with_motion(const Vector3 &p_motion) {
for (int i = 0; i < shapes.size(); i++) {
- Shape &s = shapes[i];
+ Shape &s = shapes.write[i];
if (s.bpid == 0) {
s.bpid = space->get_broadphase()->create(this, i);
space->get_broadphase()->set_static(s.bpid, _static);
@@ -195,7 +195,7 @@ void CollisionObjectSW::_set_space(SpaceSW *p_space) {
for (int i = 0; i < shapes.size(); i++) {
- Shape &s = shapes[i];
+ Shape &s = shapes.write[i];
if (s.bpid) {
space->get_broadphase()->remove(s.bpid);
s.bpid = 0;