Well, then obviously it's not a common problem, if I have to describe in detail... my mistake.
Just using the normal collisions in DGDK. Not that I know what I'm doing since I don't normally try to find tutorials until something doesn't work or I don't understand it. So I could be doing everything wrong.
// Some Wacky stuff that does things... or is it wacky things that do stuff?
// By Benjamin
// ... \\
#include "DarkGDK.h"
// Functions
// Global vars
int c = 0.0;
float DefaultZ = 10.0;
// Global constants
// Entry point
void DarkGDK ( void )
{
// General setup
dbRandomize(dbTimer());
dbSyncOn();
dbSyncRate( 100 );
dbFastSync();
dbSetDisplayMode(1280, 1024, 32);
dbSetWindowPosition(102, 78);
//dbSetWindowSize(1024, 786);
dbMaximizeWindow();
// Make a camera
//dbMakeCamera(1);
//dbSetCurrentCamera(1);
//dbSetCameraFOV(1, 50 );
// Make a closed in box area
// Make 4 sides
dbMakeObjectBox( 1001, 6.0, 0.2, 1.0);
dbMakeObjectBox( 1002, 0.2, 6.0, 1.0);
dbInstanceObject ( 1003, 1001);
dbInstanceObject ( 1004, 1002);
// Rotate left right sides
// commented out since rotation doesn't seem to rotate collision boxes
//dbZRotateObject(3, 90.0);
//dbZRotateObject(4, 90.0);
// Move them to positions and DefaultZ
dbPositionObject(1001, 0.0, 3.0, DefaultZ);
dbPositionObject(1002, 3.0, 0.0, DefaultZ);
dbPositionObject(1003, 0.0, -3.0, DefaultZ);
dbPositionObject(1004, -3.0, 0.0, DefaultZ);
// Make balls
const int balls = 20;
int colors[20];
int swapcolor;
for (int i = 1; i <= balls; i++) {
dbMakeObjectSphere(i, 0.2);
//MakeObjectBox( i, 0.2, 0.2, 0.2);
colors[i] = dbRND(0xFFFFFF);
dbColorObject(i, colors[i]);
dbPositionObject(i, -2.5+i/4.0, -2.5+i/4.0, DefaultZ);
dbAutomaticObjectCollision(i, 0.1, 0);
}
//dbMoveCamera(1, 18.0);
//dbPitchCameraUp(1, 14);
//dbSync();
// Make move loop
while ( LoopGDK ( ) )
{
for (int i = 1; i <= balls; i++) {
dbRollObjectLeft(i, dbRnd(30.0)/10.0);
dbMoveObjectDown(i, dbRnd(5.0)/100.0-0.025);
dbSetCursor(dbObjectScreenX(i),dbObjectScreenY(i));
dbPrint(dbStr(dbObjectCollision(i,0)));
swapcolor = colors[i];
if ( dbObjectHit(i,0) > 0 & dbObjectCollision(i,0) < balls ) {
colors[i] = colors[dbObjectHit(i,0)];
colors[dbObjectHit(i, 0)] = swapcolor;
dbColorObject(i, colors[i]);
}
/*
int bob = dbObjectHit(5,0);
if (bob != 0) {
dbSetCursor(0,10);
dbPrint(dbStr(bob));
}*/
}
dbSetCursor(0,0);
dbPrint( dbStr(dbScreenFPS()) );
dbSync();
}
}
Note where I've commented out the rotation. The positioning isn't set up for rotated boxes so this version of the code works as I want with the scale changed not the rotation. If I use rotation like dbZRotateObject(1003, 90.0); The collision box doesn't move and objects tend to bounce off where the object would be if it had not been rotated.