Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Joints without physics
Started by hasty Jun 28 2019 11:47 AM

1 reply to this topic

Best Answer sporkfin , 28 June 2019 - 02:38 PM

Enterframe listeners can be pretty efficient and even elegant depending on how you structure them.

You will want to adjust the anchors points as well so the limbs rotate correctly with regard to the torso.

 

 
local function jointAction()
    --adjust x/y position with regard to the torso
    --adjust rotation
end
 
Runtime:addEventListener( 'enterFrame', jointAction )
 

 

 

[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

hasty

[GLOBAL: userInfoPane.html]
hasty
  • Contributor

  • 189 posts
  • Corona SDK

I'm wondering how to go about creating joints without the physics library? For example, to create an arm that remains attached to a character's torso, but can rotate independently. I imagine I could achieve this using an enterframe listener, but I feel there must be a more elegant solution?



[TOPIC: post.html]
#2

sporkfin

[GLOBAL: userInfoPane.html]
sporkfin
  • Contributor

  • 588 posts
  • Corona SDK

  Best Answer

Enterframe listeners can be pretty efficient and even elegant depending on how you structure them.

You will want to adjust the anchors points as well so the limbs rotate correctly with regard to the torso.

 

 
local function jointAction()
    --adjust x/y position with regard to the torso
    --adjust rotation
end
 
Runtime:addEventListener( 'enterFrame', jointAction )
 

 

 




[topic_controls]
[/topic_controls]