MCPcopy Create free account
hub / github.com/crownengine/crown / local_sphere

Function local_sphere

src/world/render_world.cpp:44–61  ·  view source on GitHub ↗

Extract bounding sphere in local space.

Source from the content-addressed store, hash-verified

42{
43// Extract bounding sphere in local space.
44static Sphere local_sphere(const RenderWorld::LightManager &lm, u32 i)
45{
46 Sphere s;
47
48 if (lm._data.type[i] == LightType::OMNI) {
49 s = { VECTOR3_ZERO, lm._data.shader[i].range };
50 } else if (lm._data.type[i] == LightType::SPOT) {
51 s = sphere::from_cone(VECTOR3_ZERO
52 , VECTOR3_DOWN
53 , lm._data.shader[i].range
54 , lm._data.shader[i].spot_angle
55 );
56 } else {
57 CE_FATAL("Unknown light type");
58 }
59
60 return s;
61}
62
63static Sphere obb_sphere(const OBB &obb)
64{

Callers 2

sync_cullable_setsMethod · 0.85
debug_drawMethod · 0.85

Calls 1

from_coneFunction · 0.85

Tested by

no test coverage detected