YouGroove Posted July 28, 2011 Share Posted July 28, 2011 Well i am beginner and little confused ! I see Newton Dll on the installation directory , and when watching collision commands i see some functions dealing with Flags and numbers instead of Physics commands ? So my question is what do i have to use to for example detect collision detection between models and raycasting ? Or when should we use the simple system and when should we invoke Newton physic functions (throught some C++ Binding ?) ? Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Rick Posted July 28, 2011 Share Posted July 28, 2011 You give them EntityTypes which is a number. Then you call the Collisions() function passing in the 2 entity types as the first 2 params then the last param is what kind of collision you want to happen. So assign entity type 1 to terrain Then assign entity type 2 to a body Then call Collisions(1, 2, 1) The last number is the kind of response you want. The doc has their meanings for what value. So basically you setup all your collisions between all your bodies like this. Quote Link to comment Share on other sites More sharing options...
Canardia Posted July 28, 2011 Share Posted July 28, 2011 Each collision needs a number, but of course you shouldn't use numbers directly in your C++ program, but define them with meaningful #defines. Like: #define terraintype 1 #define playertype 2 #define cartype 3 etc.... Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Roland Posted July 28, 2011 Share Posted July 28, 2011 Each collision needs a number, but of course you shouldn't use numbers directly in your C++ program, but define them with meaningful #defines. Like: #define terraintype 1 #define playertype 2 #define cartype 3 etc.... Here is another way to do it enum Collisions { TerrainColl =1, PlayerColl, CarColl, ... ... ... }; Collision( TerrainColl, PlayerColl ); Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
YouGroove Posted July 28, 2011 Author Share Posted July 28, 2011 Thanks guys ! I'll use simple Raycasting and collision detection between models so Newton commands are not needed ! It means that we use simple commands, but behind it's the physic engine Newton that manages all that is running ? I've seen some move functions for entities, i think it don't uses physic engine for moving entities ? something similar to AddForce ? Or is it used behind the black box ? Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Canardia Posted July 28, 2011 Share Posted July 28, 2011 Physics movement is completely seperated from mesh movement, but you can position the mesh where the physics body is. Using the SetEntityParent command the engine does this positioning automatically. You can however move physics bodies also with mesh movement commands, in which case the physics force is set to 0 for the affected axes. This means also that you can for example move a physics body along one axis with mesh commands, and its physics force is still working on the other 2 axes. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Laurens Posted July 29, 2011 Share Posted July 29, 2011 Thanks guys ! I'll use simple Raycasting and collision detection between models so Newton commands are not needed ! It means that we use simple commands, but behind it's the physic engine Newton that manages all that is running ? Unless you are writing your own raycast functions, you will still need Newton. In fact, I don't think the engine even starts without the DLL present. Quote Link to comment Share on other sites More sharing options...
Mumbles Posted July 29, 2011 Share Posted July 29, 2011 In fact, I don't think the engine even starts without the DLL present. It doesn't - and you need JointLibrary.dll as well. Confusing when you use your own version of Newton 2.25, which has renamed it to dJointLibrary.dll It's so tempting to get rid of the other redundant one but you just can't... Quote LE Version: 2.50 (Eventually) Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.