Genebris Posted August 8, 2014 Share Posted August 8, 2014 I have made a rope model and attached bones to it, I can properly move bones in the editor, but when I add mass for one of the bones, this part of the rope simply disappears. How can I make bones act like props so I could connect them with ball joints? Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted August 8, 2014 Share Posted August 8, 2014 You need to set a mass as well as a shape. 1 Quote Link to comment Share on other sites More sharing options...
Genebris Posted August 8, 2014 Author Share Posted August 8, 2014 You need to set a mass as well as a shape. But when I delete shape of the barrel (set it to none), it still falls down like a normal prop. but it doesn't collide with anything. Ok, how can I set a shape to bone? I didn't manage to do this with "Fit shape" button or with .phy file. Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted August 8, 2014 Share Posted August 8, 2014 What Barrel? Personally I wouldn't do it this way, because the bones are all part of the same model. If a bone moves, it might affect its children as well, causing glitchy physics. I would start of with creating a pivot in the scene which is the rope anchor. The pivot has no mass or phy shape Then place a cylinder underneath it. the cylinder has a shape and a mass. Then via a script create a ball joint between the pivot and the cylinder. 1 Quote Link to comment Share on other sites More sharing options...
Genebris Posted August 8, 2014 Author Share Posted August 8, 2014 If make a few cylinders and connect them with joints there will always be a small gaps between those cylinders while rope is moving. Here is physics tab of the barrel: http://i.imgur.com/awoIvkh.png And here is bone: http://i.imgur.com/SRpfdax.png When I launch the game barrel falls down through the terrain and bone with the part of the rope mesh simply disappears. Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted August 8, 2014 Share Posted August 8, 2014 What is the function of the barrel in all this? Every individual bone needs a shape. You can make your own phy file or press git shape and adjust the rotation and size by hand. Turn on physics view in the view tab to see what the results are. 1 Quote Link to comment Share on other sites More sharing options...
Genebris Posted August 8, 2014 Author Share Posted August 8, 2014 Barrel is just an example of normally working prop without any collision shape. I can't understand why bone doesn't work like the barrel. I can't set any shape to the bone. When I press Fit shape on the rope mesh it works and orange parallelepiped appears, when I load a .phy file for this mesh it works as well and orange box appears too. But when I fit shape or load the same shape file for the bone, nothing happens. I can't apply shape to bones from another model I previously created as well. It seems like bones can't have shapes. Maybe I can use simple meshes instead of bones? Can I attach rope's skin to other meshes instead of bones? Quote Link to comment Share on other sites More sharing options...
YouGroove Posted August 8, 2014 Share Posted August 8, 2014 What you could do is to move and rotate each vertex groups of your ropes skins to each Ball joint position and rotation. How to get vertex groups in LE3 ? I put some simple physics joint example project for you to download, you can doownload and test it (just follow the ReadMe File) export joint.zip 1 Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Genebris Posted August 8, 2014 Author Share Posted August 8, 2014 So I need to take bottom polygon of the first cylinder and move it to the position of the pivot between first and second cylinder? Then I need to set rotation of this polygon to pivot rotation and then I need to do the same with top polygon of the second cylinder? Haha, smart! I'll try this, thank you guys for helping. Quote Link to comment Share on other sites More sharing options...
YouGroove Posted August 8, 2014 Share Posted August 8, 2014 Just try my example, each cylinder has a pivot object as child, it uses it to position the joint ball to the parent object. I'm trying right now to make follow the rotation of joints to a rope model with bones, i will post results if things come up good. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Genebris Posted August 8, 2014 Author Share Posted August 8, 2014 Ah, you mean using this blue cylinders as bones? That's even cooler, I'll try this tomorrow. Quote Link to comment Share on other sites More sharing options...
YouGroove Posted August 8, 2014 Share Posted August 8, 2014 I made some example, i make bones top rotate as same as cylinders. The probelm is rotation applied on bones is weird, perhaps some GetRotation or SetRotation issue. At start the bones are ligned horizontally while cylinder are vertically aligned with no rotation ? I put the updated project for anybody to test. export jpint.zip 1 Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Genebris Posted August 8, 2014 Author Share Posted August 8, 2014 I found that default rotation of bones (when rope is vertical) isn't (0,0,0). Probably needs to be fixed in blender to match default rotation of blue cylinders. I'll play with this tomorrow. Quote Link to comment Share on other sites More sharing options...
YouGroove Posted August 8, 2014 Share Posted August 8, 2014 It's not a Blender problem. (Just need an animated material to have it animated in LE3 otherwise it won't animate even rotating bones) I used GetOmega and SetOmega to set speed rotation on Y to 0 as we don't care about it for a vertical rope, this helps a lot in stability. In the script i also changed Z rotation values by adding -90° so the rop is vertical, now i got the rope working good, i just need to tweak some rotation axe and it will be ok. Don't worry, i'll post that on tutorials section. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
YouGroove Posted August 8, 2014 Share Posted August 8, 2014 Physic ropes or cables are easy to make. Will be in tutorial section. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
YouGroove Posted August 9, 2014 Share Posted August 9, 2014 The download and tutorial http://www.leadwerks.com/werkspace/page/tutorials/_/artwork/physics-rope-r113 Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Genebris Posted August 9, 2014 Author Share Posted August 9, 2014 There doesn't seem to be a download button in tutorial. Quote Link to comment Share on other sites More sharing options...
YouGroove Posted August 9, 2014 Share Posted August 9, 2014 I used wrong button, download is ready now. (feel free to delete the function postRender on rope.lua script as it was debug code) Cylinders for physics are not so good , the really best would be to use capsule shapes collisions instead , it would avoid collision problems near center of the joints between two capsules. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Genebris Posted August 9, 2014 Author Share Posted August 9, 2014 Everything works well, thank you! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.