Jump to content

Recommended Posts

Posted

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

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...