havok runtime error

havok runtime error

after the world->stepDeltaTime,

a breakpoint occured and shows

Assert:you must not call integrate twice without calling collidestack trace is:

..........................

my english is not good,anyone know what it is?

8 post / 0 nuovi
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione

Hi Legendary,

It sounds like something is going wrong in the physics collide step, which happens inside stepDeltaTime. That's all I know from what you describe. If there are other Havok warnings that appear before you hit the assert, they might be able to guide you to the problem.

Josh S. Havok Developer Support Engineer www.havok.com

Citation :

Havok - Josh S. a écrit :

Hi Legendary,

It sounds like something is going wrong in the physics collide step, which happens inside stepDeltaTime. That's all I know from what you describe. If there are other Havok warnings that appear before you hit the assert, they might be able to guide you to the problem.


i tried to upload a screendshot but not authorized..
i just simply add the basic code like the demo stepbystep/physics.and add a sphere and a ground.when i just create one of them, there's no such problem,it just appears when i add them together.
i will post more informations another time, thanks for the reply.

Quote:

Havok - Josh S. wrote:

Hi Legendary,

It sounds like something is going wrong in the physics collide step, which happens inside stepDeltaTime. That's all I know from what you describe. If there are other Havok warnings that appear before you hit the assert, they might be able to guide you to the problem.

ErrorMessage:
World\Simulation\hkpSimulation.cpp(134):[0x9764EA25] Assert: you must not call integrate twice without calling collideStack trace is:
y:\build\20120405_200003_pcxsperpetualkeycode\source\common\base\system\error\hkdefaulterror.cpp(137):'hkDefaultError::message'
y:\build\20120405_200003_pcxsperpetualkeycode\source\physics\dynamics\world\simulation\hksimulation.cpp(134):'hkSimulation::integrate'
y:\build\20120405_200003_pcxsperpetualkeycode\source\physics\dynamics\world\simulation\hksimulation.cpp(361):'hkSimulation::stepDeltaTime'
y:\build\20120405_200003_pcxsperpetualkeycode\source\physics\dynamics\world\hkpworld.cpp(134):'hkWorld::stepDeltaTime'

and some my custom functions below

void InitPhysics()
{
PlatformInit();

hkMallocAllocator baseMalloc;
// Need to have memory allocated for the solver. Allocate 1mb for it.
hkMemoryRouter* memoryRouter = hkMemoryInitUtil::initDefault( &baseMalloc, hkMemorySystem::FrameInfo(1024 * 1024) );
hkBaseSystem::init( memoryRouter, errorReport );

hkpWorldCinfo info;
info.m_gravity.set(0.0f, -9.8f, 0.0f);
info.setBroadPhaseWorldSize(10000.0f);
info.setupSolverInfo(hkpWorldCinfo::SOLVER_TYPE_8ITERS_MEDIUM);
info.m_collisionTolerance = 0.01f;

world = new hkpWorld(info);

world->lock();

// Register all collision agents
// It's important to register collision agents before adding any entities to the world.
hkpAgentRegisterUtil::registerAllAgents( world->getCollisionDispatcher() );

CreateGround();
CreateSphere();

world->unlock();
}

void UpdatePhysics()
{
hkVector4 spherePosition = sphereBody->getPosition();
hkVector4 groundPosition = groundBody->getPosition();
world->stepDeltaTime(1000 / 60.0f);
}

void CreateSphere()
{
const hkVector4 halfExtents(20.0f, 4.0f, 20.0f);
hkpShape* sphereShape = new hkpSphereShape(5.0f);

// Compute the inertia tensor from the shape
hkpMassProperties massProperties;
hkpInertiaTensorComputer::computeShapeVolumeMassProperties(sphereShape, 5.0f, massProperties);

// Assign the rigid body properties
hkpRigidBodyCinfo bodyInfo;
bodyInfo.m_mass = massProperties.m_mass;
bodyInfo.m_centerOfMass = massProperties.m_centerOfMass;
bodyInfo.m_inertiaTensor = massProperties.m_inertiaTensor;
bodyInfo.m_shape = sphereShape;
bodyInfo.m_motionType = hkpMotion::MOTION_BOX_INERTIA;
bodyInfo.m_position.set(0.0f, 10.0f, -6.0f);

sphereBody = new hkpRigidBody(bodyInfo);
sphereShape->removeReference();

world->addEntity(sphereBody);
}

Hi Legendary Y.--

It's interesting that the problem only shows up when you add the sphere and mesh. What does the implementation of CreateMesh() look like?
Also, stepDeltaTime() takes units in seconds, but it looks like you're passing it milliseconds. That isn't necessarily the issue, but it's probably going to create undesirable behavior.

--Tim

Citation :

HavokTim a écrit :

Hi Legendary Y.--

It's interesting that the problem only shows up when you add the sphere and mesh. What does the implementation of CreateMesh() look like?
Also, stepDeltaTime() takes units in seconds, but it looks like you're passing it milliseconds. That isn't necessarily the issue, but it's probably going to create undesirable behavior.

--Tim


void CreateSphere()
{
const hkVector4 halfExtents(20.0f, 4.0f, 20.0f);
hkpShape* sphereShape = new hkpSphereShape(5.0f);

// Compute the inertia tensor from the shape
hkpMassProperties massProperties;
hkpInertiaTensorComputer::computeShapeVolumeMassProperties(sphereShape, 5.0f, massProperties);

// Assign the rigid body properties
hkpRigidBodyCinfo bodyInfo;
bodyInfo.m_mass = massProperties.m_mass;
bodyInfo.m_centerOfMass = massProperties.m_centerOfMass;
bodyInfo.m_inertiaTensor = massProperties.m_inertiaTensor;
bodyInfo.m_shape = sphereShape;
bodyInfo.m_motionType = hkpMotion::MOTION_BOX_INERTIA;
bodyInfo.m_position.set(0.0f, 10.0f, -6.0f);

sphereBody = new hkpRigidBody(bodyInfo);
sphereShape->removeReference();

world->addEntity(sphereBody);
}

void CreateGround()
{
const hkVector4 halfExtents(1000.0f, 4.0f, 1000.0f);
hkpShape* groundShape = new hkpBoxShape(halfExtents, 0.05f );

hkpRigidBodyCinfo bodyInfo;
bodyInfo.m_mass = 0.0f;
bodyInfo.m_shape = groundShape;
bodyInfo.m_motionType = hkpMotion::MOTION_FIXED;
bodyInfo.m_position.set(-500.0f, 0.0f, -500.0f);

groundBody = new hkpRigidBody(bodyInfo);
groundShape->removeReference();

world->addEntity(groundBody);
}

I've changed the stepDeltaTime() like this:world->stepDeltaTime(1 / 60.0f);
the scence and objects show up for about one second and then it still shows the same message.
seems like the problem occored when the two mesh collide

Hi Legendary Y.--

I'm fairly certain that your problem is not in the code that you've provided. I put together a demo based on the PhysicsVDB StepByStep demo using the snippets you included, and it runs without issue. I suggest looking into the function that calls UpdatePhysics() as well as any other code that calls into physics you haven't included here. I'd also suggest that you disable any other systems that may be running to try and simplify your test case. Please let me know what you discover - thanks!

--Tim

Citation :

HavokTim a écrit :

Hi Legendary Y.--

I'm fairly certain that your problem is not in the code that you've provided. I put together a demo based on the PhysicsVDB StepByStep demo using the snippets you included, and it runs without issue. I suggest looking into the function that calls UpdatePhysics() as well as any other code that calls into physics you haven't included here. I'd also suggest that you disable any other systems that may be running to try and simplify your test case. Please let me know what you discover - thanks!

--Tim

OK,thanks,I will try

Lascia un commento

Eseguire l'accesso per aggiungere un commento. Non siete membri? Iscriviti oggi