Multiple question about my new vehicle idea

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Multiple question about my new vehicle idea

Postby collerblade2 » Wed Sep 10, 2014 10:36 am

Hello Julio,
I have tested several ideas for vehicles:
1. for multibody vehicles:
-newton bodies has limited angular velocities. The rotation limit is about 40 rad/sec. Why? U told me (a year ago), that u have to know that the object is rotated to the left or the right (in every frame). So in my interpretation that means: -PI..+PI rotation per frame. If im running 60fps the maximum rotation should be Pi*60 rad/s, but its 40. Why is that?

2. For my new vehicle idea:
This is a corkscrew joint.Is this callback correct?
Code: Select all
unsigned int wheelJointCB(NewtonJoint joint,NewtonHingeSliderUpdateDesc* desc) {
  float distance=NewtonCorkscrewGetJointPosit(joint);
  float speed=NewtonCorkscrewGetJointVeloc(joint);
  if(distance<-0.25)
    desc[0].accel=NewtonCorkscrewCalculateStopAccel(joint,desc,-0.25);
  else if(distance>0.25) {
    desc[0].accel=NewtonCorkscrewCalculateStopAccel(joint,desc,0.25);
  else {
    float a=NewtonCalculateSpringDamperAcceleration(desc.timestep,15000,distance,1000,speed)*30;
    desc[0].accel=0;
    desc[0].minFriction=a;
    desc[0].maxFriction=a;
  }
  return 1;
}

my car has 900kg weight & the tires have 30kg. The problem is, that the force stop force is weak, the tires moving over the limit (both side), and if there are no stop, then a spring dampre is too instable, it is oscillating for a long time.

Thx for the answer!
collerblade2
 
Posts: 9
Joined: Wed Aug 27, 2014 4:27 pm

Re: Multiple question about my new vehicle idea

Postby Julio Jerez » Wed Sep 10, 2014 11:13 am

has you download the latest newton from Github?
The vehicle controller is now fully functional, and do not has the rotation limitation
you can check comp[led domo demo
http://www.newtondynamics.com/downloads/NewtonDemo.rar

there are several type vehicles
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Multiple question about my new vehicle idea

Postby collerblade2 » Mon Sep 15, 2014 12:48 pm

Hello,
i got a compiler error, on the demosSandbox project. Im using VS 2008, and the "type_traits" is missing. Google told me nothing (am already using VS2008 SP1). What can i do?

TY: collerblade
collerblade2
 
Posts: 9
Joined: Wed Aug 27, 2014 4:27 pm

Re: Multiple question about my new vehicle idea

Postby Julio Jerez » Mon Sep 15, 2014 1:22 pm

collerblade2 wrote:"type_traits"

Newton does not uses any of those C++ extensions.

I just build the sandbox demo with Visual studio 2008 and it compile fine.
Please Sync again to github and trying compiling it.

The car demos now are quite cool. :shock:
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Multiple question about my new vehicle idea

Postby collerblade2 » Tue Sep 16, 2014 10:17 am

Maybe newton does not use type_traits, but wxwidgets does :(.
newton-dynamics-master\packages\thirdParty\wxWidgets\wxWidgets-2.9.4\include\wx/strvararg.h(38) : fatal error C1083: Cannot open include file: 'type_traits': No such file or directory

I tried both 2008 sln, and the vsexpress version. They got the same problem :(.
What are u using wxwidgets for? Only menus? or window, menus, everything?
collerblade2
 
Posts: 9
Joined: Wed Aug 27, 2014 4:27 pm

Re: Multiple question about my new vehicle idea

Postby Julio Jerez » Tue Sep 16, 2014 10:41 am

Oh I see, it think you do no have the runtime libraries,
the type traits file is in folder:
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\type_traits

see if you have that, is not then you have to install those libraries, I do no know how to get then,
maybe some here knows.
if it is a big problem, why don't you upgrade to Visual studio 2010 or 2012 express.
Visual 2008 is very old and will be deprecated soon.

As soon as I know Microsoft is no supporting it anymore I will deprecate as well.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Multiple question about my new vehicle idea

Postby collerblade2 » Wed Sep 17, 2014 1:10 pm

hello,
i downloaded vs2012 and now everything works fine (There was no "type_traits" in my vs2008 installation)...

Cars looks great. I have look into a source code (just a little), are they convex cast cars? I mean the simple car demo. I cant grab its wheels with the mouse->it is not a dynamic body.
I have implemented convex cast vehicles already in my older projects, but they have siriuos problems. They cant stop on hills, but yours can. So i decided, to use your model and port it into my engine.
I have 2 quick questions now:
1. Because they are convex cast cars, if the vehicle turs sideway the wheels accelates them.
2. Are u going to make major changes in the vehicle system?

TY: collerblade
collerblade2
 
Posts: 9
Joined: Wed Aug 27, 2014 4:27 pm

Re: Multiple question about my new vehicle idea

Postby Julio Jerez » Wed Sep 17, 2014 2:23 pm

Yes the vehicle is a convex cats car, but the wheel and all geometry are part of a compound collision
The wheel have collision disabled because the use convex Ray cats.
you should be able to raycats them.
I still have to do some work on the way the collide with other vehicle
here is a trick you can do, you can add invisible collision shape around the wheel to add as fender collisions so the protect the from hitting the other objects.
collerblade2 wrote:1. Because they are convex cast cars, if the vehicle turs sideway the wheels accelates them.

can you clarify that question more? do you mean drifting?

collerblade2 wrote:2. Are u going to make major changes in the vehicle system?


there will always be small change to make it better I hope, but they will no be serious interface changes.
di you see the Tank?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Multiple question about my new vehicle idea

Postby FSA » Wed Sep 17, 2014 3:02 pm

Damn this tank is cool! :mrgreen:
User avatar
FSA
 
Posts: 322
Joined: Wed Dec 21, 2011 9:47 am

Re: Multiple question about my new vehicle idea

Postby manny » Wed Sep 17, 2014 7:04 pm

yeah, the tank threads are awesome 8)
http://www.instaLOD.io - InstaLOD - State of the art 3D optimization
manny
Site Admin
Site Admin
 
Posts: 131
Joined: Tue Feb 11, 2014 6:49 pm

Re: Multiple question about my new vehicle idea

Postby collerblade2 » Thu Sep 18, 2014 2:37 am

Im talking about this: www.youtube.com/watch?v=GUMF69xoZ3M
The vehicle turned right or left (90degres) around the forward axis. The wheels want to push the car up.... This effect is clearly becaouse of convex cast. Multibody vehicles arent doing this.
collerblade2
 
Posts: 9
Joined: Wed Aug 27, 2014 4:27 pm

Re: Multiple question about my new vehicle idea

Postby Julio Jerez » Thu Sep 18, 2014 8:04 am

Ha yes but that is not really a problem of convex cast.
There are many ways this can be fixed.
-by adding wheel fender collision geometry so that the wheel do not touch the ground beyond some angle
-adding wheel stops do that the compression do not exceed some maximum point.
I see If I can fix it. So far I was focus on the vehicle behavior, those edge case can be resolve quiet easily.

how do you made turns like that? driving or using the mouse pick?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Multiple question about my new vehicle idea

Postby collerblade2 » Thu Sep 18, 2014 1:30 pm

I can live with that. Dont have to complicate the code more. :D I still have to write it to my engine :P.
Yes i used mouse pick, to make it turn sideways.
The bigger problem was standing on ground. But this woorks, so im happy :P
Good job!
collerblade2
 
Posts: 9
Joined: Wed Aug 27, 2014 4:27 pm

Re: Multiple question about my new vehicle idea

Postby collerblade2 » Fri Sep 26, 2014 6:39 am

Julio,
can i use vehicles without your entity/controller system? It is havily integrated there. Actually i need a C like api. Is it possible, or i need to somehow dig out vehicle stuff myself?
For example i cant create DemoEntity-s, couz u use bodies user data, what is need for me as well.

TY: collerblade
collerblade2
 
Posts: 9
Joined: Wed Aug 27, 2014 4:27 pm

Re: Multiple question about my new vehicle idea

Postby Julio Jerez » Fri Sep 26, 2014 8:25 am

you do not need the entity, the entity represent a typical Game Engine Node.
you do need the controller manager which you should have already if you linked the dJointLibrary to your engine

you can look at this thread in the forum, to see some one who integrated successfully.
viewtopic.php?f=9&t=8693
viewtopic.php?f=9&t=8713

what I would do is that I will make a class for the manager and the make a wrapper that expose all the function in C taking the pointer to the manage as first argument.
that what newton really is, but this is time consuming for me specially for a custom library that is suggest to so many changes.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests