# util.IsSphereIntersectingCone

- **Ortam:** İstemci, Sunucu
- **İngilizce aslı:** https://wiki.facepunch.com/gmod/util.IsSphereIntersectingCone
- **Çeviri tarihi:** 2025-09-08

```lua
boolean util.IsSphereIntersectingCone( Vector sphereCenter, number sphereRadius, Vector coneOrigin, Vector coneAxis, number coneSine, number coneCosine )
```

## Açıklama

Bir kürenin bir koni ile kesişip kesişmediğini döndürür.

## Argümanlar

1. [Vector](https://gmod.tr/wiki/Vector) **sphereCenter**: Test edilecek kürenin merkez konumu.
2. [number](https://gmod.tr/wiki/number) **sphereRadius**: Test edilecek kürenin yarıçapı.
3. [Vector](https://gmod.tr/wiki/Vector) **coneOrigin**: Koninin tepe noktasının konumu.
4. [Vector](https://gmod.tr/wiki/Vector) **coneAxis**: Koninin yönü.
5. [number](https://gmod.tr/wiki/number) **coneSine**: Koninin açısının [math.sin](https://gmod.tr/wiki/math.sin) değeri.
6. [number](https://gmod.tr/wiki/number) **coneCosine**: Koninin açısının [math.cos](https://gmod.tr/wiki/math.cos) değeri.

## Dönen Değerler

1. [boolean](https://gmod.tr/wiki/boolean): Eğer küre koni ile kesişiyorsa `true`, aksi takdirde `false`.

### Örnek

```lua
function ENT:Draw()

	local pos = self:GetPos()
	local point = Vector( 0, 0, 0 )
	local sphereRad = 20

	local height = 100
	local angle = 45 --[[derece]] / 180 * math.pi -- radyana dönüştürüldü

	local size = math.tan( angle ) * height
	local segs = 32
	local is = util.IsPointInCone( point, pos, self:GetUp(), math.cos( angle ), height )
	local is2 = util.IsSphereIntersectingCone( point, sphereRad, pos, self:GetUp(), math.sin( angle ), math.cos( angle ) ) -- sonsuz yükseklik

	local precalc = 1/segs * math.pi * 2
	local center = pos
	for i = 1, segs do
		local pos1 = pos + math.sin( i * precalc ) * size * self:GetForward() + math.cos( i * precalc ) * size * self:GetRight() + self:GetUp() * height
		local pos2 = pos + math.sin( (i-1) * precalc ) * size * self:GetForward() + math.cos( (i-1) * precalc ) * size * self:GetRight() + self:GetUp() * height

		render.DrawLine( pos2, pos1, is and Color( 0, 255, 0 ) or Color( 255, 0, 0 ) )
		render.DrawLine( pos2, center, is and Color( 0, 255, 0 ) or Color( 255, 0, 0 ) )
	end

	render.DrawLine( pos, point, is and Color( 0, 255, 0 ) or Color( 255, 0, 0 ) )
	debugoverlay.Sphere( point, sphereRad,0.01, is2 and Color( 0, 255, 0 ) or Color( 255, 0, 0 ) )
end
```

- [GMod Wiki ana sayfası](https://gmod.tr/wiki)

---

[Tüm sunucular](https://gmod.tr/) · [GmodTR Launcher](https://gmod.tr/launcher) · [Rehber](https://gmod.tr/rehber) · [GMod Wiki](https://gmod.tr/wiki) · [GmodTR nedir?](https://gmod.tr/hakkinda) · [Sunucu ekle](https://gmod.tr/sunucu-ekle) · [Discord](https://discord.gg/gmodtr)

Kaynak: https://gmod.tr/wiki/util.IsSphereIntersectingCone
