gpt4 book ai didi

java - 如何测试两个任意形状的重叠(或碰撞)

转载 作者:行者123 更新时间:2023-12-02 04:11:15 24 4
gpt4 key购买 nike

我正在寻找一个 Java 库,可以用它来计算两个简单(无相交线或孔)2D 多边形的碰撞。

具体实现是拖放“贴纸”应用程序,用户可以在屏幕周围拖动各种实体形状,并且形状不能重叠。

我自己对如何编写这个有一个模糊的想法,但希望避免重新发明这辆自行车,但是,经过多次搜索后,我找不到任何有用的东西。

最佳答案

Box2D

Features

Rigid body physics
Stable stacking
Gravity
Fast persistent contact solver
Dynamic tree broadphase
Sliding friction
Boxes, circles, edges and polygons
Several joint types: distance, revolute, prismatic, pulley, gear, mouse
MotorsSleeping (removes motionless bodies from simulation until touched)
Continuous collision detection (accurate solving of fast bodies)
Ray casts
Sensors
Serialization
Dynamic, Kinematic, and Static bodies
Liquid particle simulation from Google's LiquidFun

关于java - 如何测试两个任意形状的重叠(或碰撞),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33767744/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com