#include #include #include void ThwompHammer(dEn_c *thwomp, ActivePhysics *apThis, ActivePhysics *apOther) { if (thwomp->name == 0x51) { thwomp->dEn_c::collisionCat13_Hammer(apThis, apOther); } return; } void BooHammer(dEn_c *boo, ActivePhysics *apThis, ActivePhysics *apOther) { if (boo->name == 0xB0) { boo->dEn_c::collisionCat13_Hammer(apThis, apOther); } return; } void UrchinHammer(dEn_c *urchin, ActivePhysics *apThis, ActivePhysics *apOther) { return; } #include "poweruphax.h" void SetCullModeForMaterial(m3d::mdl_c *model, int materialID, GXCullMode mode); dHammerSuitRenderer_c *dHammerSuitRenderer_c::build() { return new dHammerSuitRenderer_c; } dHammerSuitRenderer_c::dHammerSuitRenderer_c() { } dHammerSuitRenderer_c::~dHammerSuitRenderer_c() { } void dHammerSuitRenderer_c::setup(dPlayerModelHandler_c *handler) { victim = (dPlayerModel_c*)handler->mdlClass; allocator.link(-1, GameHeaps[0], 0, 0x20); nw4r::g3d::ResFile rf(getResource("hammerM", "g3d/suit.brres")); helmet.setup(rf.GetResMdl("helmet"), &allocator, 0, 1, 0); SetupTextures_MapObj(&helmet, 0); shell.setup(rf.GetResMdl("shell"), &allocator, 0, 1, 0); SetupTextures_MapObj(&shell, 0); allocator.unlink(); victimModel = &victim->models[0].body; nw4r::g3d::ResMdl *playerResMdl = (nw4r::g3d::ResMdl*)(((u32)victimModel->scnObj) + 0xE8); //headNodeID = playerResMdl->GetResNode("player_head").GetID(); headNodeID = playerResMdl->GetResNode("face_1").GetID(); rootNodeID = playerResMdl->GetResNode("skl_root").GetID(); } void dHammerSuitRenderer_c::draw() { if (victim->powerup_id != 7) return; // Materials: 2=hair 3=hat; Modes: BACK=visible ALL=invisible SetCullModeForMaterial(&victim->getCurrentModel()->head, 3, GX_CULL_ALL); Mtx headMtx; victimModel->getMatrixForNode(headNodeID, headMtx); helmet.setDrawMatrix(headMtx); helmet.setScale(1.0f, 1.0f, 1.0f); helmet.calcWorld(false); Mtx rootMtx; victimModel->getMatrixForNode(rootNodeID, rootMtx); shell.setDrawMatrix(rootMtx); shell.setScale(1.0f, 1.0f, 1.0f); shell.calcWorld(false); helmet.scheduleForDrawing(); shell.scheduleForDrawing(); }