What are the pros and cons between the "SimpleCharacterController" and the "SphereCharacterController" ?
I see they are both less featured and complex than the full CharacterController but what the performance and quality differences between the two?
Also as a seperate issue I am getting a NAN when changeing a dynamic sphere to kinimatic on the collision with a static object.
Code below
This is the code I use to throw the physicsball:
Code: Select all
MyPhysics = new Sphere(in_Position, 0.3f, 10);
MyPhysics.LinearVelocity = in_Direction * 30;
MyPhysics.CollisionInformation.Events.ContactCreated += HasHitEvent;
PhysicsManager.GET.PhysicsSpace.Add(MyPhysics);
Code: Select all
private void HasHitEvent(EntityCollidable in_Sender, Collidable in_Other, CollidablePairHandler in_Pair, ContactData in_Contact)
{
EntityCollidable HitObj = in_Other as EntityCollidable;
if (HitObj != null)
{
if(HitObj.Entity.IsDynamic)
{
LivingPhysicsEntity HitEntity = HitObj.Entity.Tag as LivingPhysicsEntity;
if(HitEntity != null)
{
HitEntity.DoDamage();
}
}
else
{
//We are currently assumeing that this is a hit against the terrain
if (MyPhysics.IsDynamic)
{
MyPhysics.AngularMomentum = Vector3.Zero;
MyPhysics.LinearMomentum = Vector3.Zero;
MyPhysics.BecomeKinematic();
}
}
}
}
Anyone have any ideas...?