Hi Norbo, sorry for late amount of questions. The more I'm using bepu the more I realize I'm really bad at physics...
In V1 I have two bodies that are actually character controllers, let's say A and B. I'd like that A cant' push B at all, and B can't push A at all, however keep A and B working as dynamic objects and keep pushing other objects, falling through ledges, etc... without having to use a kinematic object. Is that possible?
thanks!
[v1]Disable push between some objects
Re: [v1]Disable push between some objects
Setting up a collision rule that stops collision detection between the two character controllers would work. They'd just go through each other completely. The CollisionFilteringDemo shows an example of how to use that system.
If you want a different behavior where the characters still collide in some nondynamic sense but cannot push, that would require manual collision resolution to implement the desired arbitrary behavior. You could do this with collision rules too- use the NoSolver rule to allow contacts to be generated, and then examine the collision pair contacts to decide what to do with the collision.
(In v2, there is no 'collision rule' system, just callbacks that permit or deny collision detection and constraint generation. A similar system can be built on top of the callbacks- the RagdollDemo shows one example implementation where connected body parts do not collide based on bitfields.)
If you want a different behavior where the characters still collide in some nondynamic sense but cannot push, that would require manual collision resolution to implement the desired arbitrary behavior. You could do this with collision rules too- use the NoSolver rule to allow contacts to be generated, and then examine the collision pair contacts to decide what to do with the collision.
(In v2, there is no 'collision rule' system, just callbacks that permit or deny collision detection and constraint generation. A similar system can be built on top of the callbacks- the RagdollDemo shows one example implementation where connected body parts do not collide based on bitfields.)
Re: [v1]Disable push between some objects
Thanks, I'll try with NoSolver path. I suppose the code to handle that nondynamic behaviour must be added after calling Space.Update, isn't it? (I mean, there's no specific callback for that)
Re: [v1]Disable push between some objects
Executing it outside the Update would work, but if you implement it as velocity modifications, it may work best before the solver and after collision detection. Every execution stage has a Starting and Finishing event, so you could add a handler to Space.Solver.Starting.
-
- Posts: 7
- Joined: Fri Feb 15, 2019 2:03 pm
Re: [v1]Disable push between some objects
Hello. I have similar task for v2. How can I add CollisionRule in v2?
Oh, excuse me. Did not see. I will try this first.(In v2, there is no 'collision rule' system, just callbacks that permit or deny collision detection and constraint generation. A similar system can be built on top of the callbacks- the RagdollDemo shows one example implementation where connected body parts do not collide based on bitfields.)