[1378] | 1 | #include "dxstdafx.h"
|
---|
| 2 | #include ".\UserPlayer.h"
|
---|
| 3 |
|
---|
| 4 |
|
---|
| 5 | UserPlayer::UserPlayer(void) : Player()
|
---|
| 6 | {
|
---|
| 7 | setDesiredViewPoint(0, 3, -15); //100
|
---|
| 8 | setDesiredLookAtPoint(0, 2, 0); //50
|
---|
| 9 | this->finalTimer = -1;
|
---|
| 10 | }
|
---|
| 11 |
|
---|
| 12 | UserPlayer::~UserPlayer(void)
|
---|
| 13 | {
|
---|
| 14 | }
|
---|
| 15 |
|
---|
| 16 | Vector UserPlayer::getDesiredLookAtPoint()
|
---|
| 17 | {
|
---|
| 18 | Vector temp;
|
---|
| 19 | this->getAbsoluteVector(temp, this->lookAtPoint);
|
---|
| 20 | Vector origin = this->getAbsolutePosition();
|
---|
| 21 | temp.y = origin.y + this->lookAtPoint.y;
|
---|
| 22 | return temp;
|
---|
| 23 | }
|
---|
| 24 |
|
---|
| 25 | Vector UserPlayer::getDesiredViewPoint()
|
---|
| 26 | {
|
---|
| 27 | if(this->pActor!=NULL) {
|
---|
| 28 | this->pActor->getGlobalPose().getColumnMajor44(((NxF32 *) &this->myWorldMatrix.m[0][0]));
|
---|
| 29 | }
|
---|
| 30 | Vector temp;
|
---|
| 31 | this->getAbsoluteVector(temp, this->viewPoint);
|
---|
| 32 | Vector origin = this->getAbsolutePosition();
|
---|
| 33 | temp.y = origin.y + this->viewPoint.y;
|
---|
| 34 | return temp;
|
---|
| 35 | }
|
---|
| 36 |
|
---|
| 37 | void UserPlayer::setDesiredLookAtPoint(float _x, float _y, float _z)
|
---|
| 38 | {
|
---|
| 39 | this->lookAtPoint.x = _x;
|
---|
| 40 | this->lookAtPoint.y = _y;
|
---|
| 41 | this->lookAtPoint.z = _z;
|
---|
| 42 | }
|
---|
| 43 |
|
---|
| 44 | void UserPlayer::setDesiredViewPoint(float _x, float _y, float _z)
|
---|
| 45 | {
|
---|
| 46 | this->viewPoint.x = _x;
|
---|
| 47 | this->viewPoint.y = _y;
|
---|
| 48 | this->viewPoint.z = _z;
|
---|
| 49 | }
|
---|
| 50 |
|
---|
| 51 | /*void UserPlayer::initWin()
|
---|
| 52 | {
|
---|
| 53 | this->finalTimer = 5;
|
---|
| 54 | }
|
---|
| 55 |
|
---|
| 56 | void UserPlayer::initLose()
|
---|
| 57 | {
|
---|
| 58 | this->finalTimer = 5;
|
---|
| 59 | }
|
---|
| 60 |
|
---|
| 61 | void UserPlayer::update(float dt)
|
---|
| 62 | {
|
---|
| 63 | Player::update(dt);
|
---|
| 64 | if(this->finalTimer>0) {
|
---|
| 65 | this->finalTimer-=dt;
|
---|
| 66 | }
|
---|
| 67 | }*/
|
---|
[1403] | 68 |
|
---|
| 69 | extern bool GLOBAL_player_freezeQ;
|
---|
| 70 |
|
---|
| 71 | void UserPlayer::update(float dt)
|
---|
| 72 | {
|
---|
| 73 | if(GLOBAL_player_freezeQ) {
|
---|
| 74 | this->setBehaveAs(Node::KINEMATIC);
|
---|
[1406] | 75 | if(this->winPe->isEmitting()) {
|
---|
| 76 | this->winPe->update(dt);
|
---|
| 77 | }
|
---|
[1403] | 78 | return;
|
---|
| 79 | }
|
---|
| 80 |
|
---|
| 81 | Player::update(dt);
|
---|
| 82 | }
|
---|