Exemple #1
0
const Matrix44F Chassis::computeBogieArmOrigin(const float & chassisWidth, const Vector3F & wheelP, const float & l, const float & s, const float & ang) const
{
    Matrix44F tm;
    tm.rotateX(-ang);
    Vector3F p;
    p.x = chassisWidth * .5f + s * .5f;
    p.y = wheelP.y + l * .5f * sin(ang);
    p.z = wheelP.z + l * .5f * cos(ang);
    tm.setTranslation(p);
    return tm;
}
Exemple #2
0
const Matrix44F  Chassis::bogieArmOrigin(const int & i, bool isLeft) const
{
    Matrix44F res;
    res.rotateX(-m_torsionBarRestAngle);
    Vector3F cen = roadWheelOrigin(i, isLeft);
    float d = 1.f;
	if(!isLeft) d = -d;
	cen.x += -m_trackWidth * .5f * d + m_bogieArmWidth * .7f * d;
    cen.z += 0.5f * m_bogieArmLength * cos(m_torsionBarRestAngle);
    cen.y += 0.5f * m_bogieArmLength * sin(m_torsionBarRestAngle);
    res.setTranslation(cen);
    return res;
}