[Orxonox-commit 2362] r7077 - in code/branches/presentation3/src: modules/designtools orxonox/worldentities
landauf at orxonox.net
landauf at orxonox.net
Wed Jun 2 01:52:21 CEST 2010
Author: landauf
Date: 2010-06-02 01:52:21 +0200 (Wed, 02 Jun 2010)
New Revision: 7077
Modified:
code/branches/presentation3/src/modules/designtools/CreateStars.cc
code/branches/presentation3/src/orxonox/worldentities/Drone.cc
Log:
delete -> destroy()
Modified: code/branches/presentation3/src/modules/designtools/CreateStars.cc
===================================================================
--- code/branches/presentation3/src/modules/designtools/CreateStars.cc 2010-06-01 22:39:46 UTC (rev 7076)
+++ code/branches/presentation3/src/modules/designtools/CreateStars.cc 2010-06-01 23:52:21 UTC (rev 7077)
@@ -33,7 +33,7 @@
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
#include "graphics/Billboard.h"
-
+
namespace orxonox
{
CreateFactory(CreateStars);
@@ -55,9 +55,9 @@
CreateStars::~CreateStars()
{
- while( billboards_.size()!=0 )
+ while( billboards_.size()!=0 )
{
- delete(billboards_.back());
+ billboards_.back()->destroy();
billboards_.pop_back();
}
@@ -68,7 +68,7 @@
void CreateStars::createBillboards()
{
- for(int i=0; i < numStars_; i++)
+ for(int i=0; i < numStars_; i++)
{
Billboard* bb = new Billboard(this);
@@ -87,7 +87,7 @@
float phi;
float teta;
- while(1)
+ while(1)
{
phi = rnd(2*pi);
teta = rnd(pi);
@@ -100,7 +100,7 @@
}
}
- Vector3 CreateStars::PolarToCartesian(float phi, float teta, float radius)
+ Vector3 CreateStars::PolarToCartesian(float phi, float teta, float radius)
{
float x = radius * cos(phi) * sin(teta);
float y = radius * sin(phi) * sin(teta);
Modified: code/branches/presentation3/src/orxonox/worldentities/Drone.cc
===================================================================
--- code/branches/presentation3/src/orxonox/worldentities/Drone.cc 2010-06-01 22:39:46 UTC (rev 7076)
+++ code/branches/presentation3/src/orxonox/worldentities/Drone.cc 2010-06-01 23:52:21 UTC (rev 7077)
@@ -43,12 +43,12 @@
RegisterObject(Drone);
this->myController_ = 0;
-
+
this->localLinearAcceleration_.setValue(0, 0, 0);
this->localAngularAcceleration_.setValue(0, 0, 0);
this->setRadarVisibility(false);
this->setCollisionType(WorldEntity::Dynamic);
-
+
myController_ = new DroneController(static_cast<BaseObject*>(this)); //!< Creates a new controller and passes our this pointer to it as creator.
myController_->setDrone(this);
@@ -62,7 +62,7 @@
Drone::~Drone()
{
if( this->isInitialized() && this->myController_ )
- delete this->myController_;
+ this->myController_->destroy();
}
/**
@@ -91,7 +91,7 @@
void Drone::tick(float dt)
{
SUPER(Drone, tick, dt);
-
+
//if (this->hasLocalController())
//{
this->localLinearAcceleration_.setX(this->localLinearAcceleration_.x() * getMass() * this->auxilaryThrust_);
@@ -102,13 +102,13 @@
this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->primaryThrust_);
this->physicalBody_->applyCentralForce(physicalBody_->getWorldTransform().getBasis() * this->localLinearAcceleration_);
this->localLinearAcceleration_.setValue(0, 0, 0);
-
+
this->localAngularAcceleration_ *= this->getLocalInertia() * this->rotationThrust_;
this->physicalBody_->applyTorque(physicalBody_->getWorldTransform().getBasis() * this->localAngularAcceleration_);
this->localAngularAcceleration_.setValue(0, 0, 0);
//}
}
-
+
/**
@brief
Moves the Drone in the negative z-direction (Front/Back) by an amount specified by the first component of the input 2-dim vector.
@@ -174,5 +174,5 @@
{
this->localAngularAcceleration_.setZ(this->localAngularAcceleration_.z() + value.x);
}
-
+
}
More information about the Orxonox-commit
mailing list