Skip to content

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.

sco_result (*)(uint64_t, const double *, const double *, double, sc_world_hit *)

Service index

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

Header source

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.

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 table: query_service NOT_FOUND

Caller buffers; no allocation crosses boundary; queries do not own entities. Internal allocation unspecified.

Game thread only (WRONG_THREAD elsewhere); last_error any thread. Recursive reentrancy unspecified.

unspecified

unspecified

No cancellation entrypoint; synchronous query.

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.hpp
return t_->raycast(zone, from, dir, maxDist, &hit);
csharp typed-wrapper sdk/csharp/Sco.Sdk/Game/World.cs
r = _t->raycast(zoneId, f, d, maxDist, &h);
lua typed-wrapper plugins/lua/sco_lua_game.c
const sco_result r = GAME_MEMBER(w, sc_world_v1, raycast) ? w->raycast(zone, from, dir, max, &hit) : SCO_UNAVAILABLE;

None identified in the catalogue; this is not proof none can exist.

ABI pins prove layout, not semantic behavior or a live game session.