I add bodies dynamic rapidly and character fall of floor
Posted: Sat Jan 11, 2020 11:31 am
I add bodies dynamic in front of character and character is fall of floor
here are my code when add
I want it to passthrought character so I make function isPassthrought
thank you
here are my code when add
Code: Select all
var handle = Simulation.Bodies.Add(BodyDescription.CreateKinematic(trigger.StartPosition, collidable, new BodyActivityDescription(-1)));
Code: Select all
private bool IsPassThrought(CollidablePair pair) {
bepu.EventContactInit(pair.A.Handle, pair.B.Handle);
var a = bepu.GetHandleUnit(pair.A.Handle);
var b = bepu.GetHandleUnit(pair.B.Handle);
if (a == null|| b == null)
{
return true;
}
var isPassThroughA = bepu.GetHandleUnit(pair.A.Handle).Collider.isPassThrough;
if (isPassThroughA)
{
return false;
};
var isPassThroughB = bepu.GetHandleUnit(pair.B.Handle).Collider.isPassThrough;
if (isPassThroughB)
{
return false;
}
else
{
return true;
}
}