Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/hoverHS15/src/modules/hover/HoverWall.cc @ 10760

Last change on this file since 10760 was 10760, checked in by fvultier, 9 years ago

2 problems fixed: The collidesAgainst function in the hovership get now properly called. The Hoverhalls have a collisionShape that works.

File size: 2.9 KB
Line 
1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *                    > www.orxonox.net <
4 *
5 *
6 *   License notice:
7 *
8 *   This program is free software; you can redistribute it and/or
9 *   modify it under the terms of the GNU General Public License
10 *   as published by the Free Software Foundation; either version 2
11 *   of the License, or (at your option) any later version.
12 *
13 *   This program is distributed in the hope that it will be useful,
14 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 *   GNU General Public License for more details.
17 *
18 *   You should have received a copy of the GNU General Public License
19 *   along with this program; if not, write to the Free Software
20 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 *
22 *   Author:
23 *      Fabien Vultier
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29/**
30    @file HoverWall.cc
31    @brief All platforms in this minigame inherit from this class. The basic functions of a platform (interact with figure) is implemented here. Special functions are implemented in the specialized classes.
32*/
33
34#include "HoverWall.h"
35
36#include "core/CoreIncludes.h"
37#include "core/GameMode.h"
38#include "graphics/Model.h"
39#include "gametypes/Gametype.h"
40
41
42
43#include "core/XMLPort.h"
44
45namespace orxonox
46{
47    RegisterClass(HoverWall);
48
49    HoverWall::HoverWall(Context* context) : StaticEntity(context)
50    {
51        RegisterObject(HoverWall);
52        model_ = NULL;
53        cs_ = NULL;
54    }
55
56    HoverWall::HoverWall(Context* context, int x, int y) : StaticEntity(context)
57    {
58        RegisterObject(HoverWall);
59
60        model_ = new Model(context);
61        model_->setMeshSource("cube.mesh");
62        model_->setScale3D(Vector3(100, 30, 2));
63        model_->setPosition(Vector3(x*100-50,0,y*100-50));
64
65        this->attach(model_);
66
67        this->enableCollisionCallback();
68        this->setCollisionResponse(true);
69        this->setCollisionType(Static);
70
71        cs_ = new BoxCollisionShape(context);
72        cs_->setHalfExtents(Vector3(100, 30, 2));
73        cs_->setPosition(Vector3(x*100-50,0,y*100-50));
74
75        this->attachCollisionShape(cs_);
76    }
77
78    /**
79    @brief
80        Destructor.
81    */
82    HoverWall::~HoverWall()
83    {
84
85    }
86
87    //xml port for loading height and width of the platform
88    void HoverWall::XMLPort(Element& xmlelement, XMLPort::Mode mode)
89    {
90        SUPER(HoverWall, XMLPort, xmlelement, mode);
91
92       // XMLPortParam(HoverWall, "height", setHeight, getHeight, xmlelement, mode);
93        //XMLPortParam(HoverWall, "width", setWidth, getWidth, xmlelement, mode);
94    }
95
96    /**
97    @brief
98        Is called every tick.
99        Handles the movement of the ball and its interaction with the boundaries and bats.
100    @param dt
101        The time since the last tick.
102    */
103    void HoverWall::tick(float dt)
104    {
105        SUPER(HoverWall, tick, dt);
106       
107    }
108
109   
110}
Note: See TracBrowser for help on using the repository browser.