Jump to content
KTyJLXy

Chain physics

Recommended Posts

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? smile.png

Share this post


Link to post

Can you be little more specific, please? How do i implement ball joint mechanic in the leadwerks? blink.png

(Sorry if that questions is kinda stupid...)

Share this post


Link to post

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? mellow.png

Share this post


Link to post

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 :)

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...