Blender V5.3
draw_shape.bsl.hh File Reference

Go to the source code of this file.

Classes

struct  Circle
struct  Sphere
struct  Box
struct  Pyramid
struct  Frustum
struct  Cone

Functions

Circle

Geometric shape structures. Some constructors might seems redundant but are here to make the API cleaner and allow for more than one constructor per type.

Circle shape_circle (float2 center, float radius)
Sphere
Sphere shape_sphere (float3 center, float radius)
Box
Box shape_box (float3 v000, float3 v100, float3 v010, float3 v001)
Square Pyramid
Pyramid shape_pyramid (float3 apex, float3 base_corner_00, float3 base_corner_01, float3 base_corner_10)
Pyramid shape_pyramid_non_oblique (float3 apex, float3 base_center, float3 base_center_pos_x, float3 base_center_pos_y)
Frustum
Frustum shape_frustum (float3 corners[8])
Cone
Cone shape_cone (float3 direction, float angle_cosine)

Function Documentation

◆ shape_box()

◆ shape_circle()

Circle shape_circle ( float2 center,
float radius )

◆ shape_cone()

Cone shape_cone ( float3 direction,
float angle_cosine )

Definition at line 215 of file draw_shape.bsl.hh.

References shape_cone().

Referenced by eevee::light::culling::CullingTile::intersect(), and shape_cone().

◆ shape_frustum()

Frustum shape_frustum ( float3 corners[8])

Use this corner order.


Z  Y
| /
|/
.-----X
    2----------6
   /|         /|
  / |        / |
 1----------5  |
 |  |       |  |
 |  3-------|--7
 | /        | /
 |/         |/
 0----------4

Definition at line 194 of file draw_shape.bsl.hh.

References Frustum::corners, and shape_frustum().

Referenced by eevee::light::culling::CullingTile::from_corners(), and shape_frustum().

◆ shape_pyramid()

Pyramid shape_pyramid ( float3 apex,
float3 base_corner_00,
float3 base_corner_01,
float3 base_corner_10 )

Regular Square Pyramid (can be oblique). Use this corner order. (Top-Down View of the pyramid)


Y
|
|
.-----X

 4-----------3
 | \       / |
 |   \   /   |
 |     0     |
 |   /   \   |
 | /       \ |
 1-----------2

base_corner_00 is vertex 1 base_corner_01 is vertex 2 base_corner_10 is vertex 4

Definition at line 117 of file draw_shape.bsl.hh.

References Pyramid::corners, and shape_pyramid().

Referenced by shape_pyramid().

◆ shape_pyramid_non_oblique()

Pyramid shape_pyramid_non_oblique ( float3 apex,
float3 base_center,
float3 base_center_pos_x,
float3 base_center_pos_y )

Regular Square Pyramid.


Y
|
|
.-----X

 4-----Y-----3
 | \   |   / |
 |   \ | /   |
 |     0-----X
 |   /   \   |
 | /       \ |
 1-----------2

base_center_pos_x is vector from base center to X base_center_pos_y is vector from base center to Y

Definition at line 151 of file draw_shape.bsl.hh.

References Pyramid::corners, and shape_pyramid_non_oblique().

Referenced by eevee::light::culling::cull_main(), shape_pyramid_non_oblique(), and eevee::light::culling::tile_main().

◆ shape_sphere()

Sphere shape_sphere ( float3 center,
float radius )