CodingTrain / CodingTrain/Suggestion-Box

[Question][Help] Problem in Placing Stuff in Box2D

Đang mở
#552 6 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Không có dữ liệu ngôn ngữ
Star
570
Fork
85
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Hello people,
Just to introduce the situation, I am a physics teacher and educator and I am also an aspiring artist, so you can imagine the power I felt in my hands when I first discovered Processing from Shiffman's YT channel and then I the videos on Box2D.

So in my skecth I have a gas container with a piston (to show the kinetic theory of gases) and this container position is determined by the Vec2 pos_pote. The problem is that when I try to place it elsewhere from the middle of the scene (width/2, height/2), the rectangles are draw properly but the fixtures of Box2D become a little bit shifted. The farther from the center of the screen pos_pote is, the more shifted the box2D fixtures become. I've been trying to debugg this for over three days, and I still don't know what is going on. Well, see for yourself:

[kinetic_gas.zip](https://github.com/CodingTrain/Rainbow-Topics/files/999492/kinetic_gas.zip)
_[click on the screen to place particles and notice the collision hitboxes are all shifted to the right from the containers perspective, in this case, pos_pote = (width/2+100, height/2), so things are misplaced only on the x axis.]_

I did not found anyone on the web with the same problem, so I'm desperate. If anyone could help me it would be totally awesome. Thanks very much,
Daniel.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Mở kinetic_gas.zip trước và kiểm tra cách pos_pote được sử dụng để vẽ container và tạo các fixture của Box2D. So sánh các hình chữ nhật được render với vị trí của các fixture trong khi di chuyển container ra xa trung tâm màn hình; hoàn thành khi các hitbox va chạm vẫn thẳng hàng với container.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Lĩnh vực
game-dev
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.