Jump to content

Physics advice please


Alienhead
 Share

Go to solution Solved by Josh,

Recommended Posts

Greetings,  I've since resumed my original project 'defendTHSI!' and I find myself faced with a physics dilemma. I've never been one for deep physics implementation, always just enough to get by with what was needed at the time so my skill in physics development pretty much stayed at a moderate to low understanding.   

Until now...   I've been developing my skill in physics over the past 6 months and I've enjoyed and marveled at what Leadwerks is capable of.  My current situation requires me to develop a bobble-head type effect.  The screenshot will illustrate what I'm trying to do.  This model is a non-animated static model, its a bobble head with a skeleton ontop.. I wish have the attaching arm and the head bobble as bobble heads do. :) 

So far Ive tried numerous configurations but I'm yet to achieve what I'm after.   My question is the order of the physics pieces.  The picture shows my latest configuration and it's as close as I have come to getting it right but it is still way off from acting like a true bobble head.

Can any physics minded person point me in the direction I need to go to get this type of effect. ? 

exp:   ( https://www.presentermedia.com/powerpoint-animation/bobble-head-figure-pid-10808 )

I'm using the kinematic as my base, for position and rotation without breaking the physics,  the hinge to monitor restraints and the ball to apply the motion effect..   but this does not seem to be correct.

I've pretty much transitioned my entire project over to all physics based reactions, I've got controllers built for drone, 1st, 3rd person, tanks, planes, helicopters, ceiling fans and more...   but this one I cannot get right and it's bugging the *** out of me lol.

ss.png

Link to comment
Share on other sites

  • Solution

I can't say for sure if this will work in Leadwerks, but in Ultra you can add a spring to a hinge joint:
https://www.ultraengine.com/learn/Joint_SetSpring?lang=cpp

You could create a hinge that rotates left and right, and then on the child entity add a hinge that rotates forward and back, with a spring on both. This would act like a ball joint with no twisting.

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

Since I'm diving deep into the physics scene, I've got one more question..   In the screenshot, I have physicsdebug on.  I need to know if theres a way to check the state of a physics object? Like in the picture the engine colors the active state orange and the sleeping state blue..  What method is available to detect the objects state in code. 

ty !

col.png

Link to comment
Share on other sites

  • 1 month later...
On 11/24/2022 at 12:11 AM, Josh said:

There is entity->body->Active() but it's only in C++. If GetVelocity() returns (0,0,0) that might be about the same thing.

And that GetAngularVelocity() returns (0,0,0) too I guess.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

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.

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.

 Share

×
×
  • Create New...