[Orxonox-commit 6127] r10785 - in code/branches/hoverHS15: data/levels src/modules/hover
meierman at orxonox.net
meierman at orxonox.net
Mon Nov 9 14:14:48 CET 2015
Author: meierman
Date: 2015-11-09 14:14:47 +0100 (Mon, 09 Nov 2015)
New Revision: 10785
Modified:
code/branches/hoverHS15/data/levels/Hover.oxw
code/branches/hoverHS15/src/modules/hover/Hover.cc
code/branches/hoverHS15/src/modules/hover/HoverWall.cc
code/branches/hoverHS15/src/modules/hover/HoverWall.h
Log:
Placing Walls works
Modified: code/branches/hoverHS15/data/levels/Hover.oxw
===================================================================
--- code/branches/hoverHS15/data/levels/Hover.oxw 2015-11-09 13:09:38 UTC (rev 10784)
+++ code/branches/hoverHS15/data/levels/Hover.oxw 2015-11-09 13:14:47 UTC (rev 10785)
@@ -28,13 +28,14 @@
<Scene
ambientlight = "0.8, 0.8, 0.8"
skybox = "Orxonox/Starbox"
+ gravity = "0, -35, 0"
>
- <StaticEntity position="200,0,0" collisionType="static">
+ <StaticEntity position="0,0,0" collisionType="static">
<attached>
<Model position="500, 0, 0" yaw="0" pitch="0" roll="0" scale3D="500, 30, 2" mesh="cube_red.mesh" />
<Model position="500, 0, 1000" yaw="0" pitch="0" roll="0" scale3D="500, 30, 2" mesh="cube_red.mesh" />
@@ -55,7 +56,7 @@
<Model position="0, 0,0" yaw="0" pitch="0" roll="0" scale3D="10000, 1, 10000" mesh="CubeGround.mesh" />
</attached>
<collisionShapes>
- <BoxCollisionShape yaw="0" pitch="0" roll="0" position="0,0,0" halfExtents="1, 1, 1" />
+ <BoxCollisionShape yaw="0" pitch="0" roll="0" position="0,0,0" halfExtents="10000, 1, 10000" />
</collisionShapes>
</StaticEntity>
Modified: code/branches/hoverHS15/src/modules/hover/Hover.cc
===================================================================
--- code/branches/hoverHS15/src/modules/hover/Hover.cc 2015-11-09 13:09:38 UTC (rev 10784)
+++ code/branches/hoverHS15/src/modules/hover/Hover.cc 2015-11-09 13:14:47 UTC (rev 10785)
@@ -58,8 +58,8 @@
if(firstTick)
{
firstTick = false;
- new HoverWall(origin_->getContext(), 1, 2);
- new HoverWall(origin_->getContext(), 2, 6);
+ new HoverWall(origin_->getContext(), 1, 2, 1);
+ new HoverWall(origin_->getContext(), 2, 6, 1);
}
Modified: code/branches/hoverHS15/src/modules/hover/HoverWall.cc
===================================================================
--- code/branches/hoverHS15/src/modules/hover/HoverWall.cc 2015-11-09 13:09:38 UTC (rev 10784)
+++ code/branches/hoverHS15/src/modules/hover/HoverWall.cc 2015-11-09 13:14:47 UTC (rev 10785)
@@ -53,14 +53,30 @@
cs_ = NULL;
}
- HoverWall::HoverWall(Context* context, int x, int y) : StaticEntity(context)
+ HoverWall::HoverWall(Context* context, int x, int y, int orientation) : StaticEntity(context)
{
RegisterObject(HoverWall);
+ int xSize_, zSize_, xPos_, zPos_;
+
+ if(orientation == 1){
+ xSize_ = 50;
+ zSize_ = 2;
+ xPos_ = x*100;
+ zPos_ = y*100-50;
+ }
+ else{
+ xSize_ = 2;
+ zSize_ = 50;
+ xPos_ = x*100-50;
+ zPos_ = y*100;
+ }
+
+
model_ = new Model(context);
model_->setMeshSource("cube.mesh");
- model_->setScale3D(Vector3(100, 30, 2));
- model_->setPosition(Vector3(x*100-50,0,y*100-50));
+ model_->setScale3D(Vector3(xSize_, 30, zSize_));
+ model_->setPosition(Vector3(xPos_,0,zPos_));
this->attach(model_);
@@ -69,8 +85,8 @@
this->setCollisionType(Static);
cs_ = new BoxCollisionShape(context);
- cs_->setHalfExtents(Vector3(100, 30, 2));
- cs_->setPosition(Vector3(x*100-50,0,y*100-50));
+ cs_->setHalfExtents(Vector3(xSize_, 30, zSize_));
+ cs_->setPosition(Vector3(xPos_,0,zPos_));
this->attachCollisionShape(cs_);
}
Modified: code/branches/hoverHS15/src/modules/hover/HoverWall.h
===================================================================
--- code/branches/hoverHS15/src/modules/hover/HoverWall.h 2015-11-09 13:09:38 UTC (rev 10784)
+++ code/branches/hoverHS15/src/modules/hover/HoverWall.h 2015-11-09 13:14:47 UTC (rev 10785)
@@ -48,7 +48,7 @@
{
public:
HoverWall(Context* context);
- HoverWall(Context* context, int x, int y);
+ HoverWall(Context* context, int x, int y, int orientation);
virtual ~HoverWall();
virtual void tick(float dt);
virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
More information about the Orxonox-commit
mailing list