QGraphicsItem像素完美碰撞检测器
QGraphicsItem Pixel Perfect Collision Detector
我想在两个或多个QGraphicsItem
之间实现一个像素完美的碰撞检测器。QGraphicsItem
类提供了一个使用QPainterPath
对象的碰撞检测器,所以现在我想将图像从文件加载到只有不透明像素的QPainterPath
(使不透明像素的形状准确(,这样我就可以使用QGraphicsItem
自己的碰撞检测器来实现像素完美的碰撞检测器。我想知道有没有什么方法可以做这个把戏??
使用alpha通道的图像时,可以使用QGraphicsPixmapItem。使用
QGraphicsPixmapItem::shapeMode(QGraphicsPixmapitem::MaskShape)
这将基于alpha通道提取遮罩以创建形状。
相关文章:
- 落砂模拟碰撞检测C++和SFML
- SFML 中的重力和碰撞检测
- 我的碰撞检测中的奇怪行为
- 如何为球形物体和三角形地形提供高效的碰撞检测和响应
- 圆形与方形碰撞检测以及需要响应C++ |OpenGL。我的问题就是这个"I need to keep the circle outside the square"
- 在Qt3D中进行碰撞检测的预期方法(或好方法)是什么?
- 在碰撞检测方面苦苦挣扎.如何正确检测碰撞?
- 三角形-三角形碰撞检测问题
- 不同类别之间的C SFML碰撞检测
- 使用D3DXVECTOR C 的碰撞检测,发生碰撞后该怎么办
- 当我发生碰撞检测时,矢量迭代器不兼容
- 如何使用灵活的碰撞库在两个点云或点云与机器人末端执行器模型之间进行碰撞检测
- 优化碰撞检测C
- 使用碰撞检测来增加SFML 2.4中的游戏分数的问题
- 使用OnComponentHit UE4 C++进行碰撞检测
- 体素世界中的碰撞检测
- 如何在 2D 碰撞检测中正确解析碰撞的位置?
- (中广)获取AABB树生成的边界立方体进行碰撞检测
- 使用C 中的单元格 /图块 /网格进行碰撞检测的最佳数据结构
- 多维边界框碰撞检测