Vehicles in 3.0?

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: Vehicles in 3.0?

Postby JoeJ » Sat Sep 13, 2014 7:48 am

+1

Mixing C++ and C interface feels not well.
C interface for everything also allows you to change internals and users won't even notice mostly.
User avatar
JoeJ
 
Posts: 1489
Joined: Tue Dec 21, 2010 6:18 pm

Re: Vehicles in 3.0?

Postby Sweenie » Sat Nov 29, 2014 8:42 am

I'm trying to implement the vehicle and I've got a few questions regarding chassis coordinate system and the tires.

I'm using C4 Engine and it uses Z-axis as up vector.
So I guess I should use these values for chassisFrame

Code: Select all
dVector grav = dVector(0.0f, 0.0f, -9.8f, 0.0f); Downwards on Z-axis
float mass = 2500.0f;
// create the coordinate system
dMatrix chassisMatrix;
chassisMatrix.m_front = dVector(1.0f, 0.0f, 0.0f, 0.0f);// vehicle direction of travel
chassisMatrix.m_up = dVector(0.0f, 0.0f, -1.0f, 0.0f);// downward vehicle direction
chassisMatrix.m_right = chassisMatrix.m_front * chassisMatrix.m_up;
chassisMatrix.m_posit = dVector(0.0f, 0.0f, 0.0f, 1.0f);


Is this correct?

And then I pass the tire locations, are those location vectors supposed to be in local space or world space?
Sweenie
 
Posts: 503
Joined: Mon Jan 24, 2005 7:59 am
Location: Sweden

Re: Vehicles in 3.0?

Postby Julio Jerez » Sat Nov 29, 2014 9:19 am

I have no tested but I think that for a system with z up, and assuming y is front direction, then the matrix will be
Code: Select all
chassisMatrix.m_front = dVector (0.0f, 1.0f, 0.0f, 0.0f); // vehicle direction of travel
chassisMatrix.m_up    = dVector (0.0f, 0.0f, 1.0f, 0.0f);// downward vehicle direction
chassisMatrix.m_right = chassisMatrix.m_front * chassisMatrix.m_up;   // side direction (the plane of the wheels)
chassisMatrix.m_posit = dVector (0.0f, 0.0f, 0.0f, 1.0f);


edit:
the tires are parametric, (local space)
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Previous

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests

cron