Jump to content
  • Advertisement
Sign in to follow this  

Newton Game dynamics Wrapper for VB6

This topic is 4125 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello peolple i'm making a wrapper for VB6. I even suceed in adding callbacks functions from VB6. All the code work well. But when i add more than 80 BOXES i have an error in function NewtonUpdate (nWorld, timeStep); I use very basic code from Tutorials that are in the Newton SDK. Here is the code logic: I code simple structure that will handle Rigid body imformation Code: typedef struct NEMO_PHYSXDATA { NEMO_VECTOR Position; NEMO_MATRIX Rotation; NEMO_VECTOR RotationEULER; NEMO_QUATERNION RotationQuat; NEMO_VECTOR Velocity; NEMO_VECTOR LinearVelocity; NEMO_VECTOR AngularVelocity; NEMO_VECTOR SizeExtent; NEMO_VECTOR Inertia; float Density; float Mass; int BODY_TYPE; int IS_PLANE; }NEMO_PHYSXDATA ; after i Initialize Newton i create a body like Code: #define VBCALL __declspec(dllexport) __stdcall int VBCALL NEWTON_InitCreateBox(NEMO_VECTOR &position,NEMO_VECTOR &BoxSize,NEMO_VECTOR &inertie,float Mass,NEMO_PHYSXDATA &RetDATA,bool Mobile) this function returns the object ID (from 0 .... 1 .. ..2 .... .n where n=number of bodies) -1 means an error then at update time i call Code: void VBCALL DoPhysX(float DT,NEMO_PHYSXDATA *RetDATA,int NUMZ) dFloat timeStep=(float)DT; dFloat matrix[4][4]; dFloat euler[3]; // update the Newton physics world /////HERE IS THE ERROR WHEN MY BODIES NUMBER IS OVER 80 under the code just runs WELL NewtonUpdate (nWorld, timeStep); for (int I=0;I<NUMZ;I++) { NewtonBodyGetMatrix(MyBODYZ->m_pBody,&matrix[0][0]); NewtonGetEulerAngle(&matrix[0][0],euler); RetDATA.RotationEULER.x=(float)euler[0]; RetDATA.RotationEULER.y=(float)euler[1]; RetDATA.RotationEULER.z=(float)euler[2]; /*NewtonBodyGetVelocity(MyBODYZ->m_pBody,&euler[0]); RetDATA.LinearVelocity.x=(float)euler[0]; RetDATA.LinearVelocity.y=(float)euler[1]; RetDATA.LinearVelocity.z=(float)euler[2]; NewtonBodyGetOmega(MyBODYZ->m_pBody,&euler[0]); RetDATA.AngularVelocity.x=(float)euler[0]; RetDATA.AngularVelocity.y=(float)euler[1]; RetDATA.AngularVelocity.z=(float)euler[2];*/ RetDATA.Position.x=(float)matrix [3][0]; RetDATA.Position.y=(float)matrix [3][1]; RetDATA.Position.z=(float)matrix [3][2]; } }

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!