hello, i am new to BEPU.
I need to implement a ForceField that works only on specific objects. is there anything like the collisiongrouprules that applies to forcefields?
I haven't found any related topic about this in the forums and the only way for me to get around this is to make my game objects visible to the forcefield class i will be implementing soon and check for types in the calculateImpulse method (this solution should be last resort)
thank you in advance =)
ForceField groups or rules?
ForceField groups or rules?
Last edited by Zantal on Sun Dec 18, 2011 4:25 pm, edited 1 time in total.
Re: ForceField groups or rules?
There's no direct analog of collision rules built into force fields. They're a pretty simplistic convenience system.
The force field shape has an IsEntityAffected method which you could override to do filtering, though. If you wanted to perform testing using collision rules, you could use the CollisionRules helper methods to do so. The CollisionRules.GetCollisionRule method will compute the collision rule between two objects in the same way that the broad phase and collision pipeline does. You could also call the delegate directly. To use it, you'd need a CollisionRules instance that you treat as the shape's collision rules.
The force field shape has an IsEntityAffected method which you could override to do filtering, though. If you wanted to perform testing using collision rules, you could use the CollisionRules helper methods to do so. The CollisionRules.GetCollisionRule method will compute the collision rule between two objects in the same way that the broad phase and collision pipeline does. You could also call the delegate directly. To use it, you'd need a CollisionRules instance that you treat as the shape's collision rules.
Re: ForceField groups or rules?
thank you for the reply.
Everything is clear now, i will override IsEntityAffected and GetPossiblyAffectedEntities.
I should have checked the forceFieldShape class before
Everything is clear now, i will override IsEntityAffected and GetPossiblyAffectedEntities.
I should have checked the forceFieldShape class before