top of page

INTRODUCTION

The capsule renderer could be used to draw simple shapes, such as triggers, colliders, boundaries, etc... The programmer could render the capsule using a start origin, a radius (3-dimensional), the angles and the height.

The color could be customized as well!

​

PROGRAMMING

The above code is the logic behind rendering the capsule. I had to use the line renderer to compose a capsule, because the line render was the only thing that was still compiled into this release engine, it takes a Vector3D start and end position. In the future, I want to create my own DirectX render solution, and feature SIMD to speed this up significantly.

This little snippet is all it takes to render a capsule around an entity. In this example I used hardcoded values, as its main purpose was to show some context. But in reality, we should determine values such as the height by measuring the distance between pPlayer->GetAbsOrigin(); and pBaseAnimating->GetBonePosition("head");.

capsule_player_entity_angled.png

Here we are drawing the capsule around the player using the code from above. The capsule also rotates around the player using the entity's absolute angles.

bottom of page