I'm updating my engine, with the lastest BEPU release. And I'm getting some strange "effect"
I noticed that the MaterialManager lost some functions. May I know why?
Actually there's only a default blender, which give as result a multply between material factors:
Bounciness = a.bounciness * b.bounciness,
KineticFriction = a.kineticFriction * b.kineticFriction,
StaticFriction = a.staticFriction * b.staticFriction
but with an older version (I don't know when the changes has been done) I can select how to blend each properties using PropertyBlendMethod (Average, Max, Min, BiasLow, BiasHigh).
PropertyBlendMethod
Re: PropertyBlendMethod
The enums were discarded in favor of supplying arbitrary blending logic. It's more flexible and a little bit faster in the usual case.
To change the behavior, just provide a different blender delegate. For example, from the CoefficientsDemo:
To change the behavior, just provide a different blender delegate. For example, from the CoefficientsDemo:
Code: Select all
//The material blender defines how the friction and bounciness values are computed between objects.
//It defaults to multiplicative, but for the purposes of this demo, we'll switch it to use the smaller friction and the larger bounciness.
MaterialManager.MaterialBlender = delegate(Material a, Material b, out InteractionProperties properties)
{
properties.KineticFriction = MathHelper.Min(a.KineticFriction, b.KineticFriction);
properties.StaticFriction = MathHelper.Min(a.StaticFriction, b.StaticFriction);
properties.Bounciness = MathHelper.Max(a.Bounciness, b.Bounciness);
};