I'm making a first person shooter with Sparky's Collision DLL based on the sliding demo. My level is far too big so I had to scale it down to 5%, but the collision data doesn't scale. I call SC_AllowObjectScaling() and SC_UpdateObject(), but it doesn't make a difference. I'm using the newest version of the DLL (2.05), and I realize that scaling must now be done after setting up the object's collision. Also, I wasn't sure if the SC_AllowObjectScaling() went before or after I actually scale the object, so I tried both ways and it didn't make a difference. Here's my code:
(The collision setup is in the constructor)
#include "World.h"
#include "DarkGDK.h"
#include "SC_Collision.h"
/****************************************************************************************************************************
********** CONSTRUCTORS *****************************************************************************************************
****************************************************************************************************************************/
cWorld::cWorld(int id, char *filename, float scale)
{
m_id = id;
dbLoadObject(filename, m_id);
dbSetObjectLight(m_id, false);
SC_SetupObject(m_id, 1, 0);
dbScaleObject(m_id, scale, scale, scale);
SC_AllowObjectScaling(m_id);
SC_UpdateObject(m_id);
}
/****************************************************************************************************************************
********** DESTRUCTOR *******************************************************************************************************
****************************************************************************************************************************/
cWorld::~cWorld()
{
SC_RemoveObject(m_id);
dbDeleteObject(m_id);
}
/****************************************************************************************************************************
********** HANDLING METHOD **************************************************************************************************
****************************************************************************************************************************/
void cWorld::Handle()
{
SC_UpdateObject(m_id);
}
/****************************************************************************************************************************
********** GET METHODS ******************************************************************************************************
****************************************************************************************************************************/
int cWorld::GetID() const { return m_id; }
float cWorld::GetSizeX() const { return dbObjectSizeX(m_id); }
float cWorld::GetSizeY() const { return dbObjectSizeY(m_id); }
float cWorld::GetSizeZ() const { return dbObjectSizeZ(m_id); }
float cWorld::GetPosX() const { return dbObjectPositionX(m_id); }
float cWorld::GetPosY() const { return dbObjectPositionY(m_id); }
float cWorld::GetPosZ() const { return dbObjectPositionZ(m_id); }
Can anybody figure out why it's not working?
Windows Vista Home Premium (32-bit) :: Intel Core 2 Duo - 2.2Ghz :: 2GB DDR2 SDRAM :: nVidia GeForce 8600M GS - 256 MB