Skip to content

Commit 36cb2ca

Browse files
committed
Update readme ( add float2 / float3 damping system )
1 parent af29cf6 commit 36cb2ca

File tree

1 file changed

+35
-3
lines changed

1 file changed

+35
-3
lines changed

README.md

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Youtube video [Giving Personality to Procedural Animations using Math](https://w
4545
## ✨ Key Features
4646

4747
- 🔬 **Mathematical Accuracy**: Physically accurate implementation based on second-order differential equations
48-
- 🎯 **Multiple Type Support**: Full support for float, Vector2/3/4
48+
- 🎯 **Multiple Type Support**: Full support for float, float2/3, Vector2/3/4
4949
- 🔧 **Ease of Use**: Easy setup with intuitive parameters
5050
- 📚 **Complete Documentation**: Fully documented in both Korean and English
5151

@@ -158,14 +158,26 @@ For detailed information, refer to this [video](https://www.youtube.com/watch?v=
158158

159159
The DampingSystem package provides specialized implementations for different data types, each optimized for their specific use cases:
160160

161-
### Scalar Type
161+
### Scalar Types
162162

163163
```csharp
164164
// Float damping - perfect for UI animations, health bars, etc.
165165
var floatDamper = new DampingSystemFloat(2.0f, 1.0f, 0.0f, 0.0f);
166166
float smoothValue = floatDamper.Calculate(targetValue);
167167
```
168168

169+
### Unity.Mathematics Types
170+
171+
```csharp
172+
// Float2 damping - optimized for 2D coordinates using Unity.Mathematics
173+
var float2Damper = new DampingSystemFloat2(2.0f, 1.0f, 0.0f, new float2(0, 0));
174+
float2 smoothPos2D = float2Damper.Calculate(targetPos2D);
175+
176+
// Float3 damping - optimized for 3D coordinates using Unity.Mathematics
177+
var float3Damper = new DampingSystemFloat3(2.0f, 1.0f, 0.0f, new float3(0, 0, 0));
178+
float3 smoothPos3D = float3Damper.Calculate(targetPos3D);
179+
```
180+
169181
### Vector Types
170182

171183
```csharp
@@ -189,6 +201,8 @@ Assets/DampingSystem/Scripts/Abstract/DampingSystem.cs
189201

190202
Each type-specific implementation can be found in:
191203
- `DampingSystemFloat.cs`
204+
- `DampingSystemFloat2.cs` (Unity.Mathematics)
205+
- `DampingSystemFloat3.cs` (Unity.Mathematics)
192206
- `DampingSystemVector2.cs`
193207
- `DampingSystemVector3.cs`
194208
- `DampingSystemVector4.cs`
@@ -209,6 +223,8 @@ Each type-specific implementation can be found in:
209223
| Type | Operation Time (ns) | Memory Usage |
210224
|:---------------:|:-------------------:|:------------:|
211225
| Float | ~15 | 64 bytes |
226+
| Float2 | ~25 | 72 bytes |
227+
| Float3 | ~35 | 88 bytes |
212228
| Vector2 | ~30 | 80 bytes |
213229
| Vector3 | ~45 | 96 bytes |
214230
| Vector4 | ~60 | 112 bytes |
@@ -329,7 +345,7 @@ There is a [English translation](#english) at the top.
329345
## ✨ 주요 특징
330346

331347
- 🔬 **수학적 정확성**: 2차 미분방정식 기반의 물리적으로 정확한 구현
332-
- 🎯 **다양한 타입 지원**: float, Vector2/3/4 완벽 지원
348+
- 🎯 **다양한 타입 지원**: float, float2/3, Vector2/3/4 완벽 지원
333349
- 🔧 **사용 편의성**: 직관적인 매개변수로 쉬운 설정
334350
- 📚 **완전한 문서화**: 한국어/영어 이중 문서화
335351

@@ -449,6 +465,18 @@ var floatDamper = new DampingSystemFloat(2.0f, 1.0f, 0.0f, 0.0f);
449465
float smoothValue = floatDamper.Calculate(targetValue);
450466
```
451467

468+
### Unity.Mathematics 타입
469+
470+
```csharp
471+
// Float2 감쇠 - Unity.Mathematics를 사용한 최적화된 2D 좌표
472+
var float2Damper = new DampingSystemFloat2(2.0f, 1.0f, 0.0f, new float2(0, 0));
473+
float2 smoothPos2D = float2Damper.Calculate(targetPos2D);
474+
475+
// Float3 감쇠 - Unity.Mathematics를 사용한 최적화된 3D 좌표
476+
var float3Damper = new DampingSystemFloat3(2.0f, 1.0f, 0.0f, new float3(0, 0, 0));
477+
float3 smoothPos3D = float3Damper.Calculate(targetPos3D);
478+
```
479+
452480
### 벡터 타입
453481

454482
```csharp
@@ -472,6 +500,8 @@ Assets/DampingSystem/Scripts/Abstract/DampingSystem.cs
472500

473501
각 타입별 구현은 다음에서 찾을 수 있습니다:
474502
- `DampingSystemFloat.cs`
503+
- `DampingSystemFloat2.cs` (Unity.Mathematics)
504+
- `DampingSystemFloat3.cs` (Unity.Mathematics)
475505
- `DampingSystemVector2.cs`
476506
- `DampingSystemVector3.cs`
477507
- `DampingSystemVector4.cs`
@@ -492,6 +522,8 @@ Assets/DampingSystem/Scripts/Abstract/DampingSystem.cs
492522
| 타입 | 연산 시간 (ns) | 메모리 사용량 |
493523
|:---------------:|:-------------:|:-----------:|
494524
| Float | ~15 | 64 bytes |
525+
| Float2 | ~25 | 72 bytes |
526+
| Float3 | ~35 | 88 bytes |
495527
| Vector2 | ~30 | 80 bytes |
496528
| Vector3 | ~45 | 96 bytes |
497529
| Vector4 | ~60 | 112 bytes |

0 commit comments

Comments
 (0)