Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Add friction into pivot
Started by prographodeveloper Dec 04 2018 08:57 AM

3 replies to this topic

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

prographodeveloper

[GLOBAL: userInfoPane.html]
prographodeveloper
  • Contributor

  • 281 posts
  • Corona SDK

I have a pivot which attaches a dynamic object to a static point. The dynamic object is a rectangle. It is attached at one end. Gravity is on. I start the rectangle vertically. When everything starts it swings. This is correct.

It slows down over time. This is also correct. But how can I apply extra friction to the joint so that it slows down quicker. The thing is still swinging away after 3 minutes.



[TOPIC: post.html]
#2

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,380 posts
  • Corona SDK

You can't apply friction to the pivot joint.

 

You can add linear damping to the rectangle (since it is swinging off-center).  That will achieve your goal.


  • prographodeveloper likes this

[TOPIC: post.html]
#3

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,380 posts
  • Corona SDK

  Best Answer

https://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2018/12/swingDamping.zip


  • prographodeveloper likes this

[TOPIC: post.html]
#4

prographodeveloper

[GLOBAL: userInfoPane.html]
prographodeveloper
  • Contributor

  • 281 posts
  • Corona SDK

Perfect. Brilliant.




[topic_controls]
[/topic_controls]