I'm just trying to get some wheels to support the weight of a box. Can you see anything obviously wrong with the tireinfo settings here?
Moderators: Sascha Willems, walaber
bool PhysicsVehicle::Finalize()
{
xMat4 localframe;
xMat4 tiremat;
delete newtonvehicle;
tires.clear();
float mass, ixx, iyy, izz;
Assert(chassis->newtonbody);
NewtonBodyGetMass(chassis->newtonbody, &mass, &ixx, &iyy, &izz);
Assert(mass > 0.0f);
newtonvehicle = new dMultiBodyVehicle(chassis->newtonbody, &localframe.i.x, Abs(chassis->world->gravity.y));
newtonvehicle->SetUserData(this);
for (int n = 0; n < tireinfo.size(); ++n)
{
Assert(tireinfo[n].m_mass > 0.0f);
tiremat.t.x = tirepositions[n].x;
tiremat.t.y = tirepositions[n].y;
tiremat.t.z = tirepositions[n].z;
tires.push_back(newtonvehicle->AddTire(&tiremat[0][0], tireinfo[n]));
}
dMultiBodyVehicleDifferential* differential = NULL;
for (const auto& axle : axles)
{
differential = newtonvehicle->AddDifferential(1, 1, tires[axle.x], tires[axle.y]);
}
//dEngineInfo engineinfo = {};
//engineinfo.m_topSpeedInMetersPerSeconds = 1000;
//newtonvehicle->AddEngine(engineinfo, differential);
newtonvehicle->Finalize();
return true;
}
#ifdef _DEBUG
void ndDemoEntityManager::OpenMessageCallback(GLenum source,
GLenum type,
GLuint id,
GLenum severity,
GLsizei length,
const GLchar* message,
const void* userParam)
{
if (userParam)
{
switch(id)
{
case 131185: // nvidia driver report will use VIDEO memory as the source for buffer object operations
return;
}
ndTrace(("GL CALLBACK: %s source = 0x%x, type = 0x%x, id = %d, severity = 0x%x, message = %s, length = %d \n",
(type == GL_DEBUG_TYPE_ERROR ? "** GL ERROR **" : ""), source, type, id, severity, message, length));
ndAssert(0);
}
}
#endif
varying vec3 posit;
varying vec3 posit;
vec3 position = posit;
atomin int i
for *i = 0; i < count; i.amoticAdd(1))
{
// do some work in paraller
}
Users browsing this forum: No registered users and 4 guests