Problem with the playerController

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: Problem with the playerController

Postby Julio Jerez » Mon May 27, 2013 4:52 pm

letter123 wrote:If I set the mass of the player for example 1.0f and an object collide with the player, then the player will be very fast pushed away, isn't it?

no, just try, it should work.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Problem with the playerController

Postby Enclave » Tue May 28, 2013 1:39 am

letter123 wrote:Actually I have the problem that the object and player pushed to air again when I jump on top of a dynamic body.


This maybe a bug. I have the same at my game engine. At first I used a very big world and huge objects, but now the world is scaled to metric system, which Newton uses, but the error persists.

The strange thing is that when I do the export of collisions to the Sandbox, everything works fine.

To two: The best thing is that the player doesn't move and the dynamic body bahaives like a collision with static object.


In the most games the player can move the dynamic bodies, this is usual behavior and this is normal.
Enclave
 
Posts: 81
Joined: Wed May 01, 2013 6:00 am

Re: Problem with the playerController

Postby Julio Jerez » Tue May 28, 2013 7:16 am

Enclave wrote:
letter123 wrote:Actually I have the problem that the object and player pushed to air again when I jump on top of a dynamic body.

This maybe a bug. I have the same at my game engine. At first I used a very big world and huge objects, but now the world is scaled to metric system, which Newton uses, but the error persists.

I do not understand what that means? you said in the last post that it was working. Can you make a movie of that behavior?

As for player not being able to move objects, why is that normal behaviors? normal behavior is the play can move the objects.
to make the player no move the object the solution in no on the player code.

I will add a function to the player controller called player proximity. Basically this will be a layer that will be added to the scanning distance that the player look ahead.
this will maintain the player as a restricted order against other objects, so he will get closet but will but move in perpetual collision.

Please make the movies of that jump in the air bug, because I do not know what it is.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Problem with the playerController

Postby Julio Jerez » Tue May 28, 2013 7:51 am

Ok I added the Restraining distance to the player controller.

after you created the player you can call this function
Code: Select all
      // make the player controller, this function makes a kinematic body
      m_controller = manager->CreatePlayer(PLAYER_MASS, radius, radius * 0.5f, height, height * 0.33f, playerAxis);

      // set a restraining distance that the player can not get closet than
      m_controller->SetRestrainingDistance(0.5f);


and the player will not get any closer than the restraining distance you pass in,
I check in the demo with a distance of 0.5 so that you can see the effect, you set some small value like 0.125 or so. see if that word for you guys.

The way is behaves is hat he respect that restraining distance for anything in that hit the body, but not in the lower thin support shape, anything he hit there he either push of step on.
please make the video of the Bug, because that I do no know what is.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Problem with the playerController

Postby Enclave » Tue May 28, 2013 8:15 am

Ok, when I get home, I'll will test and make the video.

Julio, please, check the DLL issue, that I write here: http://newtondynamics.com/forum/viewtopic.php?f=9&t=7645&start=30#p52596

It's hard to do upgrade, because the JointLibrary.dll does not built correctly.
Enclave
 
Posts: 81
Joined: Wed May 01, 2013 6:00 am

Re: Problem with the playerController

Postby FSA » Tue May 28, 2013 8:43 am

User avatar
FSA
 
Posts: 322
Joined: Wed Dec 21, 2011 9:47 am

Re: Problem with the playerController

Postby Julio Jerez » Tue May 28, 2013 9:01 am

Enclave wrote:It's hard to do upgrade, because the JointLibrary.dll does not built correctly.

what do you mean the joint library does not build correctly? How were you using the player controller before? it is in the same library
It is like we are in different world, the library should build fine out of the box.

also how can I play a DLL? if you want me to test some bu you nee to make and executable that link to a newton DLL.


I can no play the video, the site ask me to download or install some other program, and I am not going to do that.
can you make a youtube video? that will be the easiest way?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Problem with the playerController

Postby FSA » Tue May 28, 2013 9:07 am

It's a bit tricky to dowanload ;) See the picture. I have circled the download button.
Attachments
DW.JPG
DW.JPG (94.26 KiB) Viewed 3971 times
User avatar
FSA
 
