source: GTP/trunk/App/Games/Jungle_Rumble/src/UserPlayer.cpp @ 1406

Revision 1406, 1.6 KB checked in by giegl, 18 years ago (diff)

GTPD - Jungle Rumble - GLOBAL_player_freezeQ (F6 kill opponents, F7 freeze player) working

Line 
1#include "dxstdafx.h"
2#include ".\UserPlayer.h"
3
4
5UserPlayer::UserPlayer(void) : Player()
6{
7        setDesiredViewPoint(0, 3, -15); //100
8        setDesiredLookAtPoint(0, 2, 0); //50
9        this->finalTimer = -1;
10}
11
12UserPlayer::~UserPlayer(void)
13{
14}
15
16Vector 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
25Vector 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
37void 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
44void 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
56void UserPlayer::initLose()
57{
58        this->finalTimer = 5;
59}
60
61void UserPlayer::update(float dt)
62{
63        Player::update(dt);
64        if(this->finalTimer>0) {
65                this->finalTimer-=dt;
66        }
67}*/
68
69extern bool GLOBAL_player_freezeQ;
70
71void UserPlayer::update(float dt)
72{
73        if(GLOBAL_player_freezeQ) {
74                this->setBehaveAs(Node::KINEMATIC);
75                if(this->winPe->isEmitting()) {
76                        this->winPe->update(dt);
77                }
78                return;
79        }
80
81        Player::update(dt);
82}
Note: See TracBrowser for help on using the repository browser.