2D Bounding Boxes

Posts 1–15 of 43 · Page 1 of 3
2D Bounding Boxes
Here you go

Code:
static Vec4 Vec4Transform( Vec4 In, Mat4 pm )
    {
        Vec4 Out;

        Out.x = pm.m_rows[0].x * In.x + pm.m_rows[1].x * In.y + pm.m_rows[2].x * In.z + pm.m_rows[3].x;
        Out.y = pm.m_rows[0].y * In.x + pm.m_rows[1].y * In.y + pm.m_rows[2].y * In.z + pm.m_rows[3].y;
        Out.z = pm.m_rows[0].z * In.x + pm.m_rows[1].z * In.y + pm.m_rows[2].z * In.z + pm.m_rows[3].z;
        Out.w = pm.m_rows[0].w * In.x + pm.m_rows[1].w * In.y + pm.m_rows[2].w * In.z + pm.m_rows[3].w;

        return Out;
    }

    static Vec4 Vec4Transform( Vec4 In, LinearTransform pm )
    {
        Vec4 Out;

        Out.x = pm.left.x * In.x + pm.up.x * In.y + pm.forward.x * In.z + pm.trans.x;
        Out.y = pm.left.y * In.x + pm.up.y * In.y + pm.forward.y * In.z + pm.trans.y;
        Out.z = pm.left.z * In.x + pm.up.z * In.y + pm.forward.z * In.z + pm.trans.z;
        Out.w = pm.left.w * In.x + pm.up.w * In.y + pm.forward.w * In.z + pm.trans.w;

        return Out;
    }

    static Vec3 Vec3Transform( Vec3 In, Mat4 pm )
    {
        Vec3 Out;

        Out.x = pm.m_rows[0].x * In.x + pm.m_rows[1].x * In.y + pm.m_rows[2].x * In.z + pm.m_rows[3].x;
        Out.y = pm.m_rows[0].y * In.x + pm.m_rows[1].y * In.y + pm.m_rows[2].y * In.z + pm.m_rows[3].y;
        Out.z = pm.m_rows[0].z * In.x + pm.m_rows[1].z * In.y + pm.m_rows[2].z * In.z + pm.m_rows[3].z;

        return Out;
    }

    static Vec3 Vec3Transform( Vec3 In, LinearTransform pm )
    {
        Vec3 Out;

        Out.x = pm.left.x * In.x + pm.up.x * In.y + pm.forward.x * In.z + pm.trans.x;
        Out.y = pm.left.y * In.x + pm.up.y * In.y + pm.forward.y * In.z + pm.trans.y;
        Out.z = pm.left.z * In.x + pm.up.z * In.y + pm.forward.z * In.z + pm.trans.z;

        return Out;
    }  
Code:
dice::AxisAlignedBox GetSoldierBounds( dice::ClientSoldierEntity* pEntity, bool CenterBounds = false ) { dice::AxisAlignedBox AABB; dice::LinearTransform AAWorldTransform; pEntity->computeBoundingBox( &AABB ); pEntity->computeBoundingBoxWorldTransform( &AAWorldTransform ); dice::AxisAlignedBox R; R.min = dice::Vec3Transform( AABB.min, AAWorldTransform ); R.max = dice::Vec3Transform( AABB.max, AAWorldTransform ); if( CenterBounds ) { R.min.x = pEntity->m_cameraLocalSpace.trans.x; R.min.z = pEntity->m_cameraLocalSpace.trans.z; R.max.x = pEntity->m_cameraLocalSpace.trans.x; R.max.z = pEntity->m_cameraLocalSpace.trans.z; } return R; }
Code:
       dice::AxisAlignedBox Bounds = GetSoldierBounds( pEntity, true );

        dice::Vec3 SoldierBounds[2];

        if( 
            dice::Core::WorldToScreen( &Bounds.max, &SoldierBounds[0] ) &&
            dice::Core::WorldToScreen( &Bounds.min, &SoldierBounds[1] ) )
        {
            float w = ( SoldierBounds[1].y - SoldierBounds[0].y ) / 4;

            D3DRender::OutlineRGB( SoldierBounds[0].x - w, SoldierBounds[0].y, w * 2, 
                ( SoldierBounds[1].y - SoldierBounds[0].y ), 1, RenderColor );
        }  
Entity VTable + 0x50 = computeBoundingBoxWorldTransform
Entity VTable + 0x54 = computeBoundingBox



Credits:
s0biet
can you please tell me how to use this ?
Quote Originally Posted by msr890 View Post
can you please tell me how to use this ?
compile it to a dll file and inject it
Quote Originally Posted by Pandemic View Post


compile it to a dll file and inject it
were can i find the process to compile it ?
I agree with him id like to know how to compile it what program
C++ compiles them.
you need to know C++, visual basic etc. Basic coding.
very nice ty, if you dont know how to compile & inject stuff then google it guys however assinat3d why not release it with a tut and already compiled? ne ways good job and thank you. but the code seems incomplete? or is it just me??
I use visual basic to compile my private hacks.
does this work on PB servers? :P New to BFBC2..
if just someone compile's it to dll and upload it here then you would have less people asking for ''how to compile''
Quote Originally Posted by nikolayl View Post
if just someone compile's it to dll and upload it here then you would have less people asking for ''how to compile''
Then leechers don't have to do anything... (Next people will be asking for an injector.)
A tut/how to, or a final compiled version would be a heaven send.
Posts 1–15 of 43 · Page 1 of 3
This thread is closed for replies.

Tags for this Thread

None

Talk with us