[Orxonox-commit 6449] r11105 - in code/trunk/src/modules: jump objects
fvultier at orxonox.net
fvultier at orxonox.net
Mon Feb 1 17:27:49 CET 2016
Author: fvultier
Date: 2016-02-01 17:27:49 +0100 (Mon, 01 Feb 2016)
New Revision: 11105
Modified:
code/trunk/src/modules/jump/JumpCenterpoint.h
code/trunk/src/modules/jump/JumpFigure.h
code/trunk/src/modules/objects/SpaceBoundaries.cc
Log:
Removed wrong comments in Jump minigame. These comments were artifacts from copy paste.
Modified: code/trunk/src/modules/jump/JumpCenterpoint.h
===================================================================
--- code/trunk/src/modules/jump/JumpCenterpoint.h 2016-01-31 22:42:11 UTC (rev 11104)
+++ code/trunk/src/modules/jump/JumpCenterpoint.h 2016-02-01 16:27:49 UTC (rev 11105)
@@ -37,70 +37,7 @@
/**
@brief
- The JumpCenterpoint implements the playing field @ref orxonox::Jump "Jump" takes place in and allows for many parameters of the minigame to be set.
- The playing field resides in the x,z-plane, with the x-axis being the horizontal axis and the z-axis being the vertical axis.
-
- Various parameters can be set:
- - The <b>dimension</b> is a vector, that defines the width and height of the playing field. The default is <em>(200, 120)</em>.
- - The <b>balltemplate</b> is a template that is applied to the @ref orxonox::JumpPlatform "JumpPlatform", it can be used to attach different things to it, e.g. its @ref orxonox::Model "Model". See below for a usage example.
- - The <b>battemplate</b> is a template that is applied to the @ref orxonox::JumpPlatform "JumpFigure", it can be used to attach different things to it, e.g. its @ref orxonox::Model "Model". See below for a usage example.
- - The <b>ballspeed</b> is the speed with which the @ref orxonox::JumpPlatform "JumpPlatform" moves. The default is <em>100</em>.
- - The <b>ballaccfactor</b> is the acceleration factor for the @ref orxonox::JumpPlatform "JumpPlatform". The default is <em>1.0</em>.
- - The <b>batspeed</b> is the speed with which the @ref orxonox::JumpFigure "JumpFigures" move. The default is <em>60</em>.
- - The <b>batlength</b> is the length of the @ref orxonox::JumpFigure "JumpFigures" as the percentage of the height of the playing field. The default is <em>0.25</em>.
-
- An example in XML of the JumpCenterpoint would be:
-
- First the needed templates:
- The template for the @ref orxonox::JumpPlatform "JumpPlatform".
- @code
- <Template name="jumpball">
- <JumpPlatform>
- <attached>
- <Model mesh="sphere.mesh" scale="2" />
- <ParticleSpawner name="hiteffect" position="0,0,0" source="Orxonox/sparks2" lifetime="0.01" autostart="0" mainstate="spawn" />
- </attached>
- <eventlisteners>
- <EventTarget target="hiteffect" />
- </eventlisteners>
- </JumpPlatform>
- </Template>
- @endcode
- As can be seen, a sphere is attached as the @ref orxonox::Model "Model" for the @ref orxonox::JumpPlatform "JumpPlatform", and also an @ref orxonox::EventListener "EventListener" that triggers a @ref orxonox::ParticleSpawner "ParticleSpawner", whenever the ball hits the boundaries is attached.
-
- Additionally the template for the @ref orxonox::JumpFigure "JumpFigure".
- @code
- <Template name="jumpbatcameras" defaults="0">
- <JumpFigure>
- <camerapositions>
- <CameraPosition position="0,200,0" pitch="-90" absolute="true" />
- </camerapositions>
- </JumpFigure>
- </Template>
-
- <Template name="jumpbat">
- <JumpFigure camerapositiontemplate=jumpbatcameras>
- <attached>
- <Model position="0,0,3" mesh="cube.mesh" scale3D="14,2,2" />
- </attached>
- </JumpFigure>
- </Template>
- @endcode
- As can be seen, there are actually two templates. The first template is needed to set the camera for the @ref orxonox::JumpFigure "JumpFigure". The second template ist the actual template for the @ref orxonox::JumpFigure "JumpFigure", the template for the camera position is added and a @ref orxonox::Model "Model" for the @ref orxonox::JumpFigure "JumpFigure" is attached.
- propellerTemplate_
- Finally the JumpCenterpoint is created.
- @code
- <JumpCenterpoint name="jumpcenter" dimension="200,120" balltemplate="jumpball" battemplate="jumpbat" ballspeed="200" ballaccfactor="1.0" batspeed="130" batlength="0.25">
- <attached>
- <Model position="0,0,60" mesh="cube.mesh" scale3D="105,1,1" />
- <Model position="0,0,-60" mesh="cube.mesh" scale3D="105,1,1" />
- </attached>
- </JumpCenterpoint>
- @endcode
- All parameters are specified. And also two @ref orxonox::Model "Models" (for the upper and lower boundary) are attached.
-
- For a more elaborate example, have a look at the <code>jump.oxw</code> level file.
-
+ @brief The JumpCenterpoint is a StaticEntity which represents the level of the minigame. All platforms, enemies and items are attached to the JumpCenterpoint.
*/
class _JumpExport JumpCenterpoint : public StaticEntity
{
Modified: code/trunk/src/modules/jump/JumpFigure.h
===================================================================
--- code/trunk/src/modules/jump/JumpFigure.h 2016-01-31 22:42:11 UTC (rev 11104)
+++ code/trunk/src/modules/jump/JumpFigure.h 2016-02-01 16:27:49 UTC (rev 11105)
@@ -41,8 +41,8 @@
virtual ~JumpFigure() {}
virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
virtual void tick(float dt) override;
- virtual void moveFrontBack(const Vector2& value) override; //!< Overloaded the function to steer the bat up and down.
- virtual void moveRightLeft(const Vector2& value) override; //!< Overloaded the function to steer the bat up and down.
+ virtual void moveFrontBack(const Vector2& value) override; //!< Overloaded the function to steer the figure up and down.
+ virtual void moveRightLeft(const Vector2& value) override; //!< Overloaded the function to steer the figure up and down.
virtual void rotateYaw(const Vector2& value) override;
virtual void rotatePitch(const Vector2& value) override;
virtual void rotateRoll(const Vector2& value) override;
Modified: code/trunk/src/modules/objects/SpaceBoundaries.cc
===================================================================
--- code/trunk/src/modules/objects/SpaceBoundaries.cc 2016-01-31 22:42:11 UTC (rev 11104)
+++ code/trunk/src/modules/objects/SpaceBoundaries.cc 2016-02-01 16:27:49 UTC (rev 11105)
@@ -81,13 +81,17 @@
{
pawnsIn_.push_back(currentPawn);
}
- } else if (this->reaction_ == 2) {
+ }
+ else if (this->reaction_ == 2)
+ {
float distance = this->computeDistance(currentPawn);
if(distance >= this->maxDistance_)
{
pawnsIn_.push_back(currentPawn);
}
- } else {
+ }
+ else
+ {
pawnsIn_.push_back(currentPawn);
}
}
@@ -204,6 +208,9 @@
this->checkWhoIsIn();
this->removeAllBillboards();
+ if(!this->isActive())
+ return;
+
float distance;
bool humanItem;
for(Pawn* currentPawn : pawnsIn_)
More information about the Orxonox-commit
mailing list