I would use the base, and only store the base in the list. Then, call the apply friction function for every base object who is set to resting. Then, dont set any walls to resting :)
void Physics::Update(float dt){ foreach (PhysBase p in objects) { switch (p->ContactState()) { case Resting: p->UpdatingRestingContactStuffSuch AsApplyFrictionIfThatsTheSortOfThingYoureInto(); break; } }}
Incase a wall does get set to a resting state, the update resting function will not be derived for a static object and essentially a no op.
You may not be interested in all this virtual call overhead. You could store the objects in different lists by type, and then use a templated update function to update each type of object.
Note: I would have probably chose to put this switch statement inside the object itself, and let the derived type determine which cases are relevant and how to handle them.
My physics loops usually look like this:
void Physics::Update(float dt){ foreach (PhysBase p in objects) p->PreStep(); foreach (PhysBase p in objects) p->CollisionAndResolution(); foreach (PhysBase p in objects) p->Integration(); foreach (PhysBase p in objects) p->PostStep();}
Or something along those lines. I would do the resting contact stuff in PreStep of the RigidBody type, but PreStep for a StaticBody type may be blank, and entirely different for a ChacterBody or VehicleBody type.