Tp, Paintgun, refractor rainbow controller, refractor raycast (#1708)

This commit is contained in:
TheGreenBandit
2023-07-14 17:31:03 -04:00
committed by GitHub
parent 71db1ca1fa
commit fa02f2e779
14 changed files with 320 additions and 95 deletions
+28
View File
@@ -69,6 +69,34 @@ namespace big::entity
return (bool)hit;
}
inline bool raycast(Vector3* endcoor)
{
Entity ent;
BOOL hit;
Vector3 surfaceNormal;
Vector3 camCoords = CAM::GET_GAMEPLAY_CAM_COORD();
Vector3 dir = math::rotation_to_direction(CAM::GET_GAMEPLAY_CAM_ROT(2));
Vector3 farCoords;
farCoords.x = camCoords.x + dir.x * 1000;
farCoords.y = camCoords.y + dir.y * 1000;
farCoords.z = camCoords.z + dir.z * 1000;
int ray = SHAPETEST::START_EXPENSIVE_SYNCHRONOUS_SHAPE_TEST_LOS_PROBE(camCoords.x,
camCoords.y,
camCoords.z,
farCoords.x,
farCoords.y,
farCoords.z,
-1,
0,
7);
SHAPETEST::GET_SHAPE_TEST_RESULT(ray, &hit, endcoor, &surfaceNormal, &ent);
return (bool)hit;
}
inline bool network_has_control_of_entity(rage::netObject* net_object)
{
return !net_object || !net_object->m_next_owner_id && (net_object->m_control_id == -1);