sc_world_v1.raycast
Casts a ray from from (metres, in zone zone_id’s local frame) along dir (any non-zero length; it is normalised) for at most max_dist metres, and fills *out_hit (out_hit->size must be sizeof(sc_world_hit)). max_dist must be positive and finite; one over SC_WORLD_RAY_MAX_DISTANCE is clamped to it. The cast tries the zone and then up to two of its parents (never the world’s root zone), as sc-offline’s build mode does, and reports the first hit, in the frame of zone_id. Nothing is skipped: your own player’s body can be hit. SCO_OK: hit. SCO_NOT_FOUND: nothing hit within max_dist (last_error says “no hit”), or the zone isn’t streamed in, or you haven’t spawned. SCO_BAD_ARG: a NULL pointer, zone 0, a non-finite or zero direction, a bad max_dist or a too-small out_hit->size. SCO_UNAVAILABLE: game.world.raycast isn’t ready. SCO_FAILED: the game faulted. *out_hit is zeroed (apart from size) on every failure. Implementation: NULL/undersized hit rejected before zeroing; adequately-sized hit is zeroed excluding size, only known fields written. Unknown caller tail untouched.
Signature
Section titled “Signature”sco_result (*)(uint64_t, const double *, const double *, double, sc_world_hit *)Service and availability
Section titled “Service and availability”| Property | Value |
|---|---|
| Symbol | sc_world_v1.raycast |
| Record ID | sc-world-v1-raycast |
| Service | game.world |
| Table | sc_world_v1 |
| Version macro | SC_WORLD_VERSION_1_1 |
| Packed table version | 65537 |
| Since / availability | size >= 16; 1.0 |
| Complete member extent (x64 bytes) | 16 |
| Table size (x64 bytes) | 40 |
Parameters and buffers
Section titled “Parameters and buffers”sco_result (*raycast)(uint64_t zone_id, const double from[3], const double dir[3], double max_dist, sc_world_hit* out_hit);
Casts a ray from from (metres, in zone zone_id’s local frame) along dir (any non-zero length; it is normalised) for at most max_dist metres, and fills *out_hit (out_hit->size must be sizeof(sc_world_hit)). max_dist must be positive and finite; one over SC_WORLD_RAY_MAX_DISTANCE is clamped to it. The cast tries the zone and then up to two of its parents (never the world’s root zone), as sc-offline’s build mode does, and reports the first hit, in the frame of zone_id. Nothing is skipped: your own player’s body can be hit. SCO_OK: hit. SCO_NOT_FOUND: nothing hit within max_dist (last_error says “no hit”), or the zone isn’t streamed in, or you haven’t spawned. SCO_BAD_ARG: a NULL pointer, zone 0, a non-finite or zero direction, a bad max_dist or a too-small out_hit->size. SCO_UNAVAILABLE: game.world.raycast isn’t ready. SCO_FAILED: the game faulted. *out_hit is zeroed (apart from size) on every failure. Implementation: NULL/undersized hit rejected before zeroing; adequately-sized hit is zeroed excluding size, only known fields written. Unknown caller tail untouched.
Results and failures
Section titled “Results and failures”Absent table: query_service NOT_FOUND; missing operation capability: UNAVAILABLE; BAD_ARG for invalid required outputs. Additional failures/output state unspecified unless described in the buffer contract.
Absent capability
Section titled “Absent capability”Absent table: query_service NOT_FOUND
Ownership
Section titled “Ownership”Caller buffers; no allocation crosses boundary; queries do not own entities. Internal allocation unspecified.
Thread affinity
Section titled “Thread affinity”Game thread only (WRONG_THREAD elsewhere); last_error any thread. Recursive reentrancy unspecified.
Callback context
Section titled “Callback context”unspecified
Reentrancy
Section titled “Reentrancy”unspecified
Cleanup and cancellation
Section titled “Cleanup and cancellation”No cancellation entrypoint; synchronous query.
Language mappings
Section titled “Language mappings”Status labels are copied verbatim from the catalogue: direct is native access; typed-wrapper is wrapper-backed; restricted is a subset/adaptation; unsupported means no supported route is established. No status implies universal safety.
| Language | Catalogue status | Source evidence / wrapper tokens |
|---|---|---|
| c | direct | include/sc_world.h(*raycast) |
| cpp | typed-wrapper | include/scosdk/game/world.hppreturn t_->raycast(zone, from, dir, maxDist, &hit); |
| csharp | typed-wrapper | sdk/csharp/Sco.Sdk/Game/World.csr = _t->raycast(zoneId, f, d, maxDist, &h); |
| lua | typed-wrapper | plugins/lua/sco_lua_game.cconst sco_result r = GAME_MEMBER(w, sc_world_v1, raycast) ? w->raycast(zone, from, dir, max, &hit) : SCO_UNAVAILABLE; |
Examples
Section titled “Examples”None identified in the catalogue; this is not proof none can exist.
- tests/abi_game_world.c
- tests/test_app.cpp
- tests/test_lua.cpp
- tests/test_sdk.cpp
- sdk/csharp/Sco.Sdk.Tests/GameFakeHost.cs
- tools/test.sh
- sdk/csharp/Sco.Sdk.Tests/GameLayout.cs
ABI pins prove layout, not semantic behavior or a live game session.