About Store Forum Documentation Contact
Donations:
327$/mo



Post Reply 
Modifying Item matrix
Author Message
SFCBias Offline
Member

Post: #1
Modifying Item matrix
I'm trying to pick up a weapon and hold in the characters right hand (Like in the skeletal points tutorial) as a start. However when i pick up the weapon, it does not render. The object has a physical body but I can't get it to render once i pick it up.

Code:
void CPlayer::drawWeapons()
    {
        Weapons::Gun* gun = 0;

        switch(mCurrentSlot)
        {
        case WS_PRIMARY_GUN:
            gun = mWeapons.mPrimary;
            break;
        case WS_SECONDARY_GUN:
            gun = mWeapons.mSecondary;
            break;
        default:
            return;//Grenades don't need to be drawn in this way
        }
        
        if(!gun)
            return;

        const OrientP& handR = cskel.getPoint("HandR");
        Matrix m;
        m.setPosDir(handR.pos, handR.perp, handR.dir).scaleOrn(0.7);
        gun->matrix(m); //I tried also
04-29-2011 02:07 AM
Find all posts by this user Quote this message in a reply
Truelegend Offline
Member

Post: #2
RE: Modifying Item matrix
try with that: m.setPosDir(handR.pos, handR.perp, handR.dir).scaleOrn(0.7);
scaleOrn try not 0.7. Try more bigger smile
04-29-2011 09:05 PM
Find all posts by this user Quote this message in a reply
Dynad Offline
Member

Post: #3
RE: Modifying Item matrix
@Truelegend... plz don't reply if you don't understand the question at all -_-

PHP Code:
gun.matrix(Matrix().setPosDir(handR->pos,handR->cross(),handR->dir)); 

and you need to draw your mesh e.g:
PHP Code:
void Gun::drawPrepare(CPlayer &owner)
{
gun.drawPrepare();


But if you just take a look at the source of Bloody Massacre it won't take you long to understand how it works wink

There is always evil somewhere, you just have to look for it properly.
04-29-2011 09:28 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply