93 lines
2.6 KiB
C++
93 lines
2.6 KiB
C++
// CollisionManager.cpp : Defines the entry point for the DLL application.
|
|
//
|
|
|
|
#include "CKAll.h"
|
|
#include "FloorManager.h"
|
|
#include "CollisionManager.h"
|
|
|
|
CKPluginInfo g_PluginInfo;
|
|
|
|
// {secret}
|
|
char* CollisionManagerName = "Collision Manager";
|
|
// {secret}
|
|
char* FloorManagerName = "Floor Manager";
|
|
|
|
|
|
CKERROR CreateCollisionManager(CKContext* context)
|
|
{
|
|
// we register all the enums related to collision manager
|
|
CKParameterManager* pm = context->GetParameterManager();
|
|
pm->RegisterNewEnum(CKPGUID_OBSTACLEPRECISION,"Geometry Precision","BoundingBox=1,Faces=2");
|
|
pm->RegisterNewEnum(CKPGUID_OBSTACLEPRECISIONBEH,"Geometry Precision (Behavioral)","Automatic=0,BoundingBox=1,Faces=2");
|
|
pm->RegisterNewStructure(CKPGUID_OBSTACLE,"Obstacle","Obstacle Type,Use Hierarchy?",CKPGUID_OBSTACLEPRECISION,CKPGUID_BOOL);
|
|
|
|
CKParameterTypeDesc* param_type;
|
|
param_type = pm->GetParameterTypeDescription(CKPGUID_OBSTACLEPRECISION);
|
|
if (param_type) param_type->dwFlags|=CKPARAMETERTYPE_HIDDEN;
|
|
|
|
new CollisionManager(context);
|
|
return CK_OK;
|
|
}
|
|
|
|
CKERROR RemoveCollisionManager(CKContext* context)
|
|
{
|
|
CKParameterManager* pm = context->GetParameterManager();
|
|
pm->UnRegisterParameterType(CKPGUID_OBSTACLEPRECISION);
|
|
pm->UnRegisterParameterType(CKPGUID_OBSTACLEPRECISIONBEH);
|
|
pm->UnRegisterParameterType(CKPGUID_OBSTACLE);
|
|
|
|
CollisionManager* man=(CollisionManager*)context->GetManagerByGuid(COLLISION_MANAGER_GUID);
|
|
delete man;
|
|
return CK_OK;
|
|
}
|
|
|
|
CKERROR CreateFloorManager(CKContext* context)
|
|
{
|
|
new FloorManager(context);
|
|
return CK_OK;
|
|
}
|
|
|
|
CKERROR RemoveFloorManager(CKContext* context)
|
|
{
|
|
FloorManager* man=(FloorManager*)context->GetManagerByGuid(FLOOR_MANAGER_GUID);
|
|
delete man;
|
|
return CK_OK;
|
|
}
|
|
|
|
int CKGetPluginInfoCount()
|
|
{
|
|
return 2;
|
|
}
|
|
|
|
CKPluginInfo* CKGetPluginInfo(int Index)
|
|
{
|
|
switch (Index) {
|
|
case 0:
|
|
g_PluginInfo.m_Author="Virtools";
|
|
g_PluginInfo.m_Description="Collision Manager for NoName";
|
|
g_PluginInfo.m_Extension="";
|
|
g_PluginInfo.m_Type=CKPLUGIN_MANAGER_DLL;
|
|
g_PluginInfo.m_Version=0x000001;
|
|
g_PluginInfo.m_InitInstanceFct=CreateCollisionManager;
|
|
g_PluginInfo.m_ExitInstanceFct=RemoveCollisionManager;
|
|
g_PluginInfo.m_GUID=COLLISION_MANAGER_GUID;
|
|
g_PluginInfo.m_Summary=CollisionManagerName;
|
|
break;
|
|
case 1:
|
|
g_PluginInfo.m_Author="Virtools";
|
|
g_PluginInfo.m_Description="Floor Manager for NoName";
|
|
g_PluginInfo.m_Extension="";
|
|
g_PluginInfo.m_Type=CKPLUGIN_MANAGER_DLL;
|
|
g_PluginInfo.m_Version=0x000001;
|
|
g_PluginInfo.m_InitInstanceFct=CreateFloorManager;
|
|
g_PluginInfo.m_ExitInstanceFct=RemoveFloorManager;
|
|
g_PluginInfo.m_GUID=FLOOR_MANAGER_GUID;
|
|
g_PluginInfo.m_Summary=FloorManagerName;
|
|
break;
|
|
}
|
|
return &g_PluginInfo;
|
|
}
|
|
|
|
#include "GJKEngine/Polyhedron.h"
|
|
|