Skip to content

CollisionGroups Subgroups can't collide with themselves. #163

Answered by jrouwe
DennisSmolek asked this question in Q&A
Discussion options

You must be logged in to vote

The GroupFilterTable never allows a sub group to collide with the same sub group:

https://github.com/jrouwe/JoltPhysics/blob/cca9c4ad170aff8119632ea8763474f1b20f8d54/Jolt/Physics/Collision/GroupFilterTable.h#L30

/// * 'x' means sub group 1 == sub group 2 and we define this to never collide.

I would use collision layers instead through e.g. the ObjectLayerPairFilterTable, these allow defining if a layer collides with itself or not.

Alternatively you can write your own GroupFilter implementation by extending GroupFilterJS and defining the logic in the way you want, something like:

let filter = new Jolt.GroupFilterJS();
filter.CanCollide = (group1, group2) => {
	let g1 = Jolt.wrapPointer(gr…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@DennisSmolek
Comment options

@LeXXik
Comment options

@DennisSmolek
Comment options

@jrouwe
Comment options

@DennisSmolek
Comment options

Answer selected by DennisSmolek
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants