[Orxonox-commit 7698] r12291 - code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles
pomselj at orxonox.net
pomselj at orxonox.net
Thu Apr 11 14:06:24 CEST 2019
Author: pomselj
Date: 2019-04-11 14:06:24 +0200 (Thu, 11 Apr 2019)
New Revision: 12291
Modified:
code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.cc
code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BasicProjectile.cc
Log:
BallProjectile method is caled during collision
Modified: code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.cc 2019-04-11 12:05:59 UTC (rev 12290)
+++ code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.cc 2019-04-11 12:06:24 UTC (rev 12291)
@@ -91,10 +91,10 @@
Vector3 velocity = this->getVelocity();
Vector3 positionOtherObject = otherObject->getPosition();
Vector3 contactPosition = this->getPosition();
-
+ orxout() << "About to Bounce >D" << endl;
//if (positionOtherObject.y < 0) {
//this.destroy()
- //}
+ //}S
//else {
int distance_X = positionOtherObject.x - contactPosition.x;
@@ -108,9 +108,9 @@
distance_X = -distance_X;
if (distance_X < distance_Y)
+ velocity.y = -velocity.y;
+ if (distance_Y < distance_X)
velocity.x = -velocity.x;
- if (distance_Y < distance_X)
- velocity.y = -velocity.y;
else {
velocity.x = -velocity.x;
velocity.y = -velocity.y;
Modified: code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BasicProjectile.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BasicProjectile.cc 2019-04-11 12:05:59 UTC (rev 12290)
+++ code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BasicProjectile.cc 2019-04-11 12:06:24 UTC (rev 12291)
@@ -84,6 +84,7 @@
*/
bool BasicProjectile::processCollision(WorldEntity* otherObject, btManifoldPoint& contactPoint, const btCollisionShape* cs)
{
+ orxout() << "OMG A COLLISION" << endl;
if (!this->bDestroy_ && GameMode::isMaster())
{
if (this->isObjectRelatedToShooter(otherObject) || otherObject->isA(Class(BasicProjectile))) // Prevents you from shooting yourself or other projectiles
More information about the Orxonox-commit
mailing list