Code: Select all
struct NPCSceneNode
{
IAnimatedMeshSceneNode* node;
bool isOpponent;
int bloodVal;
int smellVal;
int sightVal;
int hearVal;
NPCSceneNode (IAnimatedMesh* mesh, bool cIsOpponent, core::vector3df cPos, core::vector3df cRot, s32 bFrame, s32 eFrame, int cBlood, int cSmell, int cSight, int cHearing, scene::ISceneManager* k, f32 animSpeed,
core::vector3df scale, ITriangleSelector* n) {
isOpponent=cIsOpponent;
bloodVal=cBlood;
smellVal=cSmell;
sightVal=cSight;
hearVal=cHearing;
node = k->addAnimatedMeshSceneNode(mesh, 0, ID_NPC);
node->setFrameLoop(bFrame, eFrame);
node->setAnimationSpeed(animSpeed);
node->setScale(scale);
node->setPosition(cPos);
node->setRotation(cRot);
node->setMaterialFlag(video::EMF_BACK_FACE_CULLING, false);
n = k->createTriangleSelector(node);
node->setTriangleSelector(n);
n->drop();
}
void setFrameLoop(s32 bFrame, s32 eFrame) {
node->setFrameLoop(bFrame, eFrame);
}
void setAnimationSpeed(int animSpeed) {
node->setAnimationSpeed(animSpeed);
}
};