Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 9, 2019, 2:20:32 PM (5 years ago)
Author:
pomselj
Message:

Bounces ok-ish, still seg fault… stones get destroyed but models stay, maybe destroy wals too

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.cc

    r12350 r12356  
    3333
    3434#include "OrxoBloxBall.h"
     35#include "OrxoBloxStones.h"
    3536#include "OrxoBlox.h"
    3637#include <bullet/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h>
     
    295296
    296297
    297     void OrxoBloxBall::Bounce(OrxoBloxStones* otherObject) {
     298    void OrxoBloxBall::Bounce(OrxoBloxStones* Stone) {
    298299
    299300        Vector3 velocity = this->getVelocity();
    300         Vector3 positionOtherObject = otherObject->getPosition();
     301        Vector3 positionStone = Stone->getPosition();
    301302        Vector3 myPosition = this->getPosition();
    302303        orxout() << "About to Bounce >D" << endl;
     
    306307        //else {
    307308       
    308             int distance_X = myPosition.x - positionOtherObject.x;
    309             int distance_Z = myPosition.z - positionOtherObject.z;
     309            int distance_X = myPosition.x - positionStone.x;
     310            int distance_Z = myPosition.z - positionStone.z;
    310311
    311312            if (distance_X < 0)
     
    336337
    337338
    338     void OrxoBloxBall::Collides(OrxoBloxStones* otherObject)
    339     {
    340 
    341         if(otherObject == nullptr)
     339    void OrxoBloxBall::Collides(OrxoBloxStones* Stone)
     340    {
     341
     342        if(Stone == nullptr)
    342343            return;
    343344
    344345        orxout() << "About to Bounce >D" << endl;
    345         Bounce(otherObject);
     346        Bounce(Stone);
     347        //if(otherObject->getHealth() <= 0) {
     348            Stone->destroy();
     349        //}
     350        //otherObject->reduceHealth();
    346351    }
    347352
Note: See TracChangeset for help on using the changeset viewer.