Comments (6)
Fix #25 correct ray start vector
from gothicfreeaim.
Now trying this: Point-Line Distance, where x0 is the point, and x1 and x2 make up the line.
- x0 = camera
- x1 = player model
- x2 = help point (left/right of player model along the right-vector of the camera)
|(x0 - x1) X (x0 - x2)| <- *
-----------------------
|x2 - x1|
*) u X v = ((uy*vz - uz*vy), (uz*vx - ux*vz), (ux*vy - uy*vx))
from gothicfreeaim.
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));
from gothicfreeaim.
This does not work, because d[x] is the world coordinate. The local coordinate of cam must be considered instead.
from gothicfreeaim.
Simpler approach:
d = model.pos - cam.pos
d[x] = 0
d = model.pos + d
from gothicfreeaim.
cam.pos[3] + (cam.out[3] * x) = model.pos[3] - (cam.right[3] * y)
Solve for x
.
cam.pos[3] + (cam.out[3] * x)
is the new start vector.
from gothicfreeaim.
Related Issues (20)
- Crash when initializing GFA_SPELLS without GFA_STRAFING
- Focus mode is wrong when loading game in fight mode HOT 1
- Display reticle in virtual coordinates HOT 1
- Move "no focus no aim" to INI
- [Returning 2.0] Game crashes after intros while using Ninja GFA patch HOT 2
- Provide projectile pointer to config function HOT 1
- Add safety checks for common fixes HOT 1
- ITEM_FOCUS HOT 1
- New idea - free hiting
- [Gothic Multiplayer] AimRay intersection with player's camera bbox HOT 4
- [Singleplayer] FPS Drops / [Multiplayer] Not able to connect HOT 5
- Missing arrow after strafing or jump
- Spell/projectile does not fly towards reticle when behind obstacle
- Error when projectile collides with portal
- Error when NPC dies before projectile collides
- Implement alternative hit probability by camera shaking
- Implement gothic 2 controls for gothic 1
- Screen flickers while aiming or mouse movement
- Crash during Raven fight in Atariar Edition
- Reduce volume or remove sound of break projectiles shot by NPCs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gothicfreeaim.