cturtle/world
include "cturtle/world";
Types
Entity
Native handle
readComponent infallible
infallible fn readComponent(Component component, type valueType) -> type
writeComponent infallible
infallible fn writeComponent(Component component, type valueType) -> type
alive infallible
infallible fn alive() -> bool
hasComponent
fn hasComponent(Component component) -> bool
id infallible
infallible fn id() -> int
AmmoType
Native handle
WorldBatch
Native object
entity infallible
infallible fn entity(int index) -> Entity
rows infallible
infallible fn rows(type schema, type access) -> type
WorldRelation
Native struct
| Field | Type | Writable | Description |
|---|---|---|---|
parent | int32 | no | |
depth | int32 | no | |
groupStart | int32 | no | |
groupLength | int32 | no |
WorldRelationBlock
Native object
leftRows infallible
infallible fn leftRows(type schema, type access) -> type
rightRows infallible
infallible fn rightRows(type schema, type access) -> type
same infallible
infallible fn same() -> bool
link infallible
infallible fn link(int left, int right) -> bool
WorldRelationKeys
Native object
rows infallible
infallible fn rows(type schema, type access) -> type
setInt infallible
infallible fn setInt(int row, int key) -> bool
setFloat infallible
infallible fn setFloat(int row, float key) -> bool
setEntity infallible
infallible fn setEntity(int row, Entity key) -> bool
ShipHandling
Native struct
| Field | Type | Writable | Description |
|---|---|---|---|
move_scale | float32 | yes | |
turn_scale | float32 | yes |
Weapon
Native struct
| Field | Type | Writable | Description |
|---|---|---|---|
fire_interval | float32 | yes | |
cooldown | float32 | yes | |
trigger_held | bool | yes | |
auto_reload | bool | yes | |
ammo | int32 | yes | |
magazine_size | int32 | yes | |
reserve_ammo | int32 | yes | |
ammo_type | AmmoType | no | |
reload_time | float32 | yes | |
reload_timer | float32 | yes |
PositionX
Native struct
| Field | Type | Writable | Description |
|---|---|---|---|
value | float32 | yes |
PositionY
Native struct
| Field | Type | Writable | Description |
|---|---|---|---|
value | float32 | yes |
PositionZ
Native struct
| Field | Type | Writable | Description |
|---|---|---|---|
value | float32 | yes |
Rotation
Native struct
| Field | Type | Writable | Description |
|---|---|---|---|
radians | float32 | yes |
Pitch
Native struct
| Field | Type | Writable | Description |
|---|---|---|---|
radians | float32 | yes |
VelocityX
Native struct
| Field | Type | Writable | Description |
|---|---|---|---|
value | float32 | yes |
VelocityY
Native struct
| Field | Type | Writable | Description |
|---|---|---|---|
value | float32 | yes |
VelocityZ
Native struct
| Field | Type | Writable | Description |
|---|---|---|---|
value | float32 | yes |
AngularVelocity
Native struct
| Field | Type | Writable | Description |
|---|---|---|---|
value | float32 | yes |
Thrust
Native struct
| Field | Type | Writable | Description |
|---|---|---|---|
value | float32 | yes |
Damage
Native struct
| Field | Type | Writable | Description |
|---|---|---|---|
amount | float32 | yes |
WorldFloatComponent
Native struct
| Field | Type | Writable | Description |
|---|---|---|---|
value | float32 | yes |
WorldIntComponent
Native struct
| Field | Type | Writable | Description |
|---|---|---|---|
value | int | yes |
WorldBoolComponent
Native struct
| Field | Type | Writable | Description |
|---|---|---|---|
value | bool | yes |
Health
Native struct
| Field | Type | Writable | Description |
|---|---|---|---|
current | float32 | yes | |
max | float32 | yes |
WorldRelationTest
Object
WorldRelationKey
Object
WorldRelationSettings
Object
| Field | Type | Writable | Description |
|---|---|---|---|
kind | int | yes | |
broadphase | int | yes | |
cellSize | float | yes | |
rebuildEachFrame | bool | yes | |
key | WorldRelationKey? | yes | |
test | WorldRelationTest? | yes | |
bucket | WorldRelationKey? | yes | |
cellX | WorldRelationKey? | yes | |
cellY | WorldRelationKey? | yes | |
cellZ | WorldRelationKey? | yes |
WorldSceneActor
Object
| Field | Type | Writable | Description |
|---|---|---|---|
kind | string | yes | |
x | float | yes | |
y | float | yes | |
z | float | yes |
WorldWeaponConfig
Object
| Field | Type | Writable | Description |
|---|---|---|---|
fireInterval | float | yes | |
magazineSize | int | yes | |
reloadTime | float | yes | |
autoReload | bool | yes |
WorldSpatialCircle
Object
| Field | Type | Writable | Description |
|---|---|---|---|
radius | float | yes | |
layer | int | yes | |
mask | int | yes | |
tag | int | yes |
WorldSpatialProxyDesc
Object
| Field | Type | Writable | Description |
|---|---|---|---|
localX | float | yes | |
localY | float | yes | |
localZ | float | yes | |
radius | float | yes | |
layer | int | yes | |
mask | int | yes | |
tag | int | yes |
WorldCollisionSweepDesc
Object
| Field | Type | Writable | Description |
|---|---|---|---|
startX | float | yes | |
startY | float | yes | |
radius | float | yes | |
forwardExtension | float | yes | |
layer | int | yes | |
mask | int | yes | |
enabled | bool | yes | |
ignoreSource | bool | yes |
WorldColor3
Object
| Field | Type | Writable | Description |
|---|---|---|---|
r | float | yes | |
g | float | yes | |
b | float | yes |
WorldShieldRuntimeConfig
Object
| Field | Type | Writable | Description |
|---|---|---|---|
collisionLayer | int | yes | |
spatialTag | int | yes | |
renderLayer | float | yes |
WorldShieldConfig
Object
| Field | Type | Writable | Description |
|---|---|---|---|
radius | float | yes | |
strength | float | yes | |
shellInner | float | yes | |
healDelay | float | yes | |
tint | WorldColor3 | yes | |
interceptMask | int | yes |
WorldShieldWound
Object
| Field | Type | Writable | Description |
|---|---|---|---|
minimumRadius | float | yes | |
radiusPerSqrtEnergy | float | yes | |
maximumRadius | float | yes |
WorldShieldEnergyHit
Object
| Field | Type | Writable | Description |
|---|---|---|---|
hit | bool | yes | |
stopped | bool | yes | |
absorbed | float | yes | |
remaining | float | yes | |
damageRadius | float | yes |
WorldArmorImpact
Object
| Field | Type | Writable | Description |
|---|---|---|---|
radius | float | yes | |
strength | float | yes | |
hardness | float | yes | |
heat | float | yes |
WorldArmorEnergyHit
Object
| Field | Type | Writable | Description |
|---|---|---|---|
hit | bool | yes | |
stopped | bool | yes | |
absorbed | float | yes | |
remaining | float | yes | |
resistance | float | yes | |
split | bool | yes |
WorldConvexBody
Object
| Field | Type | Writable | Description |
|---|---|---|---|
points | array<Vec2> | yes | |
density | float | yes | |
bodyType | int | yes | |
layer | int | yes | |
mask | int | yes |
WorldRevoluteDesc
Object
| Field | Type | Writable | Description |
|---|---|---|---|
anchorA | Vec2 | yes | |
anchorB | Vec2 | yes | |
referenceAngle | float | yes | |
limitsEnabled | bool | yes | |
lowerAngle | float | yes | |
upperAngle | float | yes | |
springHertz | float | yes | |
dampingRatio | float | yes | |
motorEnabled | bool | yes | |
motorSpeed | float | yes | |
maxMotorTorque | float | yes | |
collideConnected | bool | yes |
WorldJoint
Object
| Field | Type | Writable | Description |
|---|---|---|---|
id | int | yes |
alive infallible
infallible fn alive() -> bool
destroy infallible
infallible fn destroy() -> bool
motor infallible
infallible fn motor(bool enabled, float speed, float maxTorque) -> bool
angle
fn angle() -> float
Vec2
Object
| Field | Type | Writable | Description |
|---|---|---|---|
x | float | yes | |
y | float | yes |
Rect
Object
| Field | Type | Writable | Description |
|---|---|---|---|
x | float | yes | |
y | float | yes | |
w | float | yes | |
h | float | yes |
WorldView
Object
| Field | Type | Writable | Description |
|---|---|---|---|
bounds | Rect | yes | |
followEntity | Entity | yes |
WorldTransform2
Object
| Field | Type | Writable | Description |
|---|---|---|---|
x | float | yes | |
y | float | yes | |
yaw | float | yes | |
cosYaw | float | yes | |
sinYaw | float | yes |
Component
Object
| Field | Type | Writable | Description |
|---|---|---|---|
id | int | yes |
read infallible
infallible fn read(Entity entity, type valueType) -> type
write infallible
infallible fn write(Entity entity, type valueType) -> type
WorldArchetype
Object
| Field | Type | Writable | Description |
|---|---|---|---|
id | int | yes |
WorldQuery
Object
| Field | Type | Writable | Description |
|---|---|---|---|
id | int | yes |
WorldSystem
Object
| Field | Type | Writable | Description |
|---|---|---|---|
id | int | yes |
WorldPhase
Object
| Field | Type | Writable | Description |
|---|---|---|---|
id | int | yes |
WorldPhaseCadence
Object
| Field | Type | Writable | Description |
|---|---|---|---|
fixedStep | bool | yes |
WorldPhasePlacement
Object
| Field | Type | Writable | Description |
|---|---|---|---|
relation | int | yes | |
relative | WorldPhase | yes |
WorldPhaseConfig
Object
| Field | Type | Writable | Description |
|---|---|---|---|
name | string | yes | |
cadence | WorldPhaseCadence | yes | |
placement | WorldPhasePlacement | yes |
WorldResource
Object
| Field | Type | Writable | Description |
|---|---|---|---|
id | int | yes |
WorldResourceAccess
Object
| Field | Type | Writable | Description |
|---|---|---|---|
resource | WorldResource | yes | |
mode | int | yes |
PhysicsContact
Object
| Field | Type | Writable | Description |
|---|---|---|---|
a | Entity | yes | |
b | Entity | yes |
Line3
Object
| Field | Type | Writable | Description |
|---|---|---|---|
x0 | float | yes | |
y0 | float | yes | |
z0 | float | yes | |
x1 | float | yes | |
y1 | float | yes | |
z1 | float | yes | |
r | float | yes | |
g | float | yes | |
b | float | yes | |
a | float | yes | |
width | float | yes |
WorldSystemAccess
Object
| Field | Type | Writable | Description |
|---|---|---|---|
profile | type | yes |
WorldSystemFunction
Object
update
fn update(WorldBatch batch, float dt)
WorldSystemDesc
Object
| Field | Type | Writable | Description |
|---|---|---|---|
name | string | yes | |
query | WorldQuery | yes | |
access | WorldSystemAccess? | yes | |
batchSize | int | yes | |
phase | WorldPhase? | yes | |
serial | bool | yes | |
dependencies | array<string>? | yes | |
resources | array<WorldResourceAccess>? | yes | |
reads | array<Component>? | yes | |
writes | array<Component>? | yes | |
handler | WorldSystemHandler? | yes | |
relation | WorldRelationSettings? | yes |
withName infallible
infallible fn withName(string name) -> WorldSystemDesc
withQuery infallible
infallible fn withQuery(WorldQuery query) -> WorldSystemDesc
withAccess infallible
infallible fn withAccess(type profile) -> WorldSystemDesc
withBatchSize infallible
infallible fn withBatchSize(int size) -> WorldSystemDesc
withPhase infallible
infallible fn withPhase(WorldPhase phase) -> WorldSystemDesc
withSerialExecution infallible
infallible fn withSerialExecution(bool serial) -> WorldSystemDesc
withHandler infallible
infallible fn withHandler(WorldSystemHandler handler) -> WorldSystemDesc
withCallback infallible
infallible fn withCallback(
fn(WorldBatch, float) -> void callback) -> WorldSystemDesc
withDependencies infallible
infallible fn withDependencies(array<string> dependencies) -> WorldSystemDesc
withResources infallible
infallible fn withResources(array<WorldResourceAccess> resources) -> WorldSystemDesc
withReads infallible
infallible fn withReads(array<Component> reads) -> WorldSystemDesc
withWrites infallible
infallible fn withWrites(array<Component> writes) -> WorldSystemDesc
withRelationSettings infallible
infallible fn withRelationSettings() -> WorldSystemDesc
withParent infallible
infallible fn withParent(fn(WorldRelationKeys) -> void parentOf) -> WorldSystemDesc
withGroupBy infallible
infallible fn withGroupBy(fn(WorldRelationKeys) -> void keyOf) -> WorldSystemDesc
withRelation infallible
infallible fn withRelation(fn(WorldRelationBlock) -> void test) -> WorldSystemDesc
withBucket infallible
infallible fn withBucket(fn(WorldRelationKeys) -> void keyOf) -> WorldSystemDesc
withCells infallible
infallible fn withCells(
fn(WorldRelationKeys) -> void x,
float cellSize) -> WorldSystemDesc
withCellsXY infallible
infallible fn withCellsXY(
fn(WorldRelationKeys) -> void x,
fn(WorldRelationKeys) -> void y,
float cellSize) -> WorldSystemDesc
withCellsXYZ infallible
infallible fn withCellsXYZ(
fn(WorldRelationKeys) -> void x,
fn(WorldRelationKeys) -> void y,
fn(WorldRelationKeys) -> void z,
float cellSize) -> WorldSystemDesc
withRelationRebuiltEachFrame infallible
infallible fn withRelationRebuiltEachFrame(bool rebuild) -> WorldSystemDesc
Interfaces
WorldEntityFactory
Interface
create
fn create(string kind, float x, float y, float z) -> Entity
WorldServiceHandler
Interface
update
fn update(float dt)
WorldSystemHandler
Interface
update
fn update(WorldBatch batch, float dt)
Functions
Entity infallible
infallible fn Entity(int id) -> Entity
AmmoType infallible
infallible fn AmmoType(int id) -> AmmoType
worldRelationLeftRows infallible
infallible fn worldRelationLeftRows(
WorldRelationBlock block,
type schema,
type access) -> type
worldRelationRightRows infallible
infallible fn worldRelationRightRows(
WorldRelationBlock block,
type schema,
type access) -> type
worldRelationSame infallible
infallible fn worldRelationSame(WorldRelationBlock block) -> bool
worldRelationLink infallible
infallible fn worldRelationLink(
WorldRelationBlock block,
int left,
int right) -> bool
worldRelationKeyRows infallible
infallible fn worldRelationKeyRows(
WorldRelationKeys keys,
type schema,
type access) -> type
worldRelationSetInt infallible
infallible fn worldRelationSetInt(WorldRelationKeys keys, int row, int key) -> bool
worldRelationSetFloat infallible
infallible fn worldRelationSetFloat(
WorldRelationKeys keys,
int row,
float key) -> bool
worldRelationSetEntity infallible
infallible fn worldRelationSetEntity(
WorldRelationKeys keys,
int row,
Entity key) -> bool
worldEntityReadComponent infallible
infallible fn worldEntityReadComponent(
Entity entity,
Component component,
type valueType) -> type
worldEntityWriteComponent infallible
infallible fn worldEntityWriteComponent(
Entity entity,
Component component,
type valueType) -> type
worldEntityRead infallible
infallible fn worldEntityRead(
Entity entity,
Component component,
type valueType) -> type
worldEntityWrite infallible
infallible fn worldEntityWrite(
Entity entity,
Component component,
type valueType) -> type
worldComponentRead infallible
infallible fn worldComponentRead(
Component component,
Entity entity,
type valueType) -> type
worldComponentWrite infallible
infallible fn worldComponentWrite(
Component component,
Entity entity,
type valueType) -> type
worldBatchReadComponent infallible
infallible fn worldBatchReadComponent(
WorldBatch batch,
Component component,
int row,
type valueType) -> type
worldBatchWriteComponent infallible
infallible fn worldBatchWriteComponent(
WorldBatch batch,
Component component,
int row,
type valueType) -> type
worldBatchReadComponents infallible
infallible fn worldBatchReadComponents(
WorldBatch batch,
Component component,
type valueType) -> type
worldBatchWriteComponents infallible
infallible fn worldBatchWriteComponents(
WorldBatch batch,
Component component,
type valueType) -> type
worldQueryRegisterTyped
fn worldQueryRegisterTyped(
string name,
type schema,
type bindings,
array<Component> excluded) -> WorldQuery
worldBatchViews
fn worldBatchViews(WorldBatch batch, type schema, type access) -> type
worldBatchRows infallible
infallible fn worldBatchRows(WorldBatch batch, type schema, type access) -> type
worldSceneActors
fn worldSceneActors() -> array<WorldSceneActor>
worldPhysicsSetVelocity infallible
infallible fn worldPhysicsSetVelocity(Entity entity, float x, float y) -> bool
worldPhysicsAngle infallible
infallible fn worldPhysicsAngle(Entity entity) -> float
worldFactoryRegister
tree worldFactoryRegister(string name, WorldEntityFactory factory)
worldEntityCollectionRegister
tree worldEntityCollectionRegister(string name, int capacity) -> Component
worldEntityCollectionRegisterOwned
tree worldEntityCollectionRegisterOwned(string name, int capacity) -> Component
worldEntityCollectionCount infallible
infallible fn worldEntityCollectionCount(Entity owner, Component collection) -> int
worldEntityCollectionGet infallible
infallible fn worldEntityCollectionGet(
Entity owner,
Component collection,
int index) -> Entity
worldEntityCollectionAdd infallible
infallible fn worldEntityCollectionAdd(
Entity owner,
Component collection,
Entity item) -> bool
worldEntityCollectionRemove infallible
infallible fn worldEntityCollectionRemove(
Entity owner,
Component collection,
int index) -> bool
worldEntityCollectionClear infallible
infallible fn worldEntityCollectionClear(Entity owner, Component collection) -> bool
worldSpriteEngineAnimationDrive
tree worldSpriteEngineAnimationDrive(
Entity entity,
int previous,
bool enabled) -> int
worldAmmoType
fn worldAmmoType(string name) -> AmmoType
worldAmmoTypeName
fn worldAmmoTypeName(AmmoType type) -> string
worldWeaponAddReserve infallible
infallible fn worldWeaponAddReserve(Entity weapon, AmmoType type, int rounds) -> int
worldAmmoStockCount infallible
infallible fn worldAmmoStockCount(Entity owner, AmmoType type) -> int
worldAmmoStockAdd infallible
infallible fn worldAmmoStockAdd(Entity owner, AmmoType type, int rounds) -> int
worldAmmoStockTake infallible
infallible fn worldAmmoStockTake(Entity owner, AmmoType type, int rounds) -> int
worldAmmoStockTransfer infallible
infallible fn worldAmmoStockTransfer(
Entity owner,
Entity weapon,
AmmoType type,
int rounds) -> int
worldWeaponConfigureTyped
tree worldWeaponConfigureTyped(
Entity entity,
WorldWeaponConfig config,
AmmoType type,
int reserveAmmo) -> bool
worldWeaponConfigure
tree worldWeaponConfigure(Entity entity, WorldWeaponConfig config) -> bool
worldWeaponConfigureWithReserve
tree worldWeaponConfigureWithReserve(
Entity entity,
WorldWeaponConfig config,
int reserveAmmo) -> bool
worldWeaponBeginReload
tree worldWeaponBeginReload(Entity entity) -> bool
worldWeaponDrainFires
tree worldWeaponDrainFires(array<Entity> entities) -> int
worldSpatialCircle
tree worldSpatialCircle(Entity entity, WorldSpatialCircle shape) -> bool
worldSpatialProxy
tree worldSpatialProxy(Entity owner, WorldSpatialProxyDesc desc) -> Entity
worldSpatialProxyRemove
tree worldSpatialProxyRemove(Entity handle) -> bool
worldCollisionSweepConfigure
tree worldCollisionSweepConfigure(
Entity entity,
WorldCollisionSweepDesc desc) -> bool
worldCollisionSweepSetEnabled
tree worldCollisionSweepSetEnabled(Entity entity, bool enabled) -> bool
worldShieldRuntimeDefaults
fn worldShieldRuntimeDefaults() -> WorldShieldRuntimeConfig
worldShieldRuntimeConfigure
tree worldShieldRuntimeConfigure(WorldShieldRuntimeConfig config) -> bool
worldShieldInstall
tree worldShieldInstall(Entity host, WorldShieldConfig config) -> Entity
worldShieldRemove
tree worldShieldRemove(Entity host) -> bool
worldShieldSetHostEfficiency
tree worldShieldSetHostEfficiency(Entity host, float efficiency) -> bool
worldShieldImpactSegment
tree worldShieldImpactSegment(
Entity shield,
Vec2 entry,
Vec2 exit,
float radius,
float strength) -> bool
worldShieldAbsorbSegment
tree worldShieldAbsorbSegment(
Entity shield,
Vec2 entry,
Vec2 exit,
float radius,
float energy,
float penetration,
WorldShieldWound wound) -> WorldShieldEnergyHit
worldArmorResolveEnergy
tree worldArmorResolveEnergy(
Entity plate,
Vec2 position,
float projectileRadius,
float materialEnergy,
WorldArmorImpact impact,
Vec2 direction) -> WorldArmorEnergyHit
worldArmorResolveImpact
tree worldArmorResolveImpact(
Entity plate,
Vec2 position,
WorldArmorImpact impact,
Vec2 direction) -> bool
worldServiceRegister
tree worldServiceRegister(
string name,
WorldPhase phase,
WorldServiceHandler handler)
worldEntityAlive infallible
infallible fn worldEntityAlive(Entity entity) -> bool
worldViewFollow infallible
infallible fn worldViewFollow() -> Entity
worldPhysicsHasBody infallible
infallible fn worldPhysicsHasBody(Entity entity) -> bool
worldPhysicsVelocityX infallible
infallible fn worldPhysicsVelocityX(Entity entity) -> float
worldPhysicsVelocityY infallible
infallible fn worldPhysicsVelocityY(Entity entity) -> float
worldPhysicsApplyForce infallible
infallible fn worldPhysicsApplyForce(Entity entity, float x, float y) -> bool
worldPhysicsAngularVelocity infallible
infallible fn worldPhysicsAngularVelocity(Entity entity, float value) -> bool
worldPhysicsConfigure infallible
infallible fn worldPhysicsConfigure(
Entity entity,
float gravity,
float linearDamping,
float angularDamping) -> bool
worldPhysicsWeld infallible
infallible fn worldPhysicsWeld(Entity parent, Entity child, Vec2 offset) -> bool
worldPhysicsConvex
fn worldPhysicsConvex(Entity entity, WorldConvexBody desc) -> int
worldPhysicsRevolute
fn worldPhysicsRevolute(
Entity parent,
Entity child,
WorldRevoluteDesc d) -> WorldJoint
worldPhysicsApplyForceAtPoint infallible
infallible fn worldPhysicsApplyForceAtPoint(
Entity body,
Vec2 force,
Vec2 point) -> bool
vec2 infallible
infallible fn vec2(float x, float y) -> Vec2
rect infallible
infallible fn rect(float x, float y, float w, float h) -> Rect
worldComponentRegister
tree worldComponentRegister(string name, type componentType) -> Component
worldComponentGet
tree worldComponentGet(string name) -> Component
worldComponentFind infallible
infallible fn worldComponentFind(string name) -> Component
worldArchetypeRegister
tree worldArchetypeRegister(
string name,
array<Component> components) -> WorldArchetype
worldArchetypeGet
tree worldArchetypeGet(string name) -> WorldArchetype
worldEntityCreate
tree worldEntityCreate(WorldArchetype archetype) -> Entity
worldEntityDestroy
tree worldEntityDestroy(Entity entity) -> bool
worldEntitySpawn
tree worldEntitySpawn(WorldArchetype archetype) -> bool
worldEntitySetPosition
tree worldEntitySetPosition(Entity entity, float x, float y, float z) -> bool
worldEntityHas
tree worldEntityHas(Entity entity, Component component) -> bool
worldQuery
tree worldQuery(array<Component> components) -> array<Entity>
worldQueryRegister
tree worldQueryRegister(
string name,
array<Component> required,
array<Component> excluded) -> WorldQuery
worldQueryGet
tree worldQueryGet(string name) -> WorldQuery
worldResourceRegister
tree worldResourceRegister(string name) -> WorldResource
worldResourceGet
tree worldResourceGet(string name) -> WorldResource
worldResourceAccess infallible
infallible fn worldResourceAccess(
WorldResource resource,
int mode) -> WorldResourceAccess
worldResourceRead infallible
infallible fn worldResourceRead() -> int
worldResourceWriteExclusive infallible
infallible fn worldResourceWriteExclusive() -> int
worldResourceWriteDeferred infallible
infallible fn worldResourceWriteDeferred() -> int
worldResourceWriteLaneLocal infallible
infallible fn worldResourceWriteLaneLocal() -> int
worldFixedStepCadence infallible
infallible fn worldFixedStepCadence() -> WorldPhaseCadence
worldPerFrameCadence infallible
infallible fn worldPerFrameCadence() -> WorldPhaseCadence
worldPhaseFirst infallible
infallible fn worldPhaseFirst() -> WorldPhasePlacement
worldPhaseLast infallible
infallible fn worldPhaseLast() -> WorldPhasePlacement
worldPhaseBefore infallible
infallible fn worldPhaseBefore(WorldPhase relative) -> WorldPhasePlacement
worldPhaseAfter infallible
infallible fn worldPhaseAfter(WorldPhase relative) -> WorldPhasePlacement
worldPhaseConfig infallible
infallible fn worldPhaseConfig(
string name,
WorldPhaseCadence cadence,
WorldPhasePlacement placement) -> WorldPhaseConfig
worldPhaseAdd
tree worldPhaseAdd(WorldPhaseConfig config) -> WorldPhase
worldPhaseChange
tree worldPhaseChange(WorldPhase phase, WorldPhaseConfig config) -> bool
worldPhaseRemove
tree worldPhaseRemove(WorldPhase phase) -> bool
worldPhaseGet
tree worldPhaseGet(string name) -> WorldPhase
worldSimulationPhase
tree worldSimulationPhase() -> WorldPhase
worldPresentationPhase
tree worldPresentationPhase() -> WorldPhase
worldSystemDesc infallible
infallible fn worldSystemDesc(string name, WorldQuery query) -> WorldSystemDesc
worldSystemRegister
tree worldSystemRegister(WorldSystemDesc description) -> WorldSystem
worldSystemExists infallible
infallible fn worldSystemExists(string name) -> bool
worldBatchLength infallible
infallible fn worldBatchLength(WorldBatch batch) -> int
worldBatchEntity infallible
infallible fn worldBatchEntity(WorldBatch batch, int index) -> Entity
worldBatchHas infallible
infallible fn worldBatchHas(WorldBatch batch, Component component) -> bool
worldPhysicsContacts
tree worldPhysicsContacts() -> array<PhysicsContact>
worldPhysicsCircle
tree worldPhysicsCircle(
Entity entity,
float x,
float y,
float radius,
int bodyType,
bool bullet,
int layer,
int mask) -> int
worldPhysicsCapsule
tree worldPhysicsCapsule(
Entity entity,
Vec2 position,
Vec2 size,
float angle,
bool bullet,
int layer,
int mask) -> int
worldAttachmentSet
tree worldAttachmentSet(
Entity child,
Entity parent,
float x,
float y,
float z,
bool followRotation,
float yawOffset,
float pitchOffset) -> bool
Attaches child to parent so it keeps a position and rotation relative
to the parent as the parent moves. Both entities need the
Attachment component, and a visible child also needs
AttachmentPresentation.
x, y and z are the child's position relative to the parent;
yawOffset and pitchOffset are its rotation relative to the parent, in
radians. With followRotation the relative position turns with the parent
and the relative rotation is added to the parent's rotation; without it
the relative position stays world-aligned and the relative rotation is the
child's whole rotation.
Call it again on an attached child to change its relative position and
rotation; calling it every step is a fine way to animate a part.
Returns false when either entity no longer exists.
worldAttachmentDetach
tree worldAttachmentDetach(Entity child) -> bool
Detaches child from its parent; it stays where it is and moves on its
own again. Returns false when the child no longer exists.
worldPhysicsDestroy
tree worldPhysicsDestroy(int body) -> bool
worldPhysicsSweepEvents
tree worldPhysicsSweepEvents(int body, bool enabled) -> bool
worldPhysicsQueryAabb
tree worldPhysicsQueryAabb(Vec2 center, float halfExtent) -> array<Entity>
worldPhysicsDebugLines
tree worldPhysicsDebugLines(float lineWidth) -> array<Line3>
worldPhysicsDebugDraw infallible
infallible fn worldPhysicsDebugDraw(float lineWidth, bool depthTest) -> bool
worldViewGet
tree worldViewGet() -> WorldView
worldViewSet
tree worldViewSet(WorldView view) -> bool
worldScreenToWorld
tree worldScreenToWorld(Vec2 screen) -> Vec2
worldZoomAt
tree worldZoomAt(Vec2 screen, float steps) -> bool
worldDrawLines
tree worldDrawLines(array<Line3> lines, bool depthTest) -> bool