void displayHex(int in) { int hex[8]; int count = 0; if(in == 0) { displayDigit(0); return; } while(in > 0) { hex[count++] = in % 16; in /= 16; } while (count > 0) { displayDigit(hex[--count]); flashLight(500, 0); } }
Character::Character(): Player(){ animationIndex = 0; leftArm = GameObject("ghost_arm_left", "ghost_arm_right_texture"); leftArm.setPosition(1.2f, -0.5f, 0.0f); leftArm.rotationNode->setAxis(glm::vec3(1.0f, 0.0f, 0.0f)); leftArm.setDirection(10.0f); StaticGameObject flashLight("flash_light", "flash_light_texture"); flashLight.setPosition(0.8f, -0.7f, 1.8f); leftArm.rotationNode->addChildNode(flashLight.getSceneGraphBranch()); rightArm = GameObject("ghost_arm_right", "ghost_arm_right_texture"); rightArm.setPosition(-1.2f, -0.5f, 0.0f); rightArm.rotationNode->setAxis(glm::vec3(1.0f, 0.0f, 0.0f)); StaticGameObject pickAxe("pick_axe", "pick_axe_texture"); pickAxe.setPosition(-0.6f, 0.0f, 1.8f); pickAxe.setRotation(0.0f, 20.0f); rightArm.rotationNode->addChildNode(pickAxe.getSceneGraphBranch()); head.rotationNode->addChildNode(leftArm.getSceneGraphBranch()); head.rotationNode->addChildNode(rightArm.getSceneGraphBranch()); light = new LightSource(flashLight.modelNode); light->setPosition(0,0,1.0f); //light->setDirection(0,-0.2f,1); light->setColor(0.9f, 0.8f, 0.7f); light->setIntensity(170); light->setSpread(32); leftArm.update(0.0f); rightArm.update(0.0f); //pickAxe.update(0.0f); }