Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (AndrewAMD, alibaba, Konsti, 2 invisible), 1,418 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Enabling physics on bones? #133120
06/01/07 22:24
06/01/07 22:24
Joined: May 2007
Posts: 5
Vision Offline OP
Newbie
Vision  Offline OP
Newbie

Joined: May 2007
Posts: 5
I am wondering if it is possible to enable physics on a bone or series of bones, from my understanding of the physics can be enabled on one entity, but not its underlying bones structure?

If this is possible, an example of how to go about doing this would be greatly appreciated.

Re: Enabling physics on bones? [Re: Vision] #133121
06/02/07 11:26
06/02/07 11:26
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Yes, you can.

As you said, you "normally" enable ONE entity to be controlled as physics entity. Now, if you want to enable a bone skeleton, you have to re-create the bone structure first. That means, you translate the bone setup into a hinged physics structure. You create first all bone nodes (as boxes or spheres) at the bone positions. Then you connect them one by one as it is defined in your characters bone-skeleton layout.

After recreating the skeleton, you have to disable the whole physics skeleton first. When you want to enable bone physics on your character you have to move the bone simulation first into the appropriate position (circumstanced by character position and animation frame). After posing, you enable physics and disable the whole (scripted) character control (which would affect movement and animation, etc.). While the physics skeleton is being "active", you would run a additional routine that checks the physics skeleton and its node positions. In each frame you have to reset the model and move each bone (beginning at the base-bone, because all others are affected) to the related physics node entity of the physics skeleton.

The whole thing is relatively easy compared to the bone movement and rotation, because bones are driving me mad - remember that each bone (no matter which position it has and which rotation has a 0,0,0 rotation and a 0,0,0 position when resetted. This is absolutely weird and makes everything more complex as it has to be.

I hope you got the idea.

Re: Enabling physics on bones? [Re: HeelX] #133122
06/03/07 01:04
06/03/07 01:04
Joined: Sep 2002
Posts: 8,177
Netherlands
PHeMoX Offline
Senior Expert
PHeMoX  Offline
Senior Expert

Joined: Sep 2002
Posts: 8,177
Netherlands
Quote:


The whole thing is relatively easy compared to the bone movement and rotation, because bones are driving me mad - remember that each bone (no matter which position it has and which rotation has a 0,0,0 rotation and a 0,0,0 position when resetted. This is absolutely weird and makes everything more complex as it has to be.




It's easier when you work with the kind of animation cycle the character goes through, instead of trying to match everything to the exact correct angles.

I don't know in which cases you use the physics on bones, but usually you won't even notice a slightly wrong 'morph' into physics entities when the player get's blown up and the body moves accordingly into the air or when shot back because of a shotgun burst.

There are a few key positions you have to figure out doing. Obviously a crouched enemy or player that needs ragdoll physics effects can't suddenly be standing upright the moment the physics become active and then go down using physics after being killed.

I'd really like the angle thing to change though, it does make things uncomfortable,

Cheers


PHeMoX, Innervision Software (c) 1995-2008

For more info visit: Innervision Software
Re: Enabling physics on bones? [Re: PHeMoX] #133123
06/03/07 07:46
06/03/07 07:46
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Yes, of course, if you have two or three "ignition poses" for such a morph will be sufficient enough in most cases.

Last edited by HeelX; 06/03/07 07:46.
Re: Enabling physics on bones? [Re: HeelX] #133124
06/08/07 21:50
06/08/07 21:50
Joined: May 2007
Posts: 5
Vision Offline OP
Newbie
Vision  Offline OP
Newbie

Joined: May 2007
Posts: 5
Thank you for the resposes, luckily I am not trying to enable these physics on a parental tree, but rather a tank with many moving parts.

Heelx, I was a little confused by your respose as well, are you suggesting to create another completely seperate bone structure to enable physics control on, aside from the player controlled skeleton which I currently have effecting the mesh animations? It made sense for me to do them all in one fell swoop.

Re: Enabling physics on bones? [Re: Vision] #133125
06/09/07 11:33
06/09/07 11:33
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Quote:

Thank you for the resposes, luckily I am not trying to enable these physics on a parental tree, but rather a tank with many moving parts.




Uhm, you should have said this before. What do you mean with this exactly?

Quote:

.. are you suggesting to create another completely seperate bone structure to enable physics control on, aside from the player controlled skeleton which I currently have effecting the mesh animations?




The bone skeleton is used for animations yet and cannot be used as primary source for physics. So, to enable physics on a boned entity, you have to "rebuild" a unique skeleton, which fits the bone structure of the entity.

Re: Enabling physics on bones? [Re: HeelX] #133126
06/09/07 19:05
06/09/07 19:05
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
...by "rebuilding" the skeleton he means creating models to represent the bones, not actually creating another skeleton on the same model


xXxGuitar511
- Programmer
Re: Enabling physics on bones? [Re: xXxGuitar511] #133127
06/15/07 08:37
06/15/07 08:37
Joined: May 2007
Posts: 5
Vision Offline OP
Newbie
Vision  Offline OP
Newbie

Joined: May 2007
Posts: 5
So I ended up rerigging this thing, and after enabling physics, and getting this tank up and running/driveable, i see how you can not use the physics to effect the bones to then effect the mesh. Hope that made sense.

I guess I want to take this a little further which is leaving me no other option than to fake it, so after digging around for a bit, I cant seem to find a way to pull in a bones location from the world and adjust it accordingly? Is this even possible? Or adding additional collision boxes to bones or seperate parts of a single mesh, or is it only one per entity.

Re: Enabling physics on bones? [Re: Vision] #133128
06/15/07 09:00
06/15/07 09:00
Joined: Apr 2006
Posts: 136
San Francisco
T
Tor Offline
Member
Tor  Offline
Member
T

Joined: Apr 2006
Posts: 136
San Francisco
I'm 90% certain collision is only a per entity basis. The other 10% requiring some serious hack workaround.

PS. I'm in the same boat as you right now. Gave up on trying to implement a .dll implementation of my network coode... and I'm just boot strapping it into my project raw. See ya tomorrow in class!


"Towlie, you're the worst character ever." I know...
Re: Enabling physics on bones? [Re: Vision] #133129
06/15/07 15:39
06/15/07 15:39
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
As I said, you cannot enable physics on "bones" - you have to emulate it!

Bones positioning: when you reset an entity with its bones, each bone has a position of 0,0,0. This means: to determine the actual bone position you..

  • take the relative vector from the origin to the bone (maybe you have to scale it acordingly to the entity's scale)
  • rotate this vector with the entity's pan
  • and add to this vector the origin of the entity
  • now calculate the difference vector from the bone to the target
  • divide the length through the uniform scale of the entity
  • rotate the vector with the negative rotation of the entity


THIS vector result will be the offset you ADD to the bone so that the bone will be placed at the desired global position in space.

Hope, that helps you.

Cheers - Christian


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1