I am trying to build a series of creatures with Tentacles that move, and their force will propel my creatures. I need either forward or inverse kinematics for this, not sure which, I am thinking it is forward as the main “muscles” of the creatures are closer to their body. I have not been able to find any code on the forum that points to a usable IK solver, that has been translated.
My tentacles have 20 bones each.
Has anyone on here translated the code of something like fik.js to PC yet?
Can anyone point me to an example that has been built in here?
@will is there anywhere I can find this in your examples?
This mathematics is definitely over my head, and sadly I am the only programmer working in this at my firm, so I can’t bounce ideas off anyone else here.
With not a lot of fun. Joints are not exposed in PlayCanvas but are part of ammo.js and therefore accessible. Will’s ragdoll project is the best example I know of that shows how it can be used. https://playcanvas.com/project/431888/overview/ragdoll
@yaustar I looked at that actually. Unfortunately there is little to no commenting in the code so I am having to guess at what he is doing, rather than being able to understand his thinking. I was hoping to implement what he is doing and translate it to deforming the skinInstance bones.
With all the wonderful features that PC has, I am surprised that they don’t have Kinematics built in, in such a way that it can be applied to bones.
The bullet documentation (ammo is a JS compiled port of the bullet physics engine) is not great on the details for joints either. It took me a week to figure out the settings to get right for the ragdoll in Virtual Voodoo.
However, Will’s code will make more sense after reading the documentation and example code from bullet.
Re skinning: I was thinking you might be able to update the bone transformations every frame from the physics rigidbody.
Edit: actually, I need to take another look at the ragdoll, I vaguely remember it being skinned as well.
still have the issue where the physics is not on a separate worker right? so it becomes slow, especially when there is a lot of stuff to render and also rigidbody sometimes falls through certain polygons
Physics is still single threaded which is unfortunately common in web physics engines. At the moment, most web games avoid using full on physics simulation libraries and rely on collision detection (ie no forces, resolving etc) which is much faster.
As for rigid bodies travelling through each other, I have only seen this on fast moving and/or small objects and can be mitigated by enabling CCD.