Added GetForward to Camera C# interface.

GetForward gets the forward according to Camera's last calculated view matrix
This commit is contained in:
maverickdgg 2022-11-01 15:49:15 +08:00
parent a45432ef66
commit 39910afa54
2 changed files with 9 additions and 1 deletions

View File

@ -114,7 +114,14 @@ namespace SHADE
system->CameraLookAt(*GetNativeComponent(), Convert::ToNative(targetPosition)); system->CameraLookAt(*GetNativeComponent(), Convert::ToNative(targetPosition));
} }
Vector3 Camera::GetForward()
{
auto system = SHSystemManager::GetSystem<SHCameraSystem>();
SHVec3 forward, up, right;
system->GetCameraAxis(*GetNativeComponent(), forward, right, up);
return Convert::ToCLI(forward);
}
} }

View File

@ -65,5 +65,6 @@ namespace SHADE
void SetMainCamera(size_t directorIndex); void SetMainCamera(size_t directorIndex);
void SetMainCamera(); void SetMainCamera();
void LookAt(Vector3 targetPosition); void LookAt(Vector3 targetPosition);
Vector3 GetForward();
}; };
} }