Quantcast
Channel: Cocos Forums - Latest topics
Viewing all articles
Browse latest Browse all 17070

Define multiple category masks in cpShapeFilter using Chipmunk

$
0
0

@Wayfaerer wrote:

Hi guys,

I'm trying to update my project to 3.12 and I am unable to filter the collisions using chipmunk. I'm having trouble with cpShapeFilter. How can I add several category masks like explained in the table in: https://chipmunk-physics.net/release/ChipmunkLatest-Docs/#cpShape-Filtering?

For example I want to have a player that collides with the platforms, items and obstacles, I tried the following and does not work:

playerShape->filter = cpShapeFilter{ , Common::playerCategory, (Common::platformCategory, Common::itemCategory, Common::obstacleCategory) };

platformShape->filter = cpShapeFilter{ 0, Common::platformCategory, Common::playerCategory };

Can someone give an example of how to do this?
Thank you very much.

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 17070

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>