#include "dxstdafx.h" #include ".\UserPlayer.h" UserPlayer::UserPlayer(void) : Player() { setDesiredViewPoint(0, 3, -15); //100 setDesiredLookAtPoint(0, 2, 0); //50 this->finalTimer = -1; } UserPlayer::~UserPlayer(void) { } Vector UserPlayer::getDesiredLookAtPoint() { Vector temp; this->getAbsoluteVector(temp, this->lookAtPoint); Vector origin = this->getAbsolutePosition(); temp.y = origin.y + this->lookAtPoint.y; return temp; } Vector UserPlayer::getDesiredViewPoint() { if(this->pActor!=NULL) { this->pActor->getGlobalPose().getColumnMajor44(((NxF32 *) &this->myWorldMatrix.m[0][0])); } Vector temp; this->getAbsoluteVector(temp, this->viewPoint); Vector origin = this->getAbsolutePosition(); temp.y = origin.y + this->viewPoint.y; return temp; } void UserPlayer::setDesiredLookAtPoint(float _x, float _y, float _z) { this->lookAtPoint.x = _x; this->lookAtPoint.y = _y; this->lookAtPoint.z = _z; } void UserPlayer::setDesiredViewPoint(float _x, float _y, float _z) { this->viewPoint.x = _x; this->viewPoint.y = _y; this->viewPoint.z = _z; } /*void UserPlayer::initWin() { this->finalTimer = 5; } void UserPlayer::initLose() { this->finalTimer = 5; } void UserPlayer::update(float dt) { Player::update(dt); if(this->finalTimer>0) { this->finalTimer-=dt; } }*/ extern bool GLOBAL_player_freezeQ; void UserPlayer::update(float dt) { if(GLOBAL_player_freezeQ) { this->setBehaveAs(Node::KINEMATIC); if(this->winPe->isEmitting()) { this->winPe->update(dt); } return; } Player::update(dt); }