Streamline for Ai Pose Removing ShapeBase

Expanding and utilizing the engine via C++.
1 post Page 1 of 1
Steve_Yorkshire
Posts: 252
Joined: Tue Feb 03, 2015 10:30 pm
 
  by Steve_Yorkshire » Thu Apr 05, 2018 10:33 pm
Whilst browsing through the current dev branch I noticed my old AiPoses resource which I had asked someone to pull. I also noticed that originally I'd use ShapeBase to store the mAiPose var, and thought that it could probably be streamlined to be removed from ShapeBase.cpp/h and incorporated into Player.cpp/h.

ShapeBase.h
//...
   //S32 mAiPose;                     ///< Current pose.//REMOVED LINE 892
   F32 mEnergy;                     ///< Current enery level.
F32 mRechargeRate; ///< Energy recharge rate (in units/tick).
//...
ShapeBase.cpp
//...
ShapeBase::ShapeBase()
 : mDataBlock( NULL ),
   mIsAiControlled( false ),
   mControllingObject( NULL ),
   //mAiPose( 0 ),//REMOVED LINE 989
mMoveMotion( false ),
//...
And move them over to Player.

Player.h
//...
   void allowProne(bool state) { mAllowProne = state; }
   void allowSwimming(bool state) { mAllowSwimming = state; }
   S32 mAiPose; //ADDED ~LINE 733
   bool canJump();                                         ///< Can the player jump?
   bool canJetJump(); ///< Can the player jet?
//...
Player.cpp
//...
   dMemset( mSplashEmitter, 0, sizeof( mSplashEmitter ) );

   mUseHeadZCalc = true;
   mAiPose = 0; //ADDED ~LINE 1623
   allowAllPoses();

mImpactSound = 0;
//...
And all seems to work as before using Player/AiPlayer.cpp/h but no longer using ShapeBase.cpp/h.

There is no real extra benefit - beyond freeing up an already crowded shapeBase - to doing things this way ... except autism and OCD, but hey :roll:
1 post Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest