Gabriel Posted November 16, 2011 Posted November 16, 2011 Hello, Is it possible to add in the Controller class the member function "IsCrouched ()" ? like this : //****************************************************************************** //**** **** //**** LEO - Leadwerks Engine Objects **** //**** (c) 1999-2011 Leadwerks Corporation **** //**** http://www.leadwerks.com **** //**** **** //****************************************************************************** #pragma once #include "leobase.h" #include "leoBody.h" namespace LEO { class Controller : public Body { public: Controller( TEntity ent = NULL, flt height = 1.8f, flt radius = 0.4f, flt stepheight = 0.5f, flt maxslope = 45, flt crouchheight = 0 ); Controller( const CreateMode& rCreateMode, flt height = 1.8f, flt radius = 0.4f, flt stepheight = 0.5f, flt maxslope = 45, flt crouchheight = 0 ); virtual void Create( flt height = 1.8f, flt radius = 0.4f, flt stepheight = 0.5f, flt maxslope = 45, flt crouchheight = 0 ); virtual void Update( flt angle, flt move, flt strafe = 0, flt jump = 0, flt maxacceleration = 0.5f, int iterations = 1, int crouchmode = 0 ); bool IsAirborne( void ) const; bool IsCrouched( void ) const; // GKV modification de la source ajout du menbre IsCrouched (16/11/2011) }; // === inlines === inline Controller::Controller( TEntity ent, flt height, flt radius, flt stepheight, flt maxslope, flt crouchheight ) : Body( ent ) { if( !mIsReference ) Create( height, radius, stepheight, maxslope, crouchheight ); } inline Controller::Controller( const CreateMode& rCreateMode, flt height, flt radius, flt stepheight, flt maxslope, flt crouchheight ) { if( CREATENOW == rCreateMode ) { Create( height, radius, stepheight, maxslope, crouchheight ); } } inline void Controller::Create( flt height, flt radius, flt stepheight, flt maxslope, flt crouchheight ) { Assign( CreateController( height, radius, stepheight, maxslope, crouchheight ) ); } inline void Controller::Update( flt angle, flt move, flt strafe, flt jump, flt maxacceleration, int iterations, int crouchmode ) { UpdateController( m_entity, angle, move, strafe, jump, maxacceleration, iterations, crouchmode ); } inline bool Controller::IsAirborne( void ) const { return 1 == ControllerAirborne( m_entity ); } inline bool Controller::IsCrouched( void ) const // GKV modification de la source ajout du menbre IsCrouched (16/11/2011) { return 1 == ControllerCrouched( m_entity ); } } Thanks ;-) Gabriel Quote
Roland Posted November 17, 2011 Posted November 17, 2011 Yes Gabriel, thats a good idea. In fact it should be there in first hand. Quote Roland Strålberg Website: https://rstralberg.com
Canardia Posted November 17, 2011 Posted November 17, 2011 I'll add this to LEO and send to Josh. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■
Gabriel Posted November 17, 2011 Author Posted November 17, 2011 I'll add this to LEO and send to Josh. cool ;-) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.