Newton Dynamic Physics Integration

Programming Reality Factory and Genesis3D.
User avatar
paradoxnj
RF2 Dev Team
Posts: 1328
Joined: Wed Mar 01, 2006 7:37 pm
Location: Brick, NJ
Contact:

Post by paradoxnj » Thu Dec 06, 2007 8:54 pm

Of course the problem is then to decide which geometry is models and which not
geWorld_GetNextModel() is exactly for that. It enumerates the world models. Check out Genesis.h.

User avatar
federico
RF Dev Team
Posts: 443
Joined: Tue Jul 05, 2005 3:14 pm
Contact:

Post by federico » Thu Dec 06, 2007 11:26 pm

I tried a move a while ago to isolate the models containing the water flag from the others, and then exclude those from the creation of the treecollision mesh for the physics background collision, but it didn't worked. The datas are taken from the well-know sirkorgan's function that strips and defans the bsp data to retrieve a list of indices and vertex that compose the geometry triangles. Though the sirkorgan 's function makes his work on all the level geometry, I wasn't able to restrict the computation. I hope that the source release can make other programmers solve the issues and extend the features.

User avatar
fps
Posts: 504
Joined: Mon Sep 26, 2005 9:54 pm
Location: in a magical land devoid of hope, happiness, and sanity.

Post by fps » Thu Dec 06, 2007 11:54 pm

my dream of physics controlled pickups is realised! yay
Attachments
screen0001.gif
my helmet texture is broken, and its too big. but thats a nice rifle!
screen0001.gif (63.89 KiB) Viewed 1234 times
1 wrote:
for the internet is a cruel and dark place at times, and there's sex and blood everywhere.

2 wrote:
You say that like it's a bad thing.

1 wrote:
You are a bad thing.

User avatar
paradoxnj
RF2 Dev Team
Posts: 1328
Joined: Wed Mar 01, 2006 7:37 pm
Location: Brick, NJ
Contact:

Post by paradoxnj » Fri Dec 07, 2007 3:26 pm

Federico, have you looked at the source for GTest? GTest uses physics entities on the world, maybe you can leverage that code?

When you release the source, I will have a look and see if I can implement it.

User avatar
federico
RF Dev Team
Posts: 443
Joined: Tue Jul 05, 2005 3:14 pm
Contact:

Post by federico » Fri Dec 07, 2007 5:54 pm

@fps
Are you using the physics-driven attribute entity?
I think you are :twisted: yeah!!!

@paradoxnj
I implemented the genesis physics before the newton one. It's extremely empty. There's no collision detection for shape (you have raycast the collision or use the AABB bBox), you have to code the force and torque reaction (to collision, to friction, to all). Pratically the physics object is a structure that stores datas and nothing else. The point would be to "fill" the physics object using the newton calculation. It doesn't seem so easy but it's surely possible. In this way the world models would become newtonBodies with a convex shape (box sphere cylinder...etc..) but still they must be excluded in some way from the sirkorgan's function that retrieves the indices of bsp triangles and vertices.

I hope to release the code this week: right now I'm extending the scripting part, trying to fix some annoying bugs.

User avatar
federico
RF Dev Team
Posts: 443
Joined: Tue Jul 05, 2005 3:14 pm
Contact:

Post by federico » Sat Dec 08, 2007 9:00 pm

Just finishing the script commands for the first release. We have commands to create bodies, joints and materials. We can apply forces via script and get positions and rotations of the physical object. You can break a joint via script command. Fixing the last bugs and re-packing the demos... :wink:

User avatar
fps
Posts: 504
Joined: Mon Sep 26, 2005 9:54 pm
Location: in a magical land devoid of hope, happiness, and sanity.

Post by fps » Sun Dec 09, 2007 2:06 am

yes i am using the attribute, it is so cool. a box will fall, a gun will land on it but overhang. another box lands on the end of the gun and catapults it into the air flipping end over end. its soo cool.


just a quick question.
what happens if you try to break joins on a single model, like a ragdoll.
does it just strech the polygons out to the seperated part like a bad animation? What if the body parts were not really connected in the model?
1 wrote:
for the internet is a cruel and dark place at times, and there's sex and blood everywhere.

2 wrote:
You say that like it's a bad thing.

1 wrote:
You are a bad thing.

User avatar
fps
Posts: 504
Joined: Mon Sep 26, 2005 9:54 pm
Location: in a magical land devoid of hope, happiness, and sanity.

Post by fps » Sun Dec 09, 2007 2:10 am

heres some more!
Attachments
Untitled.jpg
MOAR WEAPONZ!
(46.19 KiB) Downloaded 10 times
screen0001.jpg
MOAR PHYSAX!
screen0001.jpg (47.41 KiB) Viewed 1188 times
1 wrote:
for the internet is a cruel and dark place at times, and there's sex and blood everywhere.

