Exemplo n.º 1
0
void btWheelInfoToSWheelInfo(const btWheelInfo &btInfo, SWheelInfo &info, btTransform &transform)
{
    btTransformToIrrlichtMatrix(transform, info.worldTransform);
    info.chassisConnectionPointCS = bulletToIrrlichtVector(btInfo.m_chassisConnectionPointCS);
    info.wheelDirectionCS = bulletToIrrlichtVector(btInfo.m_wheelDirectionCS);
    info.wheelAxleCS = bulletToIrrlichtVector(btInfo.m_wheelAxleCS);
    info.suspensionRestLength = irr::f32(btInfo.m_suspensionRestLength1);
    info.maxSuspensionTravelCm = irr::f32(btInfo.m_maxSuspensionTravelCm);
    info.wheelRadius = irr::f32(btInfo.m_wheelsRadius);
    info.suspensionStiffness = irr::f32(btInfo.m_suspensionStiffness);
    info.wheelDampingCompression = irr::f32(btInfo.m_wheelsDampingCompression);
    info.wheelDampingRelaxation = irr::f32(btInfo.m_wheelsDampingRelaxation);
    info.frictionSlip = irr::f32(btInfo.m_frictionSlip);
    info.steering = irr::f32(btInfo.m_steering);
    info.wheelRotation = irr::f32(btInfo.m_rotation);
    info.deltaRotation = irr::f32(btInfo.m_deltaRotation);
    info.rollInfluence = irr::f32(btInfo.m_rollInfluence);
    info.engineForce = irr::f32(btInfo.m_engineForce);
    info.brake = irr::f32(btInfo.m_brake);
    info.isFrontWheel = btInfo.m_bIsFrontWheel;
    info.clippedInvContactDotSuspension = irr::f32(btInfo.m_clippedInvContactDotSuspension);
    info.suspensionRelativeVelocity = irr::f32(btInfo.m_suspensionRelativeVelocity);
    info.wheelSuspensionForce = irr::f32(btInfo.m_wheelsSuspensionForce);
    info.skidInfo = irr::f32(btInfo.m_skidInfo);

    info.raycastInfo.contactNormalWS = bulletToIrrlichtVector(btInfo.m_raycastInfo.m_contactNormalWS);
    info.raycastInfo.contactPointWS = bulletToIrrlichtVector(btInfo.m_raycastInfo.m_contactPointWS);
    info.raycastInfo.suspensionLength = irr::f32(btInfo.m_raycastInfo.m_suspensionLength);
    info.raycastInfo.hardPointWS = bulletToIrrlichtVector(btInfo.m_raycastInfo.m_hardPointWS);
    info.raycastInfo.wheelDirectionWS = bulletToIrrlichtVector(btInfo.m_raycastInfo.m_wheelDirectionWS);
    info.raycastInfo.wheelAxleWS = bulletToIrrlichtVector(btInfo.m_raycastInfo.m_wheelAxleWS);
    info.raycastInfo.isInContact = btInfo.m_raycastInfo.m_isInContact;
    info.raycastInfo.groundObject = btInfo.m_raycastInfo.m_groundObject;
}
const irr::core::matrix4 IKinematicCharacterController::getWorldTransform() const
{
    irr::core::matrix4 mat;
    btTransformToIrrlichtMatrix(GhostObject->getWorldTransform(), mat);

    return mat;
}