Posts: 322
Joined: Wed Dec 21, 2011 9:47 am

Re: Problem with the playerController

Postby Julio Jerez » Tue May 28, 2013 9:21 am

Ok I see the video, but I am, all confused.
I see you place a box, then a palette crate, and then I see a yellow cursor jumping in the air. I guess that's the player, by I do no see anything.
can you export the scene that make the play do that and send to me, maybe I can recreated that in the sand box demos.

I will start adding serialization to the joint library so that we can import and export these kind of problems
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Problem with the playerController

Postby FSA » Tue May 28, 2013 10:17 am

I place two objects in the scene. The box is static and the palette crate is dynamic. Then I turn on the physic and fly with the camera over the palette crate. Then I create the player in the air at the position of the camera(red text "In Game mode" appears). That's the point where the camera(now the player) falls down on top of the palette crate. And then when the player collides with the top of the palette crate he jumps up and the palette crate jumps up too. The yellow thing is my cursor ;) You can easily build this scene by your one. Just a static floor and above a dynamic box. Then let the player falling on top of the box.
User avatar
FSA
 
Posts: 322
Joined: Wed Dec 21, 2011 9:47 am

Re: Problem with the playerController

Postby Enclave » Tue May 28, 2013 10:30 am

what do you mean the joint library does not build correctly? How were you using the player controller before? it is in the same library
It is like we are in different world, the library should build fine out of the box.


I mean dJointLibrary.dll, I cannot compile it in as DLL, because some of the parameters in your project are set incorrectly.

Julio, is it possible to compile Joint Library to dll ? When I select "ReleaseDLL" option, It makes DLL file with a size 126 Kb, but requires .LIB file, which not creates. If I change an option in project properties to make LIB file, it will be created with size 1.21 Mb, as static library.

I mean this solution file: \newton-dynamics\packages\projects\visualStudio_2008\build.sln

I need a DLL library for my project.


Newton.dll normally created as a dynamic library, unlike dJointLibrary.dll
Before that I using a static library dJointLibrary.lib, but I need a DLL for my project.
Enclave
 
Posts: 81
Joined: Wed May 01, 2013 6:00 am

Re: Problem with the playerController

Postby Julio Jerez » Tue May 28, 2013 10:46 am

Ok I will add the joint library dll settings.

But you did no answer how you were using that player controller since it is implemented in the same joint library project.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Problem with the playerController

Postby Enclave » Tue May 28, 2013 11:18 am

But you did no answer how you were using that player controller since it is implemented in the same joint library project.



Before that I am using a static version of joint library.


Ok, I am record a video:
Please look to behavior of boxes, it is a very strange. What's wrong??? :?:

Note that I am use the scaled world, but the floor plane is a large.
The second strange thing, that I cannot get the same strange boxes behavior, when I serialize my scene into the Sandbox.

The player also makes an unexpected jump when touch the box, this is not normal, because the box have weight 10kg, but Player weight is a 90kg.

Enclave
 
Posts: 81
Joined: Wed May 01, 2013 6:00 am

Re: Problem with the playerController

Postby FSA » Tue May 28, 2013 11:58 am

Thank you Enclave for the better video you made. That is exactly the same problem as mine.
User avatar
FSA
 
Posts: 322
Joined: Wed Dec 21, 2011 9:47 am

Re: Problem with the playerController

Postby Julio Jerez » Tue May 28, 2013 12:54 pm

Did you get the latest code. The code I check in this morning has the Restraining Distance function.
you use it like this
Code: Select all
// make the player controller, this function makes a kinematic body
m_controller = manager->CreatePlayer(PLAYER_MASS, radius, radius * 0.5f, height, height * 0.33f, playerAxis);

// set a restraining distance that the player can not get closet than
m_controller->SetRestrainingDistance(0.1f);


that will prevent the player form hitting any obstacle, try that and let me know if it fixes that.

I also see a lot of stuff very wrong on that video. why those boxes stay on one edge when the player hit them, there most be something else that is wrong.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests