[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/games/astrododge
From: Rivo Laks <rivolaks () hot ! ee>
Date: 2009-02-22 18:36:19
Message-ID: 1235327779.406385.2718.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 930148 by rivol:
Fix compilation with Eigen2
M +1 -2 astrogen/asteroidgen.cpp
M +2 -2 src/gameworld.cpp
--- trunk/playground/games/astrododge/astrogen/asteroidgen.cpp #930147:930148
@@ -27,7 +27,6 @@
#include <KConfig>
#include <KConfigGroup>
-#include <Eigen/Geometry>
using namespace Eigen;
#include <stdlib.h>
@@ -217,7 +216,7 @@
float radiusSq = 0;
for (int i = 0; i < vertices.count(); i++) {
vertices[i].pos += translate;
- radiusSq = qMax(radiusSq, vertices[i].pos.norm2());
+ radiusSq = qMax(radiusSq, vertices[i].pos.squaredNorm());
}
// Make asteroid's radius 1
float radius = sqrt(radiusSq);
--- trunk/playground/games/astrododge/src/gameworld.cpp #930147:930148
@@ -198,7 +198,7 @@
{
for (int i = 0; i < mTrack.count(); i++) {
const int tpRadius = 60;
- if ((mShip->position() - mTrack[i]).norm2() < tpRadius*tpRadius) {
+ if ((mShip->position() - mTrack[i]).squaredNorm() < tpRadius*tpRadius) {
kDebug() << "Removing trackpoint" << i;
mTrack.removeAt(i--);
if (mTrack.isEmpty()) {
@@ -264,7 +264,7 @@
GameObject* obj = mObjects[k];
float mindist = radius + obj->radius + 10;
- if ((position - obj->position()).norm2() < mindist*mindist) {
+ if ((position - obj->position()).squaredNorm() < mindist*mindist) {
positionFound = false;
break;
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic