Heres my function
Code:
void Phy_Weight(LPDIRECT3DRMFRAME frScene, LPDIRECT3DRMFRAME Camera){
LPDIRECT3DRMFRAMEARRAY SceneArray;
FrameStruct frFrame;
D3DVECTOR vectPos;
D3DVECTOR vectVel;
int ArraySize;
frScene->GetChildren(&SceneArray);
ArraySize = SceneArray->GetSize();
for (int i = 0;i < ArraySize; i++){
SceneArray->GetElement(i, &(frFrame.frFrame));
frFrame.frFrame->GetVelocity(frScene, &vectVel, false);
if (frFrame.frFrame != Camera){
frFrame.frFrame->SetVelocity(frScene, vectVel.x, vectVel.y * frFrame.Weight, vectVel.z, false);
}
}
}
Ill break it down for you in case you don't know DX coding.
First I tell the user defined scene frame (frScene) to get all the frames inside it and put them into an array of frames.
Next I make the integer ArraySize become the size of the array of frames
With that info I can start a for loop. Inside the for loop I tell the array to get all of its frames and put them into frFrame.frFrame. This is where it finds out what .frFrame is. But I have no clue how to tell it where to find .Weight and .Bounce.