|
| 12 May 2011 01:33 PM |
like you have a part.
with some funcitons, you could: -get all other parts belonging to that body -get mass center of body -get velocity/rotvelocity/force of body -set velocities/rotvelocities/force of body
Because we cant trust all parts of a moving body to be in a single model (and that there is no sub-models, wich make it 10x harder...), and using the model to get the parts fails if some of the parts have been blown up :P
Also the set/get forces stuff would be useful because the body____ objects dont always do exactly what we want and theyre glitchy because telamon propably coded them...
Uses: -Me getting my realistic-ish wing object work properly (yay aerodynamics) -Sinking ship stuff and that -Stuff like rocket boosters, cars and such. (body objects hard to use to apply force/velocity accurately or exactly how you want) -Getting all parts of a body, for example to count mass of body, recolor the body, or "save" the body so you can regen it (i did this once but it was annoying to make because of having to iterate through the jointsservice a million times each time i wanted to save the body...) -Fancy stuff
._. |
|
|
| Report Abuse |
|
|
|
| 12 May 2011 02:38 PM |
| Objects like diamonds and corner wedges? :| |
|
|
| Report Abuse |
|
|
sncplay42
|
  |
| Joined: 27 Nov 2008 |
| Total Posts: 11891 |
|
|
| 12 May 2011 02:42 PM |
| I'd also like to have some way of finding all the joints connected to a part, and events for when joints get added or removed. |
|
|
| Report Abuse |
|
|
| |
|
|
| 12 May 2011 02:51 PM |
Use all the snaps and welds and motors and hinges and MotorPs and MotorV's and glues and etc. etc. and you'll get the entire mass of it.
They need better physics overall, really. |
|
|
| Report Abuse |
|
|
sncplay42
|
  |
| Joined: 27 Nov 2008 |
| Total Posts: 11891 |
|
|
| 12 May 2011 02:51 PM |
| I mean, the engine must be tracking that somewhere, right? |
|
|
| Report Abuse |
|
|
|
| 12 May 2011 03:09 PM |
@sncplay42 function GetJoints(part) local welds={}; for i,v in pairs(game.JointsService:GetChildren()) do if v.Part0==part or v.Part1==part then table.insert(welds, v); end end return welds; end |
|
|
| Report Abuse |
|
|
sncplay42
|
  |
| Joined: 27 Nov 2008 |
| Total Posts: 11891 |
|
|
| 12 May 2011 03:10 PM |
| That just seems so inefficient. D= |
|
|
| Report Abuse |
|
|
|
| 14 May 2011 06:13 AM |
| Scanning the jointsservice works if you have like 5 parts or rarely need to get the body, but you pretty much need to go thru all welds for each part and do some other checks too so the thing wont discover already found parts... |
|
|
| Report Abuse |
|
|
|
| 20 Mar 2013 05:23 PM |
| I know this is digging up an old grave, but another thing that can be done is to do the JointsService check at the beginning, and then just use childadded and childremoved from that point forward to check for new parts. In the childremoved, you may need to do the original check again. |
|
|
| Report Abuse |
|
|
Aerideyn
|
  |
| Joined: 16 Jan 2010 |
| Total Posts: 1882 |
|
|
| 20 Mar 2013 06:00 PM |
| You are simulating aerodynamics? Well - just wait until you try to make it work online, there be dragons. |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
| |
|