character controller how to jump?

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

character controller how to jump?

Postby zecack » Mon Aug 25, 2008 7:31 pm

hello!
Im trying new player controller in beta 2.0 i can make it move on floor, but how I make it jump?
zecack
 
Posts: 7
Joined: Fri Aug 15, 2008 11:35 am

Re: character controller how to jump?

Postby zecack » Wed Aug 27, 2008 2:16 pm

anybody know? I'm stuck with this.

And if i put the character in air it doesn't fall. how to afect character with gravity?
zecack
 
Posts: 7
Joined: Fri Aug 15, 2008 11:35 am

Re: character controller how to jump?

Postby JernejL » Wed Aug 27, 2008 3:02 pm

zecack wrote:anybody know? I'm stuck with this.

And if i put the character in air it doesn't fall. how to afect character with gravity?


add gravity in the forcetorque callback.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: character controller how to jump?

Postby Julio Jerez » Wed Aug 27, 2008 3:03 pm

just set the jump velociy
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: character controller how to jump?

Postby zecack » Wed Aug 27, 2008 3:20 pm

hi, thanks for the help!

Delfi wrote:add gravity in the forcetorque callback.

when i use the character joint, the force/torque callback seems not working. If i remove joint, then the character falls.

Julio Jerez wrote:just set the jump velociy

how I do it? I'm using this functions, is that ok or I must use something else? I don't find one to set jump.

Code: Select all
JOINTLIBRARY_API CustomJoint *CreateCustomPlayerController (const dFloat* pins, const NewtonBody* player, dFloat maxStairStepFactor);
JOINTLIBRARY_API void CustomPlayerControllerSetPushActorCallback (CustomJoint* playerController, PlayerCanPuchThisBodyCalback callback);
JOINTLIBRARY_API void CustomPlayerControllerSetVelocity (CustomJoint* playerController, dFloat forwardSpeed, dFloat sideSpeed, dFloat heading);
JOINTLIBRARY_API void CustomPlayerControllerSetMaxSlope (CustomJoint* playerController, dFloat maxSlopeAngleIndRadian);
JOINTLIBRARY_API dFloat CustomPlayerControllerGetMaxSlope (CustomJoint* playerController);
JOINTLIBRARY_API const NewtonCollision* CustomPlayerControllerGetVerticalSensorShape (CustomJoint* playerController);
JOINTLIBRARY_API const NewtonCollision* CustomPlayerControllerGetHorizontalSensorShape (CustomJoint* playerController);
JOINTLIBRARY_API const NewtonCollision* CustomPlayerControllerGetDynamicsSensorShape (CustomJoint* playerController);
zecack
 
Posts: 7
Joined: Fri Aug 15, 2008 11:35 am

Re: character controller how to jump?

Postby Julio Jerez » Wed Aug 27, 2008 6:05 pm

it is in the player controller joint
CustomPlayerController::SetVelocity (dFloat forwardSpeed, dFloat sideSpeed, dFloat heading); the funtionality fo rjumpimh is n the joint, Bu I never added and inteface for it.
The player controller is comming in the Beta. But if can quickly add the jump interface if you need it.
In the mean time can you using try using SetVelocity and see of teh playe moves like you want.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: character controller how to jump?

Postby zecack » Wed Aug 27, 2008 6:56 pm

hi julio, thanks for your help, but I cant get it working

There is a function like that you say in jointlibrary.h:
Code: Select all
CustomPlayerControllerSetVelocity (CustomJoint* playerController, dFloat forwardSpeed, dFloat sideSpeed, dFloat heading);

I understand this:
* heading is the angle of the movement of the character
* forwardSpeed is the speed in the angle of heading
* sideSpeed is the speed in 90º of the angle

But there is no "upSpeed"? how do I do it?
zecack
 
Posts: 7
Joined: Fri Aug 15, 2008 11:35 am

Re: character controller how to jump?

Postby Julio Jerez » Wed Aug 27, 2008 7:50 pm

I said I forgot to add the inteface to set the jump speed.
it the player moving?
if so try wallking over and edge and see iof it fall by gravity.
then you need to waight unti I add the jump interface.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: character controller how to jump?

Postby zecack » Wed Aug 27, 2008 8:02 pm

no, it doesn't fall if the joint is created
zecack
 
Posts: 7
Joined: Fri Aug 15, 2008 11:35 am

Re: character controller how to jump?

Postby zecack » Thu Aug 28, 2008 8:08 pm

is there anything i have to do to make it fall?
zecack
 
Posts: 7
Joined: Fri Aug 15, 2008 11:35 am

Re: character controller how to jump?

Postby zecack » Fri Aug 29, 2008 6:34 pm

sorry, julio. Now i put the character higher and i see it falls. But it stops in the air (about 1 meter). If i don't create the joint, it reach the floor. what is the problem? is there some parameter to set? thanks.
zecack
 
Posts: 7
Joined: Fri Aug 15, 2008 11:35 am

Re: character controller how to jump?

Postby VeT » Sat Feb 28, 2009 1:59 pm

Julio, what about Character Control in last version of demo?
1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy
LiteC+Newton2 download: http://hosted.filefront.com/NeArGa
LiteC+Newton2 discussion: http://tinyurl.com/6l7y9v
VeT
 
Posts: 84
Joined: Thu Jul 31, 2008 11:31 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 16 guests