| Thread Tools | Search this thread |
|---|
pjstyle
| October 1, 2008 7:08 AM PDT Importing 3dsmax scene into direct3d environment | ||||
Hey there, I am trying to import the data from a hkx, i have the following data imported so far: - The havok world - Geometry of objects Now i have retrieved the rigid bodies connected to the objects in the scene, but when i try to add the rigid bodies to the havok world my game crashes. My log contains the following: No thread memory manager specified. You must specify a thread memory manager when initializing hkBaseSystem. Here's a snippit from my import sourcecode: void Game::Initialize()
{
hkLoader loader;
hkRootLevelContainer* container = loader.load("../../../GameAssets/Max Scenes/Scene.hkx");
hkxScene* scene = (hkxScene*)container->findObjectByType("hkxScene");
hkpPhysicsData* physicsData = (hkpPhysicsData*)container->findObjectByType("hkpPhysicsData");
// Retrieve world
m_world = new hkpWorld(*physicsData->getWorldCinfo());
if(m_world != HK_NULL)
{
//
// Register the box-box collision agent
//
{
hkpAgentRegisterUtil::registerAllAgents(m_world->getCollisionDispatcher());
}
m_world->lock();
for(int i=0;i<scene->m_numMeshes;i++)
{
char rigidBodyName[10];
sprintf(rigidBodyName, "Box0%d", i + 1);
hkxMesh* mesh = scene->m_meshes[i];
hkpRigidBody* body = physicsData->findRigidBodyByName(rigidBodyName);
if(body != HK_NULL)
{
SimpleHavocObject* obj = new SimpleHavocObject(
m_device,
D3DXVECTOR3(1,0,0),
D3DXVECTOR3(0,0,0),
mesh);
obj->SetRigidBody(body);
// Add rigidbody to Havok world
m_world->addEntity(body);
objects.push_back(obj);
}
}
m_world->unlock();
}
}Thanks in advance, Pieter Ted de Vries | |||||
|
|||||||||||||
|
|||||||||||||
| 6668 users have contributed to 28284 threads and 87462 posts to date. |
|---|
| In the past 24 hours, we have 5 new thread(s) 32 new posts(s), and 37 new user(s). In the past 3 days, the most popular thread for everyone has been Fortran and Matlab The most posts were made to Larger Test Data The post with the most views is Quoting - nabeels Hello e Please welcome our newest member karolbe |