Mouse cursor ray casting in Realization Engine version 22

I have added a simple editor mode in my graphics engine that allows me to move and rotate entities with the mouse cursor.

This works by casting a ray from the camera, trough the mouse cursor, into the world. To select objects, the distance from the objects local origin to the mouse ray is calculated using linear algebra, if this distance is small enough the object is selected. Then the intersection point between this ray and the terrain is calculated using binary search, and used to position the selected object.

Download version 22 and try it yourself: Realization Engine download page

Double jump using [Space] to begin flying mode. Use space and [Shift] to fly up and down. Hold down [Alt] to free the mouse cursor to interact with objects. Click and drag objects with the left mouse button to move them. Click and drag with the right mouse button to rotate objects. Press the center mouse button to spawn a new “physics-barrel”.

Leave a Reply

Your email address will not be published. Required fields are marked *