Nov 26, 2014

Time to fix some mess on code. In other words pack the experimented code to functions and classes. Currently there's way too much reused and reused code which I want to have neatly on functions and classes.

Cleaning it might take a while so new content will appear slower for now. After some cleaning Im planning on implementing some ideas:
  • Raycast check if projectile/object passed other object but didnt collided
  • Homing missile which tracks the target
  • Breakable models (need another physx library)
  • Selecting models with sweep query
  • Some new sample models for scenery
I've also got one person working on some concept art, planning to check the results during the new year's day. I gave pretty free hands for the artist, as the only requirements given were "sci-fi laser pew pew" -type of design.

Nov 16, 2014

I've tried to record video of the current situation of project. Here's the result:


Nov 9, 2014

Finally I got the callbacks working correctly, now the bullets will pop up as sphere when they hit either one of the "players" or the ground.

Bullets blooming to sphere when they hit ground or player
I achieved this by nesting class of PxSimulationEventCallback on my physics engine class. And I implemented all of the event functions in there just for the future:

    class pCallBacks:public PxSimulationEventCallback{
        public:
        pCallBacks(void);
        ~pCallBacks(void);

        PxFilterFlags TestFilterShader(   
        PxFilterObjectAttributes attributes0, PxFilterData filterData0,
        PxFilterObjectAttributes attributes1, PxFilterData filterData1,
        PxPairFlags& pairFlags, const void* constantBlock, PxU32 constantBlockSize);

         void                        onConstraintBreak(PxConstraintInfo* constraints, PxU32 count);
         void                        onWake(PxActor** actors, PxU32 count);
         void                        onSleep(PxActor** actors, PxU32 count);
         void                        onContact(const PxContactPairHeader& pairHeader, const PxContactPair* pairs, PxU32 nbPairs);
         void                        onTrigger(PxTriggerPair* pairs, PxU32 count);
      };

    pCallBacks gCallbacks;

And then just set the callbacks on the init:

sceneDesc.simulationEventCallback = &gCallbacks;

The problem currently is that I need to make a new list for explosions and then remove these actors from the physics simulation (currentl the spheres bounce around instead of staying in one spot). Ill try to achieve that for the next post on the blog.