2 wrote:
You say that like it's a bad thing.

1 wrote:
You are a bad thing.

User avatar
federico
RF Dev Team
Posts: 443
Joined: Tue Jul 05, 2005 3:14 pm
Contact:

Post by federico » Sun Dec 09, 2007 11:22 pm

yeah! finally someone playing with the physics like me. Thanks fps. :wink:
You should try to define the Shape of the grenade as "Cylinder 0" (instead of "Box 0"). i think you could love it...
what happens if you try to break joins on a single model, like a ragdoll.
does it just strech the polygons out to the seperated part like a bad animation? What if the body parts were not really connected in the model?
yes the body part will stretch the polygons. There's a way to implement a breakable ragdoll (gta3 style) but I won't implement it. From my side (I mean: the development side) it would be a step backward: the point here was to have a standard right-scaled ragdoll for the collision while having your actor stretch his bone over the ragdoll bodyparts.

User avatar
vrageprogrammer
Posts: 566
Joined: Wed Oct 31, 2007 2:59 pm
Location: On top of a tree
Contact:

Post by vrageprogrammer » Mon Dec 10, 2007 7:48 am

federico wrote: a breakable ragdoll (gta3 style) but I won't implement it.
wouldn't a breakable ragdoll be better?
i meab gta had that feature and it was great....

@paradoxnj-
implement the souce in Jet3d?
that would be cool! :shock:
It was not Possible to determine the dimensions of the image....

User avatar
paradoxnj
RF2 Dev Team
Posts: 1328
Joined: Wed Mar 01, 2006 7:37 pm
Location: Brick, NJ
Contact:

Post by paradoxnj » Mon Dec 10, 2007 2:54 pm

@paradoxnj-
implement the souce in Jet3d?
that would be cool!
It's already there and has been there for quite some time. It's part of the new codebase.

User avatar
fps
Posts: 504
Joined: Mon Sep 26, 2005 9:54 pm
Location: in a magical land devoid of hope, happiness, and sanity.

Post by fps » Mon Dec 10, 2007 5:39 pm

I think breakable ragdolls would be fun too but lets get one thing done at a time.

I did try making the genade a cylinder but for some reason the parameters of the grenade came out sideways, i could just rotate the actor in the model intead of having to mess with it all the time.
it's kind of wierd though. it lands on its end like it should but then it rolls end ove end.
another question, is there a Triangle 0 or somting to that effect?

thanks,
fps
1 wrote:
for the internet is a cruel and dark place at times, and there's sex and blood everywhere.

2 wrote:
You say that like it's a bad thing.

1 wrote:
You are a bad thing.

User avatar
federico
RF Dev Team
Posts: 443
Joined: Tue Jul 05, 2005 3:14 pm
Contact:

Post by federico » Tue Dec 25, 2007 1:35 pm

Sorry to let you all wait guys.
work... flu... more work ....and more flu....

I will release the code in theese days exactly "as is". Much new features are only prototyped and some others cause crashing, but the basics are here: I mean all the features of the Alpha1 release bugfixed, made stable and faster (thanks to the new Newton BETA library). I think you deserve to see the improvements and test them in your home machine.

@fps
About the features, I think there should be a rule of work. I can't implement this feature because someone wants to have a fancy effect in a game without thinking logically at the code and at the engines. Do you really need the physics engine? Can't you to fake it? Ask yourself those questions, because a physics engine is an heavy thing that makes your game heavier and heavier. We have to mix the genesis effects with the physics engine to fake reality, not trying to simulate all we want in our scenes.
The point of all the work on ragdolls was to have a "skinned ragdoll". Now I can't go back. So, no, in my opinion a breakable ragdoll wouldn't be better. sorry...
Cylinders are created and posed through the X axis. Orient your actors in the same way. Then reorient the entity in the editor.Take a look at the barrels of my demos (entities and actors) :wink:

User avatar
fps
Posts: 504
Joined: Mon Sep 26, 2005 9:54 pm
Location: in a magical land devoid of hope, happiness, and sanity.

Post by fps » Wed Dec 26, 2007 8:58 pm

Its allright, i understand. I believe i can fake it.
I have some more screens. this time i replaced some of the other weapon models. I had some spare time, and i'll use them later.
for some reason I cant upload anymore. it says "Sorry, you have reached your maximum Upload Quota Limit of 1 MB".
how do i fix that?
Sorry to hear that you have been sick.
merry christmas!
1 wrote:
for the internet is a cruel and dark place at times, and there's sex and blood everywhere.

2 wrote:
You say that like it's a bad thing.

1 wrote:
You are a bad thing.

Post Reply