Many Animations Improvements: glTF, simultaneous anims, view3dscene panel, optimizations

Posted on

Exorcist from "The Unholy Society" (www.unholy-society.com)
Demo of simultaneous animations from glTF
  1. Animating transformations (translation, rotation, scale) from the glTF format is supported now.

  2. Playing, cross-fading and resetting the animations is now optimized, and exposes some new features.

    New methods available now:

    We now store and use more efficiently the “reset” state of the animation. See the new TimeSensor.detectAffectedFields . Previously, our Spine importer had special (and unoptimal) code to reset the state of bones not affected by the current animation. This mechanism is now more uniform (used by all animations, e.g. those imported from glTF too) and faster (we internally call ResetAnimationState just once for an animation start).

    Using the TTimeSensorNode.Start and TTimeSensorNode.Stop you can control simultaneous animations within one scene. See the demo examples/animations/simultaneous_animations_one_scene, it controls two independent animations defined in a single glTF file.

  3. view3dscene has a new “Animations” panel to test animations comfortably.

    • Show it using the toolbar button “Animations”, or menu item “Animations -> Animations Panel”, or by pressing Ctrl+A.

    • It allows to run animations easily, controlling their looping, forward, transition (cross-fade time), speed.

    • It adds buttons to “Stop Animation” and “Reset Animation State”, performing appropriate scene methods.

  4. Fun fact: this commit was one of the most difficult commits to write during this work.

    And the commit only adds a (60-line) comment in the middle of the code. The comment contains a proof that actually no code is necessary to achieve what I need! 🙂

    There was actually another commit to demo-models to interactively test that my proof is right. The scene is in demo-models animation/spine_animation_blending_test subdirectory, you can open the exported/test_animation_blending.json file with view3dscene.

    And, of course, the next day I refactored the code, and made the comment shorter too 🙂

Comment on this post ➤

Physics collision detection and new properties

Posted on

Physics collision demo

We now support collision detection using our physics engine (Kraft). You can be notified when a particular object collides, and you can check with what it collided.

Big thanks for implementing this feature go to Andrzej Kilijański!

Collisions can be checked in two ways:

  1. By getting a list of colliding TRigidBody objects from TRigidBody.GetCollidingTransforms. Works like get_colliding_bodies() in Godot.
  2. By using OnCollisionEnter and OnCollisionExit events on TRigidBody. This is similar to Unity.

Simple example to demonstrate it is in examples/physics/physics_2d_collisions directory of the engine.

We also have new properties on TRigidBody, and some internal things are now cleaner (again thanks to Andrzej Kilijański!). New properties:

Comment on this post ➤