
08.01.2021, 07:36
|
|
Познающий
Регистрация: 30.10.2020
Сообщений: 32
С нами:
2914352
Репутация:
8
|
|
Function for converting game 3D coordinates to screen coordinates (noticed that some use the self-written CalcScreenCoors function, lol)
C++:
Код:
namespace
Game
{
struct
Vector
{
float
x
,
y
,
z
;
Vector
(
float
_x
,
float
_y
,
float
_z
)
:
x
(
_x
)
,
y
(
_y
)
,
z
(
_z
)
{
}
Vector
(
)
{
x
=
y
=
z
=
0
;
}
}
;
}
Game
::
Vector
convertGameCoordsToScreen
(
Game
::
Vector worldCoords
)
{
using
CalcScreenCoors_t
=
bool
(
__cdecl
*
)
(
Game
::
Vector
*
,
Game
::
Vector
*
,
float
*
,
float
*
)
;
Game
::
Vector screenCoords
;
auto
gameFunction
{
reinterpret_cast
(
0x71DA00U
)
}
;
float
unusedParams
[
2U
]
{
0
}
;
gameFunction
(
&
worldCoords
,
&
screenCoords
,
&
unusedParams
[
0U
]
,
&
unusedParams
[
1U
]
)
;
return
screenCoords
;
}
|
|
|