Exemplo n.º 1
0
void CObject::Explode()
{
    CVector pos = GetPos();
    pos.z += 0.5;
    CExplosion::AddExplosion(this, GetPlayerPed(-1), 9, pos, 100, 1, -1.0, 0);
    if (m_colDamageEffect == 202 || m_colDamageEffect == 200)
    {
        pos.z -= 1.0;
        ObjectDamage(10000.0f, pos, 0, GetPlayerPed(-1), 51);
    }
    else if (!m_disableFriction)
    {
        m_linearVelocity.z += 0.5;
        m_linearVelocity.x += (rand() - 128) * 0.000199999994947575;
        m_linearVelocity.y += (rand() - 128) * 0.000199999994947575;
        if (bIsStatic || bIsStaticWaitingForCollision)
        {
            SetIsStatic(false);
            AddToMovingList();
        }
    }
    if (m_objectInfo->fxType == 2)
    {
        CMatrix pos = GetMatrix();
        // to object space
        CVector fxObjPos = Multiply3x3(pos, m_objectInfo->fxOffset);
        fxObjPos += GetPos(); // to world space
        FxSystem_c *sys = FxManager.InitialiseFxSystem(m_objectInfo->fxSystem, fxObjPos, 0, 0);
        if (sys)
        {
            sys->Start();
        }
    }
}
Exemplo n.º 2
0
MFMatrix& MFMatrix::RotateZ(float angle)
{
	MFMatrix rot;
	rot.SetRotationZ(angle);
	return Multiply3x3(rot);
}