37 lines
744 B
Markdown
37 lines
744 B
Markdown
|
|
# SetNearClipPlane
|
||
|
|
|
||
|
|
**所属类**: `CameraComponent`
|
||
|
|
|
||
|
|
**头文件**: `XCEngine/Components/CameraComponent.h`
|
||
|
|
|
||
|
|
**描述**: 设置摄像机的近裁剪平面距离。
|
||
|
|
|
||
|
|
## 函数签名
|
||
|
|
|
||
|
|
```cpp
|
||
|
|
void SetNearClipPlane(float value);
|
||
|
|
```
|
||
|
|
|
||
|
|
## 参数
|
||
|
|
|
||
|
|
| 参数 | 类型 | 描述 |
|
||
|
|
|------|------|------|
|
||
|
|
| `value` | `float` | 近裁剪平面距离,必须大于 0 且小于远裁剪平面 |
|
||
|
|
|
||
|
|
## 使用示例
|
||
|
|
|
||
|
|
```cpp
|
||
|
|
#include <XCEngine/Components/CameraComponent.h>
|
||
|
|
|
||
|
|
using namespace XCEngine::Components;
|
||
|
|
|
||
|
|
void SetupNearPlane(CameraComponent* camera) {
|
||
|
|
camera->SetNearClipPlane(0.5f); // 50厘米
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
## 相关文档
|
||
|
|
|
||
|
|
- [CameraComponent](camera-component.md) - 摄像机组件
|
||
|
|
- [GetNearClipPlane](get-near-clip-plane.md) - 获取近裁剪平面
|