This is Pele, my new rendering library for diagrams and charts, compatible with the latest Mermaid syntax.
- 100-500× faster than mermaid.js
- 6× smaller bundle
- No dependencies
- Easy to theme
- Responsive to device width
In pursuit of making Obsidian insanely fast and cohesively designed, I always found the Mermaid library to be too big, too slow, and too hard to theme. Pele will be the new renderer in the next version of Obsidian, but you can start using it now.
Pele [ˈpɛlɛ] is named after the goddess of volcanoes and fire. It's open source under the MIT license. Try the playground!
Some tips:
- Limit the pelvis INTENDED direction within some angle of the aim direction, and force it to turn no matter what if it exceeds this.
- Force the feet to stay within a reasonable range of this pelvis direction, if they start to leave it, rotate them in place updating their locked spot.
- Angle the visible pelvis bone to a blend between the left foot and right foot angles. EG half way between the two feet whatever the feet are doing. Rule #1 protects this from being a problem. Do this with a soft interp (eg spring interpolation).
- When walking sideways; angle the lead foot more than the other (walking right, right foot faces the direction of movement more so); it opens up the legs and avoids intersections, and looks more natural.
- When a foot is in swing phase, return it to it's relaxed local rotation (eg. currently looks like the foot is basically kept flat, even if the lower leg is horizontal).
- You've got an acceleration based lean, but combine that with a velocity based lean too. Make the lean rotate FROM the head, so the leg targets rotate to the back when running forwards, then lower it all so it still meets the floor. The way I prefer to do this is with a delayed "foot center" that accelerates towards it's goal, within reason, where it can't quite catch up. So when running at a constant speed, the central foot point is behind the head, creating a slanted angle up to the head.
- Advantage of the above is you get an overshoot of the feet when you come to a fast stop. The accelerating "center of foot targets" spot overshoots and goes in front. You also get sideways leaning when turning tight corners for free. *AND* the head stays where it was, which is good for gameplay reasons/especially if you want it to be true first person, the legs move around it.
- Pelvis yaw should follow the feet forward/back offset and then countered by the upperbody. I think you're doing this, but could be more obvious. Look into how pelvic tilt works too, drops down on the unsupported side.
Video attached showing some of these concepts that might give you some idea what I mean.