Jump to content

[SOLVED] Controller header to update


ZioRed
 Share

Recommended Posts

CreateController and UpdateController must be updated to the current header declaration (added crouch height in Create and crouch mode in Update).

 

/Leadwerks.cs: lines 314-319

 

[DllImport(EngineDll, EntryPoint = "CreateController", CallingConvention = CallingConvention.StdCall)]
public static extern IntPtr CreateController(float _height, float _radius, float _stepheight, float _maxslope, float _crouchHeight);

[DllImport(EngineDll, EntryPoint = "UpdateController", CallingConvention = CallingConvention.StdCall)]
public static extern void UpdateController(IntPtr _controller, float _angle, float _move, float _strafe,
                                               float _jump, float _maxacceleration, int _iterations, int _crouchMode);

 

/Controller.cs

public class Controller : Body
{
   public Controller() : base()
   {
       this.Pointer = Core.CreateController(1, 0, 0, 45, 0);
   }
public Controller(float height, float radius, float stepHeight, float maxSlope, float crouchHeight) : base()
{
       this.Pointer = Core.CreateController(height, radius, stepHeight, maxSlope, crouchHeight);
}

public Controller(IntPtr pointer) : base(pointer) { }

public void Update(float angle, float move, float strafe, float jump, float maxAcceleration, int iterations, int crouchMode)
{
	Core.UpdateController(this.Pointer, angle, move, strafe, jump, maxAcceleration, iterations, crouchMode);
}

public bool IsAirborne()
{
	return Convert.ToBoolean(Core.ControllerAirborne(this.Pointer));
}
}

 

PS: any thought about creating an open source project and create a small group to mantain it updated? If no news about this in few days then I could open a project myself based on last klepto2 headers (well I bring some enhancement by myself, like changing to public the constructor with IntPtr and the Load method on the Mesh class and some other minimal change which now I don't remember).

 

EDIT:

This topic could be closed since it was released a SVN repository which is now up to date.

Edited by ZioRed

?? FRANCESCO CROCETTI ??

http://skaredcreations.com

Link to comment
Share on other sites

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.

 Share

×
×
  • Create New...