According to my experiments, the bounce vector points into the direction towards which the object should continue moving after it collided, and the vector does contain velocity information, so you can assign its values directly to the X/Y/Z components of the object's speed vector. The size of the object will influence the direction since the point of contact will be different, but I'm sure there is no mass in the calculation because that would already require a physics engine.
I actually created a test project to make sure that I give you a correct answer. I tried with different object sizes, velocities and directions. Here is the code, if you are interested. I haven't checked a situation when both objects are moving, so you should continue experimenting from here to find out what to do with the other object if it's not stationary.
#include "DarkGDK.h"
#include "SC_Collision.h"
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 60 );
SC_Start();
dbMakeObjectSphere(1, 5, 8, 8);
dbMakeObjectSphere(2, 3, 8, 8);
dbPositionObject(1, 1.8, 0, 0);
dbPositionObject(2, 0, 10, 0);
SC_SetupObject(1, 1, 1);
SC_SetupObject(2, 1, 1);
SC_DrawObjectBounds(1);
SC_DrawObjectBounds(2);
dbPositionCamera(0, 8, -15);
float velX = 0, velY = 0.2;
float posX = dbObjectPositionX(1);
float posY = dbObjectPositionY(1);
float newX = posX, newY = posY;
bool move = true;
char Buffer[256] = "";
while ( LoopGDK ( ) )
{
if (move) {
newX = posX + velX;
newY = posY + velY;
// use half the object radius for the collision sphere and exclude the object itself from the cast
if (SC_SphereCast(0, posX, posY, 0, newX, newY, 0, dbObjectSizeX(1) / 2, 1) > 0) {
//move = false;
float bx = SC_GetCollisionBounceX();
float by = SC_GetCollisionBounceY();
float bz = SC_GetCollisionBounceZ();
sprintf(Buffer, "bx=%.2f by=%.2f bz=%.2f", bx, by, bz);
velX = bx; velY = by;
} else {
posX = newX;
posY = newY;
dbPositionObject(1, posX, posY, 0);
SC_UpdateObject(1);
}
}
dbText(0,0,Buffer);
dbSync ( );
}
SC_RemoveVisualBounds(1);
SC_RemoveVisualBounds(2);
SC_RemoveObject(1);
SC_RemoveObject(2);
dbDeleteObject(1);
dbDeleteObject(2);
return;
}