SphereColliderComponent struct in Thread

Spherical collision shape centred on the entity origin. Cheapest collider — prefer this when shape accuracy doesn't matter (loot, projectiles, bonus orbs).

Properties

RadiusfloatIn the entity's own space, multiplied by its largest Scale axis (a sphere cannot squash). Default 0.5.

Example

auto& rb = bullet.AddComponent<Thread::RigidBodyComponent>();
rb.Mass = 0.05f;
rb.UseGravity = false;
bullet.AddComponent<Thread::SphereColliderComponent>().Radius = 0.05f;

SphereColliderComponent struct w Thread

Kulisty kształt kolizji wyśrodkowany w początku encji. Najtańszy collider — wybierz go, gdy dokładność kształtu nie ma znaczenia (łup, pociski, bonusy).

Właściwości

RadiusfloatW przestrzeni encji, mnożony przez największą oś jej Scale (kula nie może się spłaszczyć). Domyślnie 0.5.

Przykład

auto& rb = bullet.AddComponent<Thread::RigidBodyComponent>();
rb.Mass = 0.05f;
rb.UseGravity = false;
bullet.AddComponent<Thread::SphereColliderComponent>().Radius = 0.05f;