# BallSnapshot

## Overview

`BallSnapshot`는 특정 시뮬레이션 시점의 공 상태를 캡처한 데이터 타입입니다. 자세(`CFrame`), 진행 방향(`Vector3`), 속도(`number`)와 함께, 충돌 이력 인덱스 및 스핀(축/속도) 정보를 포함합니다. 궤적 재구성, 디버깅, 하이라이트 생성, 리플레이 등에서 한 프레임의 공 상태를 조회할 때 사용됩니다.

## Constructors

## Properties

### CFrame

`CFrame`

스냅샷 시점의 공 위치와 자세(회전)입니다.

#### Code Samples

```lua
local Snapshot = Snapshot -- 시뮬레이터에서 얻은 BallSnapshot
print("CFrame:", Snapshot.CFrame)
```

### Direction

`Vector3`

스냅샷 시점의 진행 방향 단위 벡터입니다. 속도 크기와 곱해 선속도를 유도할 수 있습니다.

#### Code Samples

```lua
local Snapshot = Snapshot -- 시뮬레이터에서 얻은 BallSnapshot
print("Direction:", Snapshot.Direction)
```

### hitCount

`number`

현재까지 발생한 충돌 횟수입니다. 필드명은 소문자 시작(`hitCount`)을 그대로 사용합니다.

#### Code Samples

```lua
local Snapshot = Snapshot -- 시뮬레이터에서 얻은 BallSnapshot
print("Hit count:", Snapshot.hitCount)
```

### HitLastIndex

`number`

충돌 이력에서 현재까지의 마지막 인덱스입니다.

#### Code Samples

```lua
local Snapshot = Snapshot -- 시뮬레이터에서 얻은 BallSnapshot
print("Hit last index:", Snapshot.HitLastIndex)
```

### HitStartIndex

`number`

충돌 이력에서 현재 구간의 시작 인덱스입니다. 리플레이/이벤트 구간 분할에 사용할 수 있습니다.

#### Code Samples

```lua
local Snapshot = Snapshot -- 시뮬레이터에서 얻은 BallSnapshot
print("Hit start index:", Snapshot.HitStartIndex)
```

### Speed

`number`

스냅샷 시점의 속도 크기입니다. 단위는 cm/s 입니다. (100 cm/s = 3.6 km/h)

#### Code Samples

```lua
local Snapshot = Snapshot -- 시뮬레이터에서 얻은 BallSnapshot
print("Speed (cm/s):", Snapshot.Speed)
```

### SpinAxis

`Vector3`

스냅샷 시점의 회전 축(단위 벡터)입니다. 마그누스 효과 방향과 회전 상태 분석에 활용됩니다.

#### Code Samples

```lua
local Snapshot = Snapshot -- 시뮬레이터에서 얻은 BallSnapshot
print("Spin axis:", Snapshot.SpinAxis)
```

### SpinSpeed

`number`

스냅샷 시점의 각속도 크기(rad/s)입니다.

#### Code Samples

```lua
local Snapshot = Snapshot -- 시뮬레이터에서 얻은 BallSnapshot
print("Spin speed (rad/s):", Snapshot.SpinSpeed)
```

## Methods

## Events

## See also

{% content-ref url="/pages/ca0qkgbvP2luHQy0HlFQ" %}
[SimulationBall](/korean/development/api-reference/classes/simulationball.md)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.overdare.com/korean/development/api-reference/datatype/ballsnapshot.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
