46 lines
982 B
Markdown
46 lines
982 B
Markdown
# TransformComponent::LookAt
|
|
|
|
公开方法,详见头文件声明。
|
|
|
|
该方法在 `XCEngine/Components/TransformComponent.h` 中提供了 2 个重载,当前页面统一汇总这些公开声明。
|
|
|
|
## 重载 1: 声明
|
|
|
|
```cpp
|
|
void LookAt(const Math::Vector3& target);
|
|
```
|
|
|
|
**参数:**
|
|
- `target` - 参数语义详见头文件声明。
|
|
|
|
**返回:** `void` - 无返回值。
|
|
|
|
## 重载 2: 声明
|
|
|
|
```cpp
|
|
void LookAt(const Math::Vector3& target, const Math::Vector3& up);
|
|
```
|
|
|
|
**参数:**
|
|
- `target` - 参数语义详见头文件声明。
|
|
- `up` - 参数语义详见头文件声明。
|
|
|
|
**返回:** `void` - 无返回值。
|
|
|
|
**示例:**
|
|
|
|
```cpp
|
|
#include <XCEngine/Components/TransformComponent.h>
|
|
|
|
void Example() {
|
|
XCEngine::Components::TransformComponent object;
|
|
// 根据上下文补齐参数后调用 TransformComponent::LookAt(...)。
|
|
(void)object;
|
|
}
|
|
```
|
|
|
|
## 相关文档
|
|
|
|
- [返回类总览](TransformComponent.md)
|
|
- [返回模块目录](../Components.md)
|