[Orxonox-commit 7459] r12066 - in code/branches/OrxoKart_HS18: data/levels/templates src/modules/hover src/modules/orxokart
emustafa at orxonox.net
emustafa at orxonox.net
Wed Oct 31 11:23:24 CET 2018
Author: emustafa
Date: 2018-10-31 11:23:24 +0100 (Wed, 31 Oct 2018)
New Revision: 12066
Modified:
code/branches/OrxoKart_HS18/data/levels/templates/spaceshipHover.oxt
code/branches/OrxoKart_HS18/src/modules/hover/HoverShip.cc
code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartKart.cc
code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartKart.h
Log:
OrxoKartKart controls optimized
Modified: code/branches/OrxoKart_HS18/data/levels/templates/spaceshipHover.oxt
===================================================================
--- code/branches/OrxoKart_HS18/data/levels/templates/spaceshipHover.oxt 2018-10-31 10:20:31 UTC (rev 12065)
+++ code/branches/OrxoKart_HS18/data/levels/templates/spaceshipHover.oxt 2018-10-31 10:23:24 UTC (rev 12066)
@@ -1,3 +1,4 @@
+
<Template name=spaceshiphover>
<SpaceShip
hudtemplate = spaceshiphoverhud
@@ -17,11 +18,11 @@
reloadrate = 2
reloadwaittime = 0.5
- primaryThrust = 2000
+ primaryThrust = 600
auxilaryThrust = 300
- rotationThrust = 25
+ rotationThrust = 50
- jumpBoost = 90
+ jumpBoost = 30
lift = 1;
stallSpeed = 500;
Modified: code/branches/OrxoKart_HS18/src/modules/hover/HoverShip.cc
===================================================================
--- code/branches/OrxoKart_HS18/src/modules/hover/HoverShip.cc 2018-10-31 10:20:31 UTC (rev 12065)
+++ code/branches/OrxoKart_HS18/src/modules/hover/HoverShip.cc 2018-10-31 10:23:24 UTC (rev 12066)
@@ -48,21 +48,30 @@
}
void HoverShip::moveFrontBack(const Vector2& value)
- { this->steering_.z -= value.x; }
+ {
+ this->steering_.z -= value.x;
+ orxout() << "mFB" << endl;
+ }
void HoverShip::moveRightLeft(const Vector2& value)
- { this->steering_.x += value.x; }
+ {
+ this->rotateYaw(value);
+ orxout() << "mRL" << endl;
+ }
void HoverShip::moveUpDown(const Vector2& value)
- { this->steering_.y += value.x; }
+ {
+ this->steering_.y += value.x;
+ orxout() << "mUD" << endl;
+ }
void HoverShip::rotateYaw(const Vector2& value)
- {
- this->localAngularAcceleration_.setY(this->localAngularAcceleration_.y() + value.x);
+ {
+ this->localAngularAcceleration_.setY(this->localAngularAcceleration_.y() - value.x);
+ //orxout() << value;
+ Pawn::rotateYaw(value);
+ }
- Pawn::rotateYaw(value);
- }
-
void HoverShip::XMLPort(Element& xmlelement, XMLPort::Mode mode)
{
SUPER(HoverShip, XMLPort, xmlelement, mode);
Modified: code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartKart.cc
===================================================================
--- code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartKart.cc 2018-10-31 10:20:31 UTC (rev 12065)
+++ code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartKart.cc 2018-10-31 10:23:24 UTC (rev 12066)
@@ -25,11 +25,11 @@
*/
/**
- @file HoverShip.cc
- @brief Implementation of the HoverShip control
+ @file OrxoKartKart.cc
+ @brief Implementation of the OrxoKartKart control
*/
-#include "HoverShip.h"
+#include "OrxoKartKart.h"
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
@@ -37,37 +37,46 @@
namespace orxonox
{
- RegisterClass(HoverShip);
+ RegisterClass(OrxoKartKart);
- HoverShip::HoverShip(Context* context) : SpaceShip(context)
+ OrxoKartKart::OrxoKartKart(Context* context) : SpaceShip(context)
{
- RegisterObject(HoverShip);
+ RegisterObject(OrxoKartKart);
enableCollisionCallback();
isFloor_ = false;
jumpBoost_ = 0;
}
- void HoverShip::moveFrontBack(const Vector2& value)
- { this->steering_.z -= value.x; }
+ void OrxoKartKart::moveFrontBack(const Vector2& value)
+ {
+ this->steering_.z -= value.x;
+ orxout() << "mFB" << endl;
+ }
- void HoverShip::moveRightLeft(const Vector2& value)
- { this->steering_.x += value.x; }
+ void OrxoKartKart::moveRightLeft(const Vector2& value)
+ {
+ this->rotateYaw(value);
+ orxout() << "mRL" << endl;
+ }
- void HoverShip::moveUpDown(const Vector2& value)
- { this->steering_.y += value.x; }
+ void OrxoKartKart::moveUpDown(const Vector2& value)
+ {
+ this->steering_.y += value.x;
+ orxout() << "mUD" << endl;
+ }
- void HoverShip::rotateYaw(const Vector2& value)
- {
- this->localAngularAcceleration_.setY(this->localAngularAcceleration_.y() + value.x);
+ void OrxoKartKart::rotateYaw(const Vector2& value)
+ {
+ this->localAngularAcceleration_.setY(this->localAngularAcceleration_.y() - value.x);
+ //orxout() << value;
+ Pawn::rotateYaw(value);
+ }
- Pawn::rotateYaw(value);
- }
-
- void HoverShip::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ void OrxoKartKart::XMLPort(Element& xmlelement, XMLPort::Mode mode)
{
- SUPER(HoverShip, XMLPort, xmlelement, mode);
+ SUPER(OrxoKartKart, XMLPort, xmlelement, mode);
- XMLPortParam(HoverShip, "jumpBoost", setJumpBoost, getJumpBoost, xmlelement, mode);
+ XMLPortParam(OrxoKartKart, "jumpBoost", setJumpBoost, getJumpBoost, xmlelement, mode);
}
/**
@@ -75,7 +84,7 @@
Removed, does nothing.
@param value
*/
- void HoverShip::rotatePitch(const Vector2& value) { }
+ void OrxoKartKart::rotatePitch(const Vector2& value) { }
/**
@brief
@@ -82,16 +91,16 @@
Removed, does nothing.
@param value
*/
- void HoverShip::rotateRoll(const Vector2& value) { }
+ void OrxoKartKart::rotateRoll(const Vector2& value) { }
/**
@brief
Checks if the ship is touching the floor. The ship can only jump if there is contact with someting beneath it.
*/
- bool HoverShip::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint)
+ bool OrxoKartKart::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint)
{
SpaceShip::collidesAgainst(otherObject, cs, contactPoint);
- //SUPER(HoverShip, collidesAgainst, otherObject, cs, contactPoint);
+ //SUPER(OrxoKartKart, collidesAgainst, otherObject, cs, contactPoint);
if (contactPoint.m_normalWorldOnB.y() > 0.6
&& this->getVelocity().y < 1) {
@@ -108,7 +117,7 @@
Makes the ship jump
@param bBoost
*/
- void HoverShip::boost(bool bBoost) {
+ void OrxoKartKart::boost(bool bBoost) {
if (bBoost && this->isFloor_)
{
this->setVelocity(
Modified: code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartKart.h
===================================================================
--- code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartKart.h 2018-10-31 10:20:31 UTC (rev 12065)
+++ code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartKart.h 2018-10-31 10:23:24 UTC (rev 12066)
@@ -25,23 +25,23 @@
*/
/**
- @file HoverShip.h
- @brief Declaration of the HoverShip class.
+ @file OrxoKartKart.h
+ @brief Declaration of the OrxoKartKart class.
*/
-#ifndef _HoverShip_H__
-#define _HoverShip_H__
+#ifndef _OrxoKartKart_H__
+#define _OrxoKartKart_H__
-#include "HoverPrereqs.h"
+#include "OrxoKartPrereqs.h"
#include "worldentities/pawns/SpaceShip.h"
namespace orxonox
{
- class _HoverExport HoverShip : public SpaceShip
+ class _OrxoKartExport OrxoKartKart : public SpaceShip
{
public:
- HoverShip(Context* context);
+ OrxoKartKart(Context* context);
virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
@@ -74,4 +74,4 @@
};
}
-#endif /* _HoverShip_H__ */
+#endif /* _OrxoKartKart_H__ */
More information about the Orxonox-commit
mailing list