Lots of improvements for developers: iOS, Android, camera NavigationType, T3D.Visible, more!

Posted on

sdr

Lots of new things for developers! 🙂

  1. Improvements for iOS application building:

    • Additional attributes in CastleEngineManifest.xml for iOS: team identifier, overriding qualified name and version for iOS, specifying uses_non_exempt_encryption.

    • Loading music from OggVorbis (using Tremolo customized for iOS).

    • Compilation fixes (workarounds for some FPC problems) to work in release mode.

    • Fixed touch up (mouse up) event. Test multi-touch with our drawing_toy example.

  2. Fixed Android building from Windows.

  3. Large camera API simplification:

    In short: TUniversalCamera class is now gone. Change the navigation type using the new SceneManager.NavigationType property.

    Details: I came to a realization that the TUniversalCamera class is a needless complication. We now expose NavigationType at TCastleAbstractViewport (ancestor of TCastleSceneManager and TCastleViewport).

    We also expose methods ExamineCamera and WalkCamera at TCastleAbstractViewport. They create the camera instance, and can switch the navigation as requested.

    So now you can do

    SceneManager.NavigationType := ntWalk;
    

    instead of the previous (ugly):

    (SceneManager.RequiredCamera as TUniversalCamera).NavigationType := ntWalk;
    

    And instead of

    SceneManager.Camera := SceneManager.CreateDefaultCamera;
    (SceneManager.Camera as TUniversalCamera).NavigationType := ntWalk;
    (SceneManager.Camera as TUniversalCamera).Walk.MoveSpeed := 10;
    

    now you can do

    SceneManager.WalkCamera.MoveSpeed := 10;
    

    This is much simpler, right? 🙂 It’s also safer, without these ugly typecasts.

  4. More new stuff!

  5. And, in case you missed our announcements from 2 weeks ago, our engine is now integrated with an amazing Kraft Physics Engine by Benjamin ‘BeRo’ Rosseaux.

    The manual page about physics in Castle Game Engine should be helpful.

    The main API point to start reading is the T3DTransform.RigidBody property, and the things it links to: TRigidBody, TCollider and it’s descendants.

Comments on the forum (3) ➤

Castle Game Engine 2D physics using Kraft

Posted on

Castle Game Engine 2D physics demonstration. A quick 2D game where a plane is using spheres to shoot the boxes 🙂 The physics is done using the fantastic Kraft Physics Engine!

The code to do this is 100% open-source, you can view it on GitHub here: physics_2d_game_sopwith (the main code is in “game.pas” unit).

Also, we now have a manual page describing how to use physics in Castle Game Engine.

This work was sponsored by Castle Game Engine supporters on Patreon. If you want to help in the engine development, please support me on Patreon! Thank you!

Comments on the forum ➤

Castle Game Engine physics – Mesh Collider

Posted on

More progress integrating Castle Game Engine with Kraft Physics Engine!

  1. New physics classes (TRigidBody, TCollider and descendants) are now part of the Castle Game Engine core.

    To use this yourself, see the T3DTransform.RigidBody property, and the TRigidBody and TCollider descendants documentation.

    The example code on https://github.com/castle-engine/castle-engine/tree/master/examples/physics/physics_3d_demo should also help 🙂

  2. We have mesh collider, to perform collisions with a scene mesh.

    The mesh collider was beautifully trivial to implement. I honestly didn’t expect it to be so easy to code. Lots of kudos go to Benjamin ‘BeRo’ Rosseaux for creating the wonderful Kraft Physics Engine!

This was implemented thanks to the supporters of Castle Game Engine on Patreon. If you like what I do, please support Castle Game Engine on Patreon!

Comments on the forum ➤

Castle Game Engine integration with Kraft Physics Engine

Posted on

First results of Castle Game Engine integration with Kraft Physics Engine! 🙂

The physics demo source code is in GitHub in engine examples.

Kraft Physics Engine by amazing Benjamin ‘BeRo’ Rosseaux. Open-source, clean Object Pascal code, portable (Delphi, FPC, including FPC on Android and iOS).

I want to extend this a bit, and will post more details (on Castle Game Engine news/blog) soon. For now just enjoy the video 🙂

The physics fun was sponsored by Castle Game Engine supporters on Patreon. If you want to help in the engine development, please support me on Patreon!

Comments on the forum ➤