-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update trace ray start vector #25
Comments
Solve for
|
Simpler approach:
|
This does not work, because d[x] is the world coordinate. The local coordinate of cam must be considered instead. |
Another failed attempt (just copying it here because it made it into no commit): d[0] = subf(MEM_ReadInt(_@(her)+72), MEM_ReadInt(MEM_Camera.connectedVob+72));
d[1] = subf(MEM_ReadInt(_@(her)+88), MEM_ReadInt(MEM_Camera.connectedVob+88));
d[2] = subf(MEM_ReadInt(_@(her)+104), MEM_ReadInt(MEM_Camera.connectedVob+104));
const int zMAT4__Rotate = 5542544; //0x549290
CALL_PtrParam(_@(d));
CALL_RetValIsStruct(12);
CALL__thiscall(MEM_Camera.connectedVob+60, zMAT4__Rotate);
var int dPtr; dPtr = CALL_RetValAsInt();
MEM_CopyWords(dPtr, _@(d), 3);
MEM_Free(dPtr);
d[0] = FLOATNULL;
var int dist; dist = sqrtf(addf(addf(sqrf(d[0]), sqrf(d[1])), sqrf(d[2])));
d[0] = addf(MEM_ReadInt(MEM_Camera.connectedVob+72), mulf(MEM_ReadInt(MEM_Camera.connectedVob+68), dist));
d[1] = addf(MEM_ReadInt(MEM_Camera.connectedVob+88), mulf(MEM_ReadInt(MEM_Camera.connectedVob+84), dist));
d[2] = addf(MEM_ReadInt(MEM_Camera.connectedVob+104), mulf(MEM_ReadInt(MEM_Camera.connectedVob+100), dist)); |
Now trying this: Point-Line Distance, where x0 is the point, and x1 and x2 make up the line.
|
Fix #25 correct ray start vector |
By means of Pythagoras, shift the start vector to be aligned with the distance between camera and player model to be more consistent and allow different camera-model-distances.
The text was updated successfully, but these errors were encountered: