BEPUphysics.CollisionTests.Manifolds.BoxSphereContactManifold.Initialize C# (CSharp) Method

Initialize() public method

Initializes the manifold.
Thrown when the collidables being used are not of the proper type.
public Initialize ( Collidable newCollidableA, Collidable newCollidableB ) : void
newCollidableA BEPUphysics.BroadPhaseEntries.Collidable First collidable.
newCollidableB BEPUphysics.BroadPhaseEntries.Collidable Second collidable.
return void
        public override void Initialize(Collidable newCollidableA, Collidable newCollidableB)
        {
            box = newCollidableA as ConvexCollidable<BoxShape>;
            sphere = newCollidableB as ConvexCollidable<SphereShape>;

            if (box == null || sphere == null)
            {
                box = newCollidableB as ConvexCollidable<BoxShape>;
                sphere = newCollidableA as ConvexCollidable<SphereShape>;
                if (box == null || sphere == null)
                {
                    throw new Exception("Inappropriate types used to initialize pair.");
                }
            }

        }