KTyJLXy Posted March 9, 2014 Share Posted March 9, 2014 Sup guys, long time no see. I've just wanted to know, if there anyway to get chain physics for the model? For swinging things around on the end of that chain, you know, all that stuff. I can't think of any good method to do this. Any tips? Quote Link to comment Share on other sites More sharing options...
shadmar Posted March 9, 2014 Share Posted March 9, 2014 Ball joints Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
KTyJLXy Posted March 9, 2014 Author Share Posted March 9, 2014 Can you be little more specific, please? How do i implement ball joint mechanic in the leadwerks? (Sorry if that questions is kinda stupid...) Quote Link to comment Share on other sites More sharing options...
Josh Posted March 9, 2014 Share Posted March 9, 2014 Here's an example: http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/joint/jointball-r732 A chain would just be several of these joints in a row. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
KTyJLXy Posted March 9, 2014 Author Share Posted March 9, 2014 Here's an example: http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/joint/jointball-r732 A chain would just be several of these joints in a row. That helps, thanks a lot Quote Link to comment Share on other sites More sharing options...
KTyJLXy Posted March 10, 2014 Author Share Posted March 10, 2014 So, i'm trying to make Joint:Ball script and so far i have joint script: Script.parent = nil --entity Script.child = nil --entity Script.position = self.model:GetPosition --Vec3 function Script:Start() App:Joint(self.position, self.child, self.parent) end And app function for creating joints: function App:Joint(parent_position, child, parent) joint = Joint:Ball(self.parent_position, self.child, self.parent) end All it does now - just crashes the game. What i did wrong? Quote Link to comment Share on other sites More sharing options...
Guppy Posted March 11, 2014 Share Posted March 11, 2014 based on the code you posted Im guessing that 'Script.position' is nil - it refers to "self.model" which isn't set in the code snippet you posted also function App:Joint(parent_position, child, parent) joint = Joint:Ball(self.parent_position, self.child, self.parent) end Assuming that lua is like most other OOPs "self" is a pointer to the object instance meaning that self.child != child meaning that you call Join:Ball with (nil,nil,nil) that seems likely to cause a crash even if self.model is defined Quote System: Linux Mint 17 ( = Ubuntu 14.04 with cinnamon desktop ) Ubuntu 14.04, AMD HD 6850, i5 2500k 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.