Re: Freeze Physics

#4
// On physical state change, wake all entities resting on this glass so they can fall through
if (physicsChanged)
{
AABB glassArea = m_planeBBox;
glassArea.Expand(Vec3Constants<f32>::fVec3_One);

IPhysicalEntity** pEntities = NULL;
int numEntities = gEnv->pPhysicalWorld->GetEntitiesInBox(glassArea.min, glassArea.max, pEntities, ent_sleeping_rigid | ent_living | ent_ignore_noncolliding);

for (int i = 0; i < numEntities; ++i)
{
if (IPhysicalEntity* pPhysEnt = pEntities)
{
// Only need to wake up sleeping entities
pe_status_awake status;
if (pPhysEnt->GetStatus(&status) == 0)
{
pe_action_awake wake;
wake.bAwake = 1;
pPhysEnt->Action(&wake);
}
}
}
}

Re: Freeze Physics

#9
As temporarily suspense physics update. I'm using impulse to move it, and the physics to handle collisions. I don't want my player to roll down cliffs :D. Its for my player because settings the position through entity.position makes you run through walls etc

Who is online

Users browsing this forum: No registered users and 3 guests