Turns out that wasnt actually the solution to the problem, or maybe i just messed up:
http://steamcommunity.com/sharedfile.../?id=241836714
the line is always facing into that direction, no matter how the chair is roated
PHP Code:
decl Float:Origin[3];
decl Float:Rotation_[3];
decl Float:Rotation[3];
GetEntPropVector(chair, Prop_Send, "m_vecOrigin", Origin);
GetEntPropVector(chair, Prop_Send, "m_angRotation", Rotation_);
GetAngleVectors(Rotation_, NULL_VECTOR, NULL_VECTOR, Rotation);
Rotation[0] *= -1.0;
Rotation[1] *= -1.0;
Rotation[2] *= -1.0;
new Handle:trace = TR_TraceRayFilterEx(Origin, Rotation, MASK_SOLID_BRUSHONLY, RayType_Infinite, TraceEntityFilter);
if(trace != INVALID_HANDLE && TR_DidHit(trace))
{
decl Float:pos[3];
TR_GetEndPosition(pos, trace);
new Float:Distance = GetVectorDistance(Origin, pos);
new Color[4] = {255, 0, 0, 200};
if(Distance >= 19.65 && Distance <= 19.8)
{
Color = {0, 255, 0, 200};
}
TE_SetupBeamPoints(Origin, pos, BeamModelIndex, 0, 0, 0, 0.5, 6.0, 6.0, 1, 0.0, Color, 10);
TE_SendToAll();
PrintToChatAll("Trace did hit! Ang: %.2f %.2f %.2f | Dist: %.2f", Rotation[0], Rotation[1], Rotation[2], Distance);
}
else
{
PrintToChatAll("Trace didnt hit");
}
CleanCloseHandle(trace);
Edit: ignore me, forgot to convert the vector back to angles. Thank you very much mate!