Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 10751 was 10751, checked in by meierman, 9 years ago

working cpp object generation

File size: 3.0 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_ = new Model(context);
53        cs_ = new BoxCollisionShape(context);
54        model_->setMeshSource("cube.mesh");
55        model_->setScale3D(Vector3(100, 30, 2));
56        model_->setPosition(Vector3(100,0,100));
57        cs_->setPosition(Vector3(100,0,100));
58        cs_->setHalfExtents(Vector3(100, 30, 2));
59
60
61
62    }
63
64    HoverWall::HoverWall(Context* context, int x, int y) : StaticEntity(context)
65    {
66        RegisterObject(HoverWall);
67        model_ = new Model(context);
68        cs_ = new BoxCollisionShape(context);
69        model_->setMeshSource("cube.mesh");
70        model_->setScale3D(Vector3(50, 30, 2));
71        model_->setPosition(Vector3(x*100-50,0,y*100-50));
72        cs_->setPosition(Vector3(x*100-50,0,y*100-50));
73        cs_->setHalfExtents(Vector3(50, 30, 2));
74
75
76
77    }
78
79    /**
80    @brief
81        Destructor.
82    */
83    HoverWall::~HoverWall()
84    {
85
86    }
87
88    //xml port for loading height and width of the platform
89    void HoverWall::XMLPort(Element& xmlelement, XMLPort::Mode mode)
90    {
91        SUPER(HoverWall, XMLPort, xmlelement, mode);
92
93       // XMLPortParam(HoverWall, "height", setHeight, getHeight, xmlelement, mode);
94        //XMLPortParam(HoverWall, "width", setWidth, getWidth, xmlelement, mode);
95    }
96
97    /**
98    @brief
99        Is called every tick.
100        Handles the movement of the ball and its interaction with the boundaries and bats.
101    @param dt
102        The time since the last tick.
103    */
104    void HoverWall::tick(float dt)
105    {
106        SUPER(HoverWall, tick, dt);
107       
108    }
109
110   
111}
Note: See TracBrowser for help on using the repository browser.