X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fdpdefs%2Fdoc.md;h=b49bb6f57ad72e7ab0ff6bed1b20925d6e26362a;hp=302c5d806a0678b88ed925cef074815a9c0b0af2;hb=65ba38c5228d8af26ac2b04b6e6e536a1772f446;hpb=f41d9f31538bef0259d2b2c74536bb977901f99d diff --git a/qcsrc/dpdefs/doc.md b/qcsrc/dpdefs/doc.md index 302c5d806a..b49bb6f57a 100644 --- a/qcsrc/dpdefs/doc.md +++ b/qcsrc/dpdefs/doc.md @@ -18,6 +18,7 @@ bool CSQC_InputEvent(int eventtype, int x, int y); void CSQC_UpdateView(int width, int height); +// catch commands registered with registercommand bool CSQC_ConsoleCommand(string cmd); bool CSQC_Parse_TempEntity(); bool CSQC_Parse_StuffCmd(string msg); @@ -54,6 +55,21 @@ float sound_starttime; # SVQC +Main loop: +* SV_Physics() + * StartFrame() + * if (force_retouch) + * foreach entity: + * .touch() + * foreach client: + * PlayerPreThink() + * .think() + * PlayerPostThink() + * foreach nonclient: + * .think() + * EndFrame() + + ``` .entity clientcamera; @@ -86,12 +102,14 @@ void ClientKill(); // self void RestoreGame(); +// Called when a client connects to the server // input: // time // self // parm1..n void ClientConnect(); +// Called when a client spawns in the server // input: // time // self @@ -122,6 +140,7 @@ void SV_OnEntityPostSpawnFunction(); // parm1..n void SetNewParms(); +// Runs every frame // input: // .bool customizeentityforclient(); @@ -195,6 +214,10 @@ void SV_PlayerPhysics(); // self void SV_ParseClientCommand(string cmd); +// qcstatus server field +string worldstatus; +.string clientstatus; + ``` # MENUQC @@ -226,3 +249,85 @@ void URI_Get_Callback(int id, int status, string data); void GameCommand(string cmd); ``` + +# Misc + +## Trace + +### tracebox + + void tracebox(vector v1, vector min, vector max, vector v2, int tryents, entity ignoreentity); + +attempt to move an object from v1 to v2 of given size + +tryents: + * MOVE_NORMAL (0) + * MOVE_NOMONSTERS (1): ignore monsters + * MOVE_MISSILE (2): +15 to every extent + * MOVE_WORLDONLY (3): ignore everything except bsp + * MOVE_HITMODEL (4): hit model, not bbox + +### traceline + + void traceline(vector v1, vector v2, int tryents, entity ignoreentity); + +degenerate case of tracebox when min and max are equal + +### result globals + + bool trace_allsolid; + +trace never left solid + + bool trace_startsolid; + +trace started inside solid + + float trace_fraction; + +distance before collision: 0..1, 1 if no collision + + vector trace_endpos; + +v1 + (v2 - v1) * trace_fraction + + vector trace_plane_normal; + +normalized plane normal, '0 0 0' if no collision. +May be present if edges touch without clipping, use `trace_fraction < 1` as a determinant instead + + float trace_plane_dist; + + + + entity trace_ent; + +entity hit, if any + + bool trace_inopen; + + + + bool trace_inwater; + + + + int trace_dpstartcontents; + +DPCONTENTS_ value at start position of trace + + int trace_dphitcontents; + +DPCONTENTS_ value of impacted surface (not contents at impact point, just contents of the surface that was hit) + + int trace_dphitq3surfaceflags; + +Q3SURFACEFLAG_ value of impacted surface + + string trace_dphittexturename; + +texture name of impacted surface + + int trace_networkentity; + +