Optimize Marc's Character Controller / Batching Convex Casts

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: Optimize Marc's Character Controller / Batching Convex C

Postby Marc » Thu Sep 06, 2012 4:06 pm

hmm ok. How to you connect the kinematic to the dynamic body? With a common joint? I'll check into that when the other open topics are done for newton3xx.
Millenium Project Enterprises - Hobbyist Gamedev Group http://www.mpe-online.org
Walkover is now on Steam => http://store.steampowered.com/app/348700/
User avatar
Marc
 
Posts: 281
Joined: Sun Mar 14, 2004 4:07 pm
Location: Germany

Re: Optimize Marc's Character Controller / Batching Convex C

Postby Julio Jerez » Fri Sep 07, 2012 10:08 am

Oh that is easy, bother Kinematic bodies and \Dynamics bodies have a common ancestor which is the dgBody.
The dgBody is a light weight body why have all of the functionality for attaching joints
Dynamic bodies add the stuff necessary for physics motions, where Kinetic bodies are empty.
The broad phase which is the part of the engine in charge of creating and destroying contact joints, work on dgBodies, therefore it is agnostic to what kind of bodies operates on.
The dynamic solver operates on Dynamics bodies, so when it going over the joint graph, in only consider joints which connect tow Dynamics bodies.
This way body object can coexist in the world and they can connected but they do not interfered with each others.
They only thing left for the complete interface to be complete is to change the Joint base class so that it only take Dymamic bodies (kinematic bodies cannot be jointed now)
In the future after complete the entire collision that I am working now, Kinematic bodies will have a special king of joint, Kinematic joints, this are joint that work on the velocity domain and are good for controlling animated articulate skeletons.

so to sumarize, kinamtic bodies can be coneted to dynamics bodies with cointact joints but these contac joint are ignored by the solver.
Kinematoc bodies can not be coneced to anything by joints (at least not now)

Kinematics bodies are cheap and can be use for almost any non phsciosl gameplay objects, player, particles, triggers volumes, or anythong elkse you can think off.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Optimize Marc's Character Controller / Batching Convex C

Postby Julio Jerez » Fri Sep 07, 2012 10:12 am

you mention once that you playe controll was opn source, is that true.
I am about to complete the kinamtic body interface and I want to make an player controller base on ke\inematoc body,
maybe I can use you implementation as a starting point? is that possible?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Optimize Marc's Character Controller / Batching Convex C

Postby Marc » Fri Sep 07, 2012 10:37 am

Yes. I posted it here viewtopic.php?f=9&t=7321
As I wrote, it is not a super easy drop in because it uses material types and such things so it demands some kind of materials and filter etc. But if you want to adapt it to the new kinematic bodies, maybe reading the code gives you an info on how it works. You can use it under whatever license you want, but I'm not responsible for any damage etc ... Besides that, I'ld be thrilled if the character controller got integrated in newton somehow :D

The thing I'm not sure about though is, from what you saying and from what I think a kinematic body means, a kinematic based character controller would not be able to react to outside things right? So when I walk around with it, it can push stuff around, but stuff can't push the placer controller around right? That's not what my character controller does. So far, it interacts in both ways. It pushes stuff around and also gets pushed around. I'm not sure if that's even possible with kinematic bodies only.
Millenium Project Enterprises - Hobbyist Gamedev Group http://www.mpe-online.org
Walkover is now on Steam => http://store.steampowered.com/app/348700/
User avatar
Marc
 
Posts: 281
Joined: Sun Mar 14, 2004 4:07 pm
Location: Germany

Re: Optimize Marc's Character Controller / Batching Convex C

Postby Julio Jerez » Fri Sep 07, 2012 11:53 am

Marc wrote:So when I walk around with it, it can push stuff around, but stuff can't push the placer controller around right?

this is correct, but because you have acess to all contacts with dynamics the player controll can push bodies by adding forces or impulses to any body is comes in contact too.
i can also react to any dynamic body by on hsi own.


Marc wrote:That's not what my character controller does. So far, it interacts in both ways. It pushes stuff around and also gets pushed around. I'm not sure if that's even possible with kinematic bodies only.

what I say expolain this,

for this core 300 have a pre listener and post listens funtionality.
Prelsiten are called after the dynamics body update, and post listedns are called afte teh simulation update.

so a playe controll is impemneted a as a pair of listene that sadwwich the dynamic face.

in the pre listens phase, each playe detent teh bodies that are collidesin with teh palyer, and if it wan thso bodies to react is simple calculate the impusle that tah wiull make the body reation.
then the solve resolve all bodies an dintegrate the dynamics bopdei sto new position.

then the player poslisner is called and it is here that the new position for the player is calculated so that it do not penetrate any dynamics body.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Optimize Marc's Character Controller / Batching Convex C

Postby Marc » Sat Sep 08, 2012 5:07 am

Hmm. I'm no expert in implementing physic engines, but if you try to add both way interactions to a kinematic body, isn't that like reimplementing a dynamic body?

How does the kinetic body work? I specify velocities instead of forces? Or do I specify target positions and basically the necessary force to reach that position gets added?
Millenium Project Enterprises - Hobbyist Gamedev Group http://www.mpe-online.org
Walkover is now on Steam => http://store.steampowered.com/app/348700/
User avatar
Marc
 
Posts: 281
Joined: Sun Mar 14, 2004 4:07 pm
Location: Germany

Re: Optimize Marc's Character Controller / Batching Convex C

Postby Julio Jerez » Sat Sep 08, 2012 7:28 am

the kinematic body just add orce to oteh bodies. by they do no ove by forceces they move by setting the velocity, or also byt teleporting them.
do not worry when I made the demo it will be more clear
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Optimize Marc's Character Controller / Batching Convex C

Postby Marc » Sat Sep 08, 2012 10:16 am

ok. so just tell me if I can be of any assistance with the character controller. :)
Millenium Project Enterprises - Hobbyist Gamedev Group http://www.mpe-online.org
Walkover is now on Steam => http://store.steampowered.com/app/348700/
User avatar
Marc
 
Posts: 281
Joined: Sun Mar 14, 2004 4:07 pm
Location: Germany

Previous

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron