public static BuildCollisionLayerConfig WithWorldBounds(this BuildCollisionLayerConfig config, Aabb worldAabb) { config.settings.worldAABB = worldAabb; return(config); }
public static Aabb CalculateAabb(SphereCollider sphere, RigidTransform transform) { float3 wc = math.transform(transform, sphere.center); Aabb aabb = new Aabb(wc - sphere.radius, wc + sphere.radius); return aabb; }
public static BuildCollisionLayerConfig WithWorldBounds(this BuildCollisionLayerConfig config, float3 min, float3 max) { var aabb = new Aabb(min, max); return(config.WithWorldBounds(aabb)); }
public static void GetCenterExtents(Aabb aabb, out float3 center, out float3 extents) { center = (aabb.min + aabb.max) / 2f; extents = aabb.max - center; }