diff options
Diffstat (limited to 'src/models.c')
| -rw-r--r-- | src/models.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/models.c b/src/models.c index 092a43fc..8c5ed914 100644 --- a/src/models.c +++ b/src/models.c @@ -569,6 +569,35 @@ void DrawGizmo(Vector3 position) rlPopMatrix(); } + +// Draw light in 3D world +void DrawLight(Light light) +{ + switch (light->type) + { + case LIGHT_POINT: + { + DrawSphereWires(light->position, 0.3f*light->intensity, 4, 8, (light->enabled ? light->diffuse : BLACK)); + Draw3DCircle(light->position, light->radius, 0.0f, (Vector3){ 0, 0, 0 }, (light->enabled ? light->diffuse : BLACK)); + Draw3DCircle(light->position, light->radius, 90.0f, (Vector3){ 1, 0, 0 }, (light->enabled ? light->diffuse : BLACK)); + Draw3DCircle(light->position, light->radius, 90.0f, (Vector3){ 0, 1, 0 }, (light->enabled ? light->diffuse : BLACK)); + } break; + case LIGHT_DIRECTIONAL: + { + Draw3DLine(light->position, light->target, (light->enabled ? light->diffuse : BLACK)); + DrawSphereWires(light->position, 0.3f*light->intensity, 4, 8, (light->enabled ? light->diffuse : BLACK)); + DrawCubeWires(light->target, 0.3f, 0.3f, 0.3f, (light->enabled ? light->diffuse : BLACK)); + } break; + case LIGHT_SPOT: + { + Draw3DLine(light->position, light->target, (light->enabled ? light->diffuse : BLACK)); + DrawCylinderWires(light->position, 0.0f, 0.3f*light->coneAngle/50, 0.6f, 5, (light->enabled ? light->diffuse : BLACK)); + DrawCubeWires(light->target, 0.3f, 0.3f, 0.3f, (light->enabled ? light->diffuse : BLACK)); + } break; + default: break; + } +} + // Load a 3d model (from file) Model LoadModel(const char *fileName) { |
