Hello, I just recently started using DBPro Collision (Sparky's) and was trying to cast a ray and no matter what I do it always returns 0. I am using
Dark GDK 2.0 RC4. Any ideas?
Here's my code..
#include <include/puregdk/core/darkgdk.h>
#include <include/puregdk/initDarkGDK.h>
#include <include/puregdk/simpleWindow.h>
#include <include/puregdk/plugins/dgdk-dbpcollisions.h>
using namespace std;
int __stdcall WinMain(HINSTANCE, HINSTANCE, LPSTR, int) {
HWND hWnd;
if (!initDarkGDK("gdkengine.dll"))
return 1;
hWnd = openWindow(0, 0, 1440, 900, "Raycasting", WS_OVERLAPPED | WS_CLIPSIBLINGS | WS_CAPTION | WS_SYSMENU | WS_CLIPCHILDREN, true);
dbOpenScreen(hWnd, 0, 0, 1440, 900);
ShowWindow(hWnd, SW_SHOW);
dbSyncRate(60);
SC_Start();
int y;
char output[50];
int Land = dbCreateObjectBox(500, 5, 500, 10);
SC_SetupObject(Land, 1, 2); */
do {
y = SC_RayCast(500, 0, -20, 0, 0, 20, 0, 0);
sprintf_s(output, "Ray Collision: %d", y);
dbText(50, 50, output);
SC_UpdateObject(Land);
dbSync();
}
}while (windowEvent() != WM_CLOSE);
dbCloseScreen();
}