HowTo: Additional Joints

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

HowTo: Additional Joints

Postby Carli » Sat May 29, 2010 2:34 am

Hi,

I need some additional joints and wonder how to implement them.
What is the general way to implement a user joint?
Do I just have to implement some AddForce calls in a Joint Callback?

I need the following things:
- A Basement/Root joint for plants and buildings that I don't want to integrate into the scene itself (tree choping, new buildings?)
- A Joint that just pulls one body to the other without affecting the other one (i know, unrealistic, but it's wished for my game engine)
Carli
 
Posts: 245
Joined: Fri Oct 02, 2009 5:28 am

Re: HowTo: Additional Joints

Postby Carli » Sun May 30, 2010 11:02 am

What would be the best way to implement such behaviour?
Carli
 
Posts: 245
Joined: Fri Oct 02, 2009 5:28 am

Re: HowTo: Additional Joints

Postby Julio Jerez » Sun May 30, 2010 1:07 pm

If you wan to mak weyor own joint,
My suggestion is to start simple, look at the custome joint folder and check out teh simpel jpint
Ball and sockect, or hinge and then form there you can try your own ideas.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: HowTo: Additional Joints

Postby Carli » Sun May 30, 2010 1:38 pm

Hm,
does a custom joint require a C++ interface or can I use the joint callbacks?
My problem is that when I now write parts of the code in C/C++, I need to compile this additional joint code for each platform (in the moment 3 ...)
Carli
 
Posts: 245
Joined: Fri Oct 02, 2009 5:28 am

Re: HowTo: Additional Joints

Postby Julio Jerez » Sun May 30, 2010 3:55 pm

Just like the Newton.lib teh cuntom jopint also have a c inteface in file JointLibrary.h
with that you can make your own Joint on any language.

If a function is not provided then you will have to write in CPP in the library and expose and inteface using the
JointLibrary.h and JointLibrary.cpp file.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: HowTo: Additional Joints

Postby Stucuk » Sun May 30, 2010 4:43 pm

Since your using Pascal you could look at the 1.53 Pascal Joint Library Joints header to get an idea of how it works. Noone has of yet written a Pascal version of the 2.0 Joint Library Joints, but the main stuff seems to be the same.
User avatar
Stucuk
 
Posts: 801
Joined: Sat Mar 12, 2005 3:54 pm
Location: Scotland

Re: HowTo: Additional Joints

Postby Carli » Tue Jun 01, 2010 2:46 am

OK.

any Idea how to get an object "stiff"?
I need the following things:
- A Basement/Root joint for plants and buildings that I don't want to integrate into the scene itself (tree choping, new buildings?)


i could just turn the mass matrix to 0,0,0,0 and when the tree is chopped, I can reset it to the old values.

In the moment, buildings are implemented as one object as a basement and one object the house, both connected via 2 ball joints.
I know, that's not good, but joining collisions to a new compound collision does not fit into the concept of "one body has one model" (that is sent via network)

An other problem:
what if the ground under the tree is blowed away?
The tree would not fall down, so I would have to watch the "is there ground under my roots" every frame. (or is there a better way than setting massmatrix to 0,0,0,0?)
Carli
 
Posts: 245
Joined: Fri Oct 02, 2009 5:28 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron