Repository navigation
Screen
The screen natives work out what a player sees from the camera their client sends, and give positions in the units of text draws.
| Native | Question |
|---|---|
| A3D_WorldToScreen | Where does a point of the world show? |
| A3D_ScreenToWorld | Which way does a point of the screen look? |
| A3D_GetScreenTarget | What does a point of the screen show? |
| A3D_IsPointOnScreen | Does a point show, and is it hidden? |
| A3D_GetPlayersOnScreen, A3D_GetVehiclesOnScreen, A3D_GetActorsOnScreen | Who shows? |
The screen is 640 units across and 448 down, from the top left corner, the units every text draw uses whatever the resolution of the player. Its centre is 320.0, 224.0, the point the camera looks at.
A point beside the screen gets coordinates beyond it, below 0.0 or past 640.0 and 448.0. A point behind the camera gets none.
The client sends its camera with the aim data, while the player is on foot:
- its position and the direction it looks in,
- its zoom, which open.mp turns into the field of view across the screen:
70degrees normally and down to35when a weapon or the camera zooms in, - the aspect ratio of the screen, such as
1.33for 4:3 and1.78for 16:9.
The height of the view follows from its width and the aspect ratio. Without a zoom or an aspect ratio, 70 degrees and 4:3 are used. For a player who has not sent a camera yet, every native returns false or finds no one.
- The data is the last the client sent, so a camera that turns fast is a little behind.
- The client sends its camera while the player is on foot, so in a vehicle the last camera sent may be old.
- Bots of the NPC component fill the zoom and the aspect ratio with values of their own, so only a real client shows whether a mark sits right on the screen.
- Mods that change the field of view or stretch the screen move what the player sees away from what the component works out.
A mark that stays over a vehicle is on the page of A3D_WorldToScreen. An air strike on a grid of clickable cells is on the page of A3D_GetScreenTarget.
3DAndreas 0.7.1 · Repository · Releases · MIT License
Guides
- Installation
- Configuration
- Physics objects
- Model settings
- World queries
- The screen
- Routes
- Navigation mesh
- Map database
- Coming from ColAndreas
- Performance
Reference
Functions