Greetings,fellow members! I need help with my school project. My teacher don't understand this matter very well.
So my problem is the card I used always go upwards,despite the gravity I give. What does make the card go upwards? Any help is appreciated,I'm still new at this.
This is my code :
#define dDOUBLE
#include<ode\ode.h>
#include<SDL.h>
#include"C:\Users\UMUM\Desktop\odemeshstl\drawing.h"
#include"C:\Users\UMUM\Desktop\odemeshstl\bodydrawer.h"
#include<cstdlib>
#define NKONTAKMAKS 32
#define WWIDTH 800
#define WHEIGHT 600
#define HWIDTH 11
#define HHEIGHT 19
using namespace std;
dWorldID w;
dGeomID gb2,glantai;
dBodyID b2;
dJointGroupID kontakgroup;
dSpaceID ruang;
Have you realized that SDL goes "opposite way". That being top left corner is 0,0 and bottom right is window height and width?
Flipping gravity from -9.81 to 9.81 should fix something if it is not correctly handled on physics engine which is not seen on the code. If there is compensation on the physics side already (-1)*(-1)=1 and that makes issue
Thank you for your response! I tried that,and it doesn't solve the problem. When I set the angular velocity to 0,0,0 , The card isn't just lying on the ground. It did at first,but then it's flying. I tried to modify the erp and cfm part, and found that if I set the erp to zero then it wouldn't fly,but it wouldn't flip if I set the angular velocity either.
If I set the erp to 0.x(say,0.5) the card would flip but then bounce indefinitely. I also tried to disable erp and cfm,enabling only bounce,but this still happens. Also tried to disable bounce but enable erp and cfm,still the same. Is there any workaround? TIA!