Skip to content
This repository was archived by the owner on Jun 29, 2024. It is now read-only.

Commit 9f10c29

Browse files
committed
Update box2d_wrapper.cpp
1 parent 65ae790 commit 9f10c29

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/box2d-wrapper/box2d_wrapper.cpp

+9-3
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,9 @@ ShapeHandle box2d::shape_create_circle(real_t radius, b2Vec2 pos) {
10381038
ShapeHandle box2d::shape_create_concave_polyline(const b2Vec2 *points, size_t point_count) {
10391039
b2Hull hull;
10401040
ERR_FAIL_COND_V(point_count > b2_maxPolygonVertices, invalid_shape_handle());
1041-
std::copy(&hull.points[0], &hull.points[point_count], points);
1041+
for (int i = 0; i < point_count; i++) {
1042+
hull.points[i] = points[i];
1043+
}
10421044
hull.count = point_count;
10431045
b2Polygon polygon_shape = b2MakePolygon(&hull, 0.0);
10441046
return ShapeHandle{
@@ -1051,7 +1053,9 @@ ShapeHandle box2d::shape_create_concave_polyline(const b2Vec2 *points, size_t po
10511053
ShapeHandle box2d::shape_create_convex_polyline(const b2Vec2 *points, size_t point_count) {
10521054
b2Hull hull;
10531055
ERR_FAIL_COND_V(point_count > b2_maxPolygonVertices, invalid_shape_handle());
1054-
std::copy(&hull.points[0], &hull.points[point_count], points);
1056+
for (int i = 0; i < point_count; i++) {
1057+
hull.points[i] = points[i];
1058+
}
10551059
hull.count = point_count;
10561060
b2Polygon polygon_shape = b2MakePolygon(&hull, 0.0);
10571061
return ShapeHandle{
@@ -1076,7 +1080,9 @@ ShapeHandle box2d::shape_create_halfspace(const b2Vec2 normal, real_t distance)
10761080

10771081
b2Hull hull;
10781082
ERR_FAIL_COND_V(4 > b2_maxPolygonVertices, invalid_shape_handle());
1079-
std::copy(&hull.points[0], &hull.points[4], points);
1083+
for (int i = 0; i < 4; i++) {
1084+
hull.points[i] = points[i];
1085+
}
10801086
hull.count = 4;
10811087
b2Polygon polygon_shape = b2MakePolygon(&hull, 0.0);
10821088
return ShapeHandle{

0 commit comments

Comments
 (0)