top of page
hemisphere_ping_point_new.png

INTRODUCTION

The hemisphere renderer could be used to represent spawn points, script entity origins or anything similar. The benefit of an hemisphere is that it could represent the angles of an object nicely, as the other half of the sphere is removed. Due to this, we are not clipping unnecessarily through walls and other objects.

​

PROGRAMMING

The above code is the logic behind drawing hemispheres. The code has been written in Squirrel, which is a high level imperative, object-oriented programming language. All code is JIT compiled. The language has been modified for this engine, the syntax is different compared to the original Squirrel implementation.

This code snippet gets ran after entity's have been created and initialized on the server. We get an array of all "info_player_start" entity's, and draw their origin and angles with the hemisphere renderer.

​

The main purpose of this code is to demonstrate how we could use the hemisphere renderer within the script API of the engine. The renderer is exposed to all script VM's (SERVER, CLIENT and UI).

hemisphere_spawn_point.png

Here we render hemispheres at all "info_player_start" origins and angles using the code snippet from above.

hemisphere_ping_point.png

We can also cast a ray, and render the origin of the intersection between the ray and the entity's collider.

bottom of page