Hi
im running vista 64 with visual studio 2008 and have linked the following libs from the debug_multithreaded folder in debug mode and release_multithreaded folder in release mode
hkBase.lib, hkpDynamics.lib, hkpCollide.lib, hkpConstraintSolver.lib, hkpInternal.lib, hkpUtilities.lib
first of all, sorry cause its going to be a long post, i dont like to make long posts full of code, but im totally stuck and have really no idea why the setpDeltaTime is crashing.
ill explain what ive done so maybe you can see the errors
first - initializing the world
hkMemory *memory_manager = new hkPoolMemory();
hkThreadMemory *thread_memory = new hkThreadMemory(memory_manager, 16);
hkBaseSystem::init( memory_manager, thread_memory, errorReportFunction );
memory_manager->removeReference();
//init the thread stack
int stack_size = 1024 * 1000;
thread_stack = hkAllocate( stack_size, HK_MEMORY_CLASS_BASE);
hkThreadMemory::getInstance().setStackArea( thread_stack, stack_size);
//create the world entity
hkpWorldCinfo world_info;
world_info.m_simulationType = hkpWorldCinfo::SIMULATION_TYPE_DISCRETE;
world_info.m_gravity.set( 0,-9.8f,0);
world_info.m_collisionTolerance = 0.1f;
world_info.setBroadPhaseWorldSize( 150.0f );
world_info.setupSolverInfo( hkpWorldCinfo::SOLVER_TYPE_4ITERS_MEDIUM );
hkpWorld *world = new hkpWorld( world_info );
hkpAgentRegisterUtil::registerAllAgents( world->getCollisionDispatcher() );
the world seems to be created ok, i have no null pointers and memory frees ok with some more destructor code
now i want to create a rigid body out of a triangle mesh
first create the shape. (vertex data and triangle index data points to float * and unsigned int * data which is valid cause i use it in more places and its ok)
hkpExtendedMeshShape *mesh_shape = new hkpExtendedMeshShape;
const float *vertex_data;
const void *triangle_index_data;
hkpExtendedMeshShape::TrianglesSubpart triangle_subpart;
//vertex data
triangle_subpart.m_vertexStriding = 3 * sizeof(float); //12
triangle_subpart.m_vertexBase = vertex_data;
triangle_subpart.m_numVertices = vertices.size();
triangle_subpart.m_numTriangleShapes = tindices.size();
triangle_subpart.m_indexStriding = 3 * sizeof(unsigned int); //12
triangle_subpart.m_stridingType = hkpExtendedMeshShape::INDICES_INT32;
triangle_subpart.m_indexBase = triangle_index_data;
//mesh_shape->setRadius( 10.0f );
if (mesh_shape != NULL)
mesh_shape->add
TrianglesSubpart(triangle_subpart);
In release mode i get a crash in mesh_shape->addTrianglesSubpart, in debug its ok any ideas?
now create the rigid body
hkpRigidBodyCinfo info;
info.m_shape = mesh_shape;
info.m_motionType = hkpMotion::MOTION_FIXED;
info.m_qualityType = HK_COLLIDABLE_QUALITY_FIXED;
info.m_position.set(initial_position.GetX(), initial_position.GetY(), initial_position.GetZ());
info.m_mass = 1.0;
info.m_collisionResponse = hkpMaterial::RESPONSE_SIMPLE_CONTACT;
/////////
hkpMassProperties massProperties;
hkpInertiaTensorComputer::computeShapeVolumeMassProperties(mesh_shape, 1.0f, massProperties);
info.m_inertiaTensor = massProperties.m_inertiaTensor;
//////////
hkpRigidBody *rigid_body = new hkpRigidBody(info);
mesh_shape->removeReference();
world->addEntity(rigid_body);
rigid_body->removeReference();
Now everything is supposed to be initialized ok and receive no warnings or errors in the error callback function of the world entity, but the stepdelta function crashes and i dont have a clue of whats happening. Also, a lot of functions dont return any error code, which does not help at all
do you see any errors in the code???
again, sorry for the long post


