entity.transform
@1ALL BACKENDSPositions, rotations and scales of live entities. Reads are automatic. Writing a transform needs memory.write, which is prompted at install.
Types
struct Vec3 { x: f32, y: f32, z: f32 } struct Transform { position: Vec3, rotation: Vec3, scale: Vec3, }
Calls
World positions for a set of entities, in one crossing. The returned array matches the input order. An entity that no longer resolves yields a zero vector rather than shifting the array, so indices stay aligned.
The world position of one entity.
Calling this in a loop inside on_frame is one boundary crossing per entity. The linter warns and names positions as the fix.
Position, rotation and scale together. Cheaper than three calls, and consistent: all three come from the same instant.
Moves an entity. Returns Err(Denied) if the mod did not declare memory.write, every time, at every call site. The denial is logged once per session, not once per call.
Example
// one crossing for every entity on screen auto ids = f.entities().alive(); auto pts = f.entities().positions(ids); markers_.clear(); for (auto const& p : pts) if (auto s = f.camera().project(p)) markers_.push_back(*s);