external symbols 2 (with source code this time)

external symbols 2 (with source code this time)

imagem de havokisking3344
#ifndef CONSOLE_H
#define CONSOLE_H

#include 
#include 
// Math and base include
using namespace std;
using namespace irr;
using namespace io;
using namespace scene;
using namespace video;
using namespace core;
using namespace gui;

#include 
#include 
#include 
#include 
#include 
#include 

// Dynamics includes
#include 										
#include 	
#include 					
#include 				
#include 					

#include 			
#include 			

#include 								
#include 							
#include 	

#include 
#include 
#include 

// Visual Debugger includes
#include 
#include 				

// Keycode
#include 

#if !defined USING_HAVOK_PHYSICS
#error Physics is needed to build this demo. It is included in the common package for reference only.
#endif

// Classlists
#define INCLUDE_HAVOK_PHYSICS_CLASSES
#define HK_CLASSES_FILE 
#include 


#define NODEFAULTLTLIB

static void HK_CALL errorReport(const char* msg, void* userArgGivenToInit)
{
	printf("%s", msg);
}

class IHavok
{
protected:
	hkMemoryRouter* memoryRouter;
	hkJobThreadPool* IThreadPool;
	int totalNumThreadsUsed;
	hkHardwareInfo hwInfo;
	hkCpuJobThreadPoolCinfo threadPoolCinfo;
	hkJobQueueCinfo info;
	hkJobQueue* jobQueue;
	hkMonitorStream* MonitorStream;
	hkpWorld* hkPhysicalWorld;
	hkpWorldCinfo worldInfo;
	hkpAgentRegisterUtil RegisterUtil;
	//Visual Debugger
	hkArray contexts;
	hkpPhysicsContext* context;
	hkVisualDebugger* vb;
	hkpStepResult hkResult;
	hkJobThreadPool* threadPool;
public:

	IHavok();

	~IHavok();

	hkpWorld* CreateWorld();

	void Update(hkpWorld* world);

	hkVisualDebugger* Init_VisualDebugger();

}; 

#endif 

I resently posted on here about two external symbols in my app and i didn't post the source!! Sorry for expecting anything to come out of it. anyways, here's my havok implamention code.

the .CPP file:

IHavok::IHavok()
{
	//Init Memory Router.
	this->memoryRouter = hkMemoryInitUtil::initDefault();
	hkBaseSystem::init(this->memoryRouter,errorReport );
	hkGetHardwareInfo(hwInfo);
	totalNumThreadsUsed = hwInfo.m_numThreads;

	this->threadPoolCinfo.m_numThreads = this->totalNumThreadsUsed - 1;
	
	this->threadPoolCinfo.m_timerBufferPerThreadAllocation = 2000000;
	threadPool = new hkCpuJobThreadPool( threadPoolCinfo );

	this->info.m_jobQueueHwSetup.m_numCpuThreads = this->totalNumThreadsUsed;
	this->jobQueue = new hkJobQueue(info);

	this->MonitorStream->getInstance().resize(2000000);
}

IHavok::~IHavok()
{
	hkBaseSystem::quit();
	hkMemoryInitUtil::quit();
}

hkpWorld* IHavok::CreateWorld()
{
	this->worldInfo.m_simulationType = hkpWorldCinfo::SIMULATION_TYPE_MULTITHREADED;

	this->worldInfo.m_broadPhaseBorderBehaviour = hkpWorldCinfo::BROADPHASE_BORDER_REMOVE_ENTITY;

	this->hkPhysicalWorld = new hkpWorld(worldInfo);

	this->hkPhysicalWorld->m_wantDeactivation = false;

	hkPhysicalWorld->markForWrite();

	this->RegisterUtil.registerAllAgents(hkPhysicalWorld->getCollisionDispatcher());
	
	this->hkPhysicalWorld->registerWithJobQueue(this->jobQueue);

	return this->hkPhysicalWorld;
}

hkVisualDebugger* IHavok::Init_VisualDebugger()
{
	this->context = new hkpPhysicsContext();
	hkpPhysicsContext::registerAllPhysicsProcesses();
	context->addWorld(this->hkPhysicalWorld);
	this->contexts.pushBack(context);

	hkPhysicalWorld->unmarkForWrite();
	this->vb = new hkVisualDebugger(contexts);
	vb->serve();

	return vb;
} 
That's everything.


1 post / 0 new
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.