# Vector:WithinAABox

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

```lua
boolean Vector:WithinAABox( Vector boxStart, Vector boxEnd )
```

## Açıklama

Verilen vektörün, diğer 2 vektör tarafından oluşturulan bir kutunun içinde olup olmadığını döndürür.

![image.png](https://gmod.tr/api/uploads/wiki/198a42668f060c4a77ac.png)

## Argümanlar

1. [Vector](https://gmod.tr/wiki/Vector) **boxStart**: İlk vektör.
2. [Vector](https://gmod.tr/wiki/Vector) **boxEnd**: İkinci vektör.

## Döndürülen Değer

1. [boolean](https://gmod.tr/wiki/boolean): Vektörün kutunun içinde olup olmadığı.

### Örnek

Oyuncunun haritada belirli bir alanın içinde olup olmadığını kontrol eder.

```lua
-- Position to test, we get the position of first player on the server
local testPos = Entity( 1 ):GetPos()

-- Positions to test, in this case we test if the player is in spawn area of gm_construct
local pos1 = Vector( 1119, 895, 63 )
local pos2 = Vector( 656, -896, -144 )

-- This will return true if the player is within the tested area
print( testPos:WithinAABox( pos1, pos2 ) )
```

### Örnek

Bir dünya pozisyonunun, onu her zaman eksenle hizalı olan yerel koordinatlara dönüştürerek bir entity'nin içinde olup olmadığını kontrol eden bir fonksiyon uygulayın. Entity geçersiz olduğunda kontrol etmeyin.

```lua
local function IsInside( pos, ent )
  if ( not IsValid( ent ) ) then return false end

  local vmin = ent:OBBMins()
  local vmax = ent:OBBMaxs()
  local vpos = ent:WorldToLocal( pos )

  return vpos:WithinAABox( vmax, vmin )
end

print( IsInside( trace.HitPos, trace.Entity ) ) -- Trace hit position a part of the entity
```

- [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/Vector:WithinAABox
