[Orxonox-commit 5627] r10287 - code/trunk/src/modules/weapons/projectiles
landauf at orxonox.net
landauf at orxonox.net
Sat Feb 28 23:50:41 CET 2015
Author: landauf
Date: 2015-02-28 23:50:41 +0100 (Sat, 28 Feb 2015)
New Revision: 10287
Modified:
code/trunk/src/modules/weapons/projectiles/BasicProjectile.cc
code/trunk/src/modules/weapons/projectiles/Projectile.cc
Log:
use dynamic physics for projectiles. this seems to avoid 'tunneling' (if the projectile moves through an opponent without colliding) even with low FPS. projectiles now also collide with static entities.
Modified: code/trunk/src/modules/weapons/projectiles/BasicProjectile.cc
===================================================================
--- code/trunk/src/modules/weapons/projectiles/BasicProjectile.cc 2015-02-28 17:14:55 UTC (rev 10286)
+++ code/trunk/src/modules/weapons/projectiles/BasicProjectile.cc 2015-02-28 22:50:41 UTC (rev 10287)
@@ -81,7 +81,7 @@
{
if (!this->bDestroy_ && GameMode::isMaster())
{
- if (otherObject == this->getShooter()) // Prevents you from shooting yourself
+ if (otherObject == this->getShooter() || otherObject->isA(Class(BasicProjectile))) // Prevents you from shooting yourself or other projectiles
return false;
this->bDestroy_ = true; // If something is hit, the object is destroyed and can't hit something else.
Modified: code/trunk/src/modules/weapons/projectiles/Projectile.cc
===================================================================
--- code/trunk/src/modules/weapons/projectiles/Projectile.cc 2015-02-28 17:14:55 UTC (rev 10286)
+++ code/trunk/src/modules/weapons/projectiles/Projectile.cc 2015-02-28 22:50:41 UTC (rev 10287)
@@ -57,7 +57,7 @@
this->setMass(1.0f);
this->enableCollisionCallback();
this->setCollisionResponse(false);
- this->setCollisionType(Kinematic);
+ this->setCollisionType(Dynamic);
SphereCollisionShape* shape = new SphereCollisionShape(this->getContext());
shape->setRadius(20.0f);
More information about the Orxonox-commit
mailing list