@Ybalrid Ybalrid released this Dec 24, 2017 · 141 commits to master since this release

Assets 2

This release is mostly about making the code nicer to work with, the library nicer to use, the documentation nicer to navigate and is fixing low level problems, making the engine more flexible. Everything works on Visual Studio 2017, and on the latest version of GCC and Clang on Linux. There's untested OpenVR (HTC-Vive) support on the Linux side. I'm going to get around to try it out in the near future, so... Expect updates on that, I guess.

Comming next

The developement of the engine will focus on a few things

  • Make sure the engine will work as expected on the new Oculus Core Platform
  • Totally separate the rendering code from the engine itself and load them as plugins. This will make releases for VR platform nicer
  • Revise some of the low level component. I haven't decided yet, but I'm probably going to remove OIS and GLFW form the dependencies and replace what they do with SDL2
  • The code is mostly composed of "components" but everything is disorganized and flat. This wasn't a problem when working only on Visual Studo as the project used "filters" to sort everything, but now the build system is generated via CMake, this makes it harder to work with
  • Finally make the engine easier to install on Linux. (I'm a bit waiting on getting Ogre 2.1 "officially released" so that distribution other than Arch will have packages for it...)


  • Removed some useless #include statement and cleaned
  • Removed bad exit() based error handling
  • RAII proofed the OculusInterface code
  • Did some refactoring on the Oculus renderer
  • Rationalized the name of the "renderer" classes and their string identifier to plugini-ze them in the future
  • Eliminated more usage of new[]/delete[]
  • Removed duplicated text rendering code to textures
  • Properly linking to direct-sound on windows
  • Removed fake STL classes for Doxygen
  • Added the tag files from CppReference to Doxygen so that the documentation will point to the standard library wiki
  • Typedefed all the shared_ptr to ClassPtr
  • The DLL macro is now AnnDllExport
  • Permit to change the name of the log file
  • Permit the client app to choose the name of the default renderer to use
  • Lights are now named
  • Object storage is now fully handled by the GameObjectManager and not by levels for the name<->pointer associations
  • AnnColor is now a type on the scripting interface too
  • Triggers can be referenced by name now
  • Collision masks are now named, not just a bitmask calculated by a macro
  • Added more tests
  • Completed the API documentation
  • Fixed filesystem manager for Linux
  • Moved physics shape creation to the physics engine
  • Joystick buffer handle the capture call on joystick objects
  • use vectors of "bytes" (char) in joystick code and not vector for performance concerns
  • Fixed the converting constructor of AnnVector3 that wasn't taking a const btVector3 ref
  • Improved collision events : now has collision point coordinates and normal vector
  • Fix miss usage of erase-remove idiom in multiple places
  • Add missing animation interface on GameObjects to the scripting api
  • Improved debug console : now has console history and movable cursor for editing entered text
  • Use std;;rotate instead of a bad and buggy implementation to "scroll" the content of the debug console
  • Fixed multiple performance warning from CppCheck
  • Added a missing copy constructor on Ogre::Euler class
  • Added missing documentation comments on Ogre::Euler
  • Add some templated methods for easily "create-register" custom object to the LevelManager, the EventManager
  • Audio engine explicitly check if the loaded implementation of OpenAL is openal-soft
  • The installer will install the VS 2017 C++ runtime now
  • Updated the Oculus code to use the new begin/end frame functions instead of "submit"
  • The Oculus implementation is sending the "focus aware" flag to the Oculus compositor
  • Added a simple interface to set the mesh of the hand models without having to deal with Ogre directly
  • Added a way to load user defined subsystems from a plugin
  • Stopped ogre dumping shader output to disk
  • Made the engine startup procedure (AnnEngine constructor + selection of renderer) more sane
  • Fixed bug when physics object where left "sleeping" even when their position/orientation was changed
  • Change to using hidden directory in the user home on Linux for save files
  • Add support script to get libraries for Ogre plugins
  • Removed the "Ogre" prefix on the renderer identification strings
  • Did minor cleaning on the CMakeLists.txt files
Assets 2


This is a "mid cycle" release that should steer the development toward what should be Annwvyn 0.4

This release include : New rendering through Ogre and PBR, new build system. New testing system, repackaged resources and dependencies.

There are some graphics problems that need to be addressed. .There's also functionality of the touch controllers that aren't actually used (hand "finger pose" tracking")

I'm going to do a little roadmap and to update the blog with that information, instead of here.


  • BtOgre debug drawer bug corrected
  • old todolist removed (usage of //TODO comments and GitHub issues made it useless)
  • updated to work with the lattest version of Ogre v2.1
  • switched to use BtOgre21, my personal fork of BtOgre for Ogre 2.1 and up
  • Switched build system to CMake
  • Externalized tinyxml2's code. Link statically to it
  • Replaced the old "by hand" trigger volume with Bullet for checking collisions.
  • Reorganized some of the resources to make them easier to manage.
    • ChaiScript code and audio files are loaded via Ogre's resource manager and are fetched from Ogre's resource pool. This makes all resources of the engine be coherent between Ogre ResourceGroup system and direct file access.
  • Input processing code has been refactored in the EventManager. It's now easier to manage instead of being one giant method
  • Small corrections on the Doxygen side
  • Cleaned up the code of the Audio engine. The initialization code is less convoluted, and better logging.
  • Removed unessecary verbosity from the 3D text plane constructors
  • Removed a directive that was hiding type convertion warning. Took care of them
  • Added "contributing" and "code of conduct" files
  • Limit the use of manual new/delete in the code
  • fix a crash related to the cleanup of the FontManager if the engine was killed then restarted by the same process (e.g. unit tests)
  • Removed code that was making the engine log in "black on black" inside the Windows's console (WIN32 API)
  • The old "test" project is now a "samples" project. This is more fitting with it's location inside the repository (/example)
  • Added a testing framework (C++ Catch) and started automate tests. Bugs where corrected. There's probably a lot more bugs that will be squashed in the near future thanks to automated testing. Right now a really small part of the engine is actually tested.
  • Pushed compatibility with Oculus LibOVR 1.17
Aug 8, 2017
last verision of the engine that will work with DK1
Aug 8, 2017
Version to use for the PST4 Teleroom code with Ogre 1.9

@Ybalrid Ybalrid released this Mar 26, 2017 · 1983 commits to master since this release

Assets 2

This release is mostly tweaks, fixes and adjustment.

  • Activate vsync in no-vr mode
  • Add a way to check the presence of hand controllers that actually works
  • Updated to latest SDKs for Rift and Vive
  • Hand controllers have a compatibility flags
  • Replace abrupt stops and return to OS to actual exception throws
  • Permit to set the attenuation of lights
  • Permit to acess the Ogre Light object inside an AnnLight
  • Set the aspect ratio for the monoCam on the window
  • Update to Chai 6
  • Correct deadzone
  • Change #define to constexpr public variables
  • Fix bug where rigid body wasn't scaled when the AnnGameObject was scaled
  • Permit to set the friction factor for an object
Assets 2

Eh, that's a big one!

After starting to implement motion (hand) controllers, I needed to actually get my Oculus Touch controllers to have them actually implemented in the engine, and it's done (except for the state of the capacities finger things, and buffered haptics). And you can rumble the controllers (vive too, but the effect is different)

To continue on the extension of the API, user-defined subsystems can send custom events, string can be hashed to not waste time in tests, and a lot of duplicated code has been removed.

The VR Renders are simpler. Everything that was common and that could put in the parent class in in the parent class.

The template is more streamlined and commented with documentation. The wiki at is still seriously lacking and need some love.

What seriously needs work also is tools. The Engine can swallow level loading description in XML, but there's no good way to create these files. I have a prototype of a Qt based editor privately but it's buggy has hell and it's not usable. I actually tried to make a level editor 3 times but it really need more time and more architectural planning. That's not on the road-map right now.

I have a school project to finish, it's running with Annwvyn and I need to integrate some networking, it will be done by the UserSpaceSubystem interface (hence why it's been finished here 😉)

So, this new 0.3 "phase" of development will be dedicated to getting the performance consistent, correcting eventual bugs, maintaining compatibility with both OpenVR from Valve and OVR from Oculus and getting the documentation together.

A "big" milestone in the future will be to do the transition from Ogre 1.9 to 2.1 that is making prettier render easily, is faster, has a better material system and a more modern architecture.

The ChaiScript interface is probably still lacking a lot of useful features. They will be added progressively. The spatial triggers still need to be redone via Bullet, I'll got to make it work at some point, but the problem is this is some work that may finish to be undone by the transition to 2.1, so we'll see.

Some aspect of having actual games running aren't streamlined yet. For example it's impossible to have an actual loading screen. The engine just stops submitting frames.

This is becoming less of an issue while looking at how the last SteamVR beta of the compositor display an actual "loading" spinning wheel in a Steam window in your SteamVR space. Oculus just keeps the last good frame and tiemwarp it, with a hourglass logo in the corner of your eye.

So, here a changelog, in the chronological order of the commits, because I'm too lazy to regrom theses points by theme and I have stuff to build and upload! ;-)


  • Removed the need to hard-link to the GL RenderSystem
  • Corrected bug regarding initialization of the RTT for the eyes buffer
  • Added Oculus Touch support
  • Basic room-scale support
    • Special locomotion mode : rotate relative "room" position in the space around yourself
    • Ground the Y level to a rigid-body surface
    • wheel turning by default (like in Minecraft for Rift). Rotate the right stick/move thumb in circle on the Vive touch-pad to rotate body
    • Added some documentation on this
    • Correct initialization list of default listener
    • Changed the way Player is moved
    • Replaced AnnGetX macros with getter functions
    • Added exception. Stop using exit(useless return code)
    • Replaced call to freopen to freopen_s on the console opening code
    • Refactored the VR renderers
      • Moved all the cameras to the OgreVRRender class
      • Put all the cameras on a camera ring node
      • All renderers uses the camera ring, not moving individual cameras
      • Refactored the code that apply the tracking
      • Moved OpenGL loading to the parent class
      • Added missing destructor for the NoVRRender
      • Removed variable that pointed to Ogre's TextureManager
      • Creation of Textures moved to the parent class
      • Window creation moved to parent class
    • Object parenting
      • Situation that will cause the physics engine to glitch out throw exceptions
    • Can use the console to launch ChaiScript commends
    • Vs run-time is on the utils directory. Users actually needs to install this redistribute packages to run your code ^^"
    • Trashed old stuff (python script in utils, config file for Linux things)
    • User defined events
      • Subsystems can send custom events
      • Listener can receive custom events
      • Custom events have a hash of a string identifier to get what type they are for re-casting them
    • Added string utility
      • Random string generation via a Mersene Twister
      • String hasher
    • Moved some method implementation in actual CPP files
    • Fixed AnnEngine singleton reset
    • Ogre::Root stored into an unique_ptr
    • Fixed some const correctness on the API
    • Specialized the HandController classes on the OpenVR and OVR classes
    • Implemented Hand Controller rumble
    • Fixed performance problem by putting the process priority class to high. This is toggelable via script and via code
    • Install path is \YbalridSoftware\AnnwvynSDK64 now
    • updated to OpenVR 1.0.5
    • Fix roomscale physics translation to be on a frame reference relative to the head "forward" vector at movement start

@Ybalrid Ybalrid released this Nov 13, 2016 · 1983 commits to master since this release

Assets 2

I was looking for some time into integrating a scripting language to the engine. This makes content development easier and quicker because you don't need to re compile everything after each changes.

I've thought about Lua, and even though about putting python on the engine, and then I discover a really interesting project called ChaiScript.

ChaiScript is a scripting language for C++. It's made to be easy to bind with C++, and it is.

So, this release add the possibility to attach "behavior" scripts to AnnGameObjects (in a similar way Unity deal's with this).

The Scripting API itself is documented here : it's functional but not actually finished. The inner working, syntax and naming conventions could change (but I don't expect to do it)

Each behavior script is defined in a file with it's name and the ".chai" extension. They are written in ChaiScrip, a language that will appear fairly simple for any C++ developer (the syntax is more JavaScript-like than anything else).
Scripts define a class bearing the name of the script file, implementing a constructor taking the name of the "parent" AnnGameObject that own the script. An "update" method with no arguments is called at each frame of the game.

They can optionally implement any of the "Event" method of the AnnEventListener class as method. They will be called accordingly with the correct event type as parameter. These are usable as described in their representation in the API documentation.

class MyBehviorScript
    attr Owner;
    def MyBehavirScript(owner)
        this.Owner = owner;

    def update()
      //This is called at each simulation frame

    def KeyEvent(event)
        //This is called at each keyboard event

Now AnnGameObject are globally identifiable by a name, and can be retrieved from the AnnGameObjectManager, or via a function in scripts. Level owned "ID" for object has been replaced by this for the AnnGameObjects, but API-wise it's the same thing.

Some cleaning has been made on the template project, and some code cleaning has been made too in general thanks to ReSharper's static analyzer, and making it more C++14. In the effort of improving the quality of the code, some processing of object collection that was done by hand has been replaced with std algorithms. This makes the code cleaner and the standard implementation of theses algorithms is probably better than anything I could come up with myself.

There's still some work in that regard, but this is not a priority.

Collision now push event through the event manager. Overriding the CollisionEvent and PlayerCollisionEvent methods of a listener permit you to get them.

In the previous release statement I was talking about either running the logic or the resource management in a separated thread as the rendering. This proves a bit more difficult to do because of Ogre's non thread-safeness in this regard. I've done some experimentation and concluded that I shouldn't bother with this before porting the graphics code to Ogre 2.1

Assets 2

Pretty much everything has been said in the title, this is a minor patch. It seems than when I finally want to tag a state of the engine I don a bunch of cool stuff that could have been in the release... Anyway

Fixed anti-aliasing

Now the engine is actually using MSAA.

You just need to call


with a valid AA level (any number in { 0, 2, 4, 8, 16 })

Hands controllers

There's a very basic integration of hand-controllers within the event system. The OgreVRRender object is the one piece of the engine that is depended of the VR system you are using. The special VR controllers (or at least the way to talk to them) are also API/Specific and is "abstracted away" at the same place.

This is only active on the OpenVR renderer (the "-vive" mode of the engine.) Since it's the only one with public access to the actual controller. They can be actually online and tracked after the starting of your application sometimes, if they have been put in "sleep mode". They will only appear being actually moved by the user.

Put simply, the AnnEventListener class now has a virtual method called HandControllersEvent that will be called with an AnnHandControllersEvent passed by value. It only contains a pointer to the AnnHandController object that is owned by the VR Renderer.

It's a naked pointer and it's only sure it points to something valid at the time you got it so you're not supposed to store it.

I think I'll directly expose the state of the controller via the event object, but for now it's good enough. You can call any public stuff from this class without breaking anything :

It's also checked to run with OVR 1.9

0.2.6 should have the "don't render while loading content" problem fixed. And probably some multi-threading going on for that, and done with the new C++ standard concurrency library. Some C++11 and C++14 fun stuff!

Now, I have to go re-build and re-upload some stuff.

Assets 2

Annwvyn got a a few new features, a lot of bug fixes and some structural improvement since the last release.

I'm progressing to the goal of having a lightweight, easy to use VR engine that is VR system independent.

This release add 3 main things, and they have some side effect :

  • The basis of an hand controller abstraction, to use with Oculus Touche and Vive wands
  • A way for the use to extend what the engine is doing without having to write your own update loop via UserDefinedSubsystems
  • A system that can actually render text on your scene

This also added a way to make a level able0 to automatically unload non-managed movable objects you add to the environment if you use RAII by writing a proper destructor. You have to subclass the AnnAbstractMovable class for that.

Also a nasty bug was due to a really stupid mistake. I will not be bitten twice, so I'm now compiling with the maximum warning level, and using static analysis to make theses things less likely to happen.

I'm also changing my way of doing some things from "a C99 guy that learned C++03" to modern C++. I already adopted newer features like range-for loops, auto, and nullptr. More recently I'm using smart pointers instead of naked_type* pointers and newer STL containers.

Feature wise, I need a way to cleanly push hand controller events from the VR integration to the event manager, in a way that I will easily implement Oculus Touch support to it in December when I will got them. For now I just have a pair of Hydra (borrowed to a teacher at my school) and I use them through SteamVR as Vive controllers.

The other thing I absolutely have to work on is to not be that mono threaded. Currently, Annwvyn run the logic, then the physics, then the graphics. There's some work to make this better 😉

The last, and least fun issue that bother me is that I have currently no way to turn on any anti-aliasing on the intermediate render buffer. For some reason, adding FSAA to a Render Texture makes Ogre render a black image. So for now, we're still stuck with jagged edges 😢

Changelog (and other improvement to the code base):

  • Basic hand controller support with in -vive mode
  • Added a -noVR mode to test games without VR hardware
  • Increased Physics engine temporal resolution (sub-stepping at 240hz)
  • Corrected a physics initialization bug where a -INF "advance time" was passed to bullet
    • This was causing objects positions/orientations to be set at NaN fp values
    • This was due to uninitialized double variables that were then subtracted and casted to float, getting -INF as a result.
    • Now using cppcheck as a static analyzer to catch this kind of problem
  • Removed vestiges of the old .map system
  • Improved code quality
    • Compiling at the maximum warning level, and treating warning as errors
    • Systematic static analysis of the code
    • Using tools to check string and comments spelling and to clean code presentation
  • Removed vestiges of the old Linux compatibility
  • Listener and Level declarations are logged
  • Using more of C++ modern features to simplify the code
    • I prefer now to use std::array in place of C style array everywhere.
  • Added custom classes to hold angle values AnnDegree, AnnRadian that are seamlessly convertible between each-other
    • If a function or a method wants an AnnRadian, and you give it an AnnDegree, it will convert with the right value
    • AnnDegree(90) == AnnRadian(Math::HALF_PI)
  • Added floating text rendering in VR, transparent or with background images, using TTF fonts
  • Added an abstract movable class that define the basic interface of something that can be moved in 6DoF in 3D space
  • Added an abstract translatable class that define the basic interface of something that can be translated in 3DoF in 3D space
  • Levels can hold a list of movable to be destroyed at level unloading, including the 3D text planes mentioned above
  • AnnConsole will use glCopyImageSubData only if the GPU OpenGL version support this function
  • Corrected a bug when a texture copy was touching other textures in the engine (Circumvented a bug in Ogre? Probably.)
  • Added the possibility to create, register and remove SubSystem defined by the user
    • AnnEngine will append to it's update queue the subsystems you add to it. You can control when they are going to be updated (or not) by the "needUpdate" method of the AnnUserSubSystem class you are expanding.
    • This permit to cleanly implement things that need to tick with the engine (network code, additional devices support like a Novint Falcon or a Leap Motion)
  • Added a simple "Hub" system for demoes
  • Fixed a problem when a Level was declared as an event listener itself
  • AnnEventManager only store weak pointers to each event listeners, and will verify if a listener still exist before de-referencing it.
  • Finally added AnnPlayer::teleport method
  • AnnLevelManager will not act before the current frame logic has been processed. (no more crash when unloading of a level while stuff is still happening)
  • Added the possiblity to pre-load some resources
    • if used cleverly, it can cuts to the "hanginng" time whlile level are loading.
  • AnnAudioEngine code that initialize OpenAL has been simplified, some hard-coded references to the Oculus Rift audio interface have been removed
  • Fixed vive rendering
    • OpenVR renderer now use a shared texture to submit eye buffer
    • Dynamic allocation of the objects that abstract the hand controllers don't rely anymore on the trackedDeviceIndex they got at runtime
  • Cleaned the code of the Oculus rendering
    • Now the application declare itself to the Oculus service, as expected by the SDK
    • Static geometry is checked by the compiler instead of run-time
Assets 3

After changing the API to use an abstract "OgreVRRender" object as the renderer, The path for compatibility with other VR system was open.

This rerelease comes with 2 major improvement :

  • Resource management through RAII and smart pointers instead of relying on naked pointers and manual memory release. This permit to greatly simplify the code
  • Compatibility with OpenVR (SteamVR) through an "OgreOpenVRRender" class.

AnnEngine will use the correct renderer object if "-rift" or "-vive" is provided as a command line argument. This is completely transparent for the library user.

And now, a change sumary:

  • Added script to fetch runtime DLLs
  • App manually keep track of frame index
  • Comfort adjustment (reduced vertical rotation speed)
  • OpenGL texture copy in AnnConsole optimized
  • Corrected subsystem update number
  • Removed some useless test code
  • Correctly detect the presence of an XBox controller instead of assuming it's the 1st controller on the system
  • Use of smart pointers
    • subsystems are shared_ptr
    • game objects, lights, and triggers are shared_ptr
    • Physics initialization simplified, and keeps shared_ptrs
    • Event listeners uses shared_ptr
    • Level Manager can return shared_ptrs to previously loaded objects
    • Cached save data object are shared_ptrs
  • Fixed bug were Resource manager was accepting a reserved resource group name
  • Added Vive rendering
  • Changed the reference point of the player from it's head (center of eye plane) to it's feet (ground point in the center of the feet).
  • Added launcher script that boot the engine in Rift or Vive mode in a click
  • Example code has a physics test level with black baground and no gravity, to be able to check the relationship between the physics engine and the head tracking
  • The engine close when it receive a quit event from SteamVR

"0.3" will be the support for "hand controllers" and a proper way to specify "untilisation context" (seated, standing, room scale, virtual cocktpit".

Also, there's some problems in the physics implementation. Sometimes the time doesn't update in the physics. This is a known problem for a while, but I'm unable to track it down.

There's multiple things I'm not happy with the way the physics is handled, I don't know if BtOgre is to blame. I will probably ditch it completely and write my own physics object initialization code.