Skip to main content

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

FieldTypeWritableDescription
parentint32no
depthint32no
groupStartint32no
groupLengthint32no

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

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

FieldTypeWritableDescription
move_scalefloat32yes
turn_scalefloat32yes

Weapon​

Native struct

FieldTypeWritableDescription
fire_intervalfloat32yes
cooldownfloat32yes
trigger_heldboolyes
auto_reloadboolyes
ammoint32yes
magazine_sizeint32yes
reserve_ammoint32yes
ammo_typeAmmoTypeno
reload_timefloat32yes
reload_timerfloat32yes

PositionX​

Native struct

FieldTypeWritableDescription
valuefloat32yes

PositionY​

Native struct

FieldTypeWritableDescription
valuefloat32yes

PositionZ​

Native struct

FieldTypeWritableDescription
valuefloat32yes

Rotation​

Native struct

FieldTypeWritableDescription
radiansfloat32yes

Pitch​

Native struct

FieldTypeWritableDescription
radiansfloat32yes

VelocityX​

Native struct

FieldTypeWritableDescription
valuefloat32yes

VelocityY​

Native struct

FieldTypeWritableDescription
valuefloat32yes

VelocityZ​

Native struct

FieldTypeWritableDescription
valuefloat32yes

AngularVelocity​

Native struct

FieldTypeWritableDescription
valuefloat32yes

Thrust​

Native struct

FieldTypeWritableDescription
valuefloat32yes

Damage​

Native struct

FieldTypeWritableDescription
amountfloat32yes

WorldFloatComponent​

Native struct

FieldTypeWritableDescription
valuefloat32yes

WorldIntComponent​

Native struct

FieldTypeWritableDescription
valueintyes

WorldBoolComponent​

Native struct

FieldTypeWritableDescription
valueboolyes

Health​

Native struct

FieldTypeWritableDescription
currentfloat32yes
maxfloat32yes

WorldRelationTest​

Object

WorldRelationKey​

Object

WorldRelationSettings​

Object

FieldTypeWritableDescription
kindintyes
broadphaseintyes
cellSizefloatyes
rebuildEachFrameboolyes
keyWorldRelationKey?yes
testWorldRelationTest?yes
bucketWorldRelationKey?yes
cellXWorldRelationKey?yes
cellYWorldRelationKey?yes
cellZWorldRelationKey?yes

WorldSceneActor​

Object

FieldTypeWritableDescription
kindstringyes
xfloatyes
yfloatyes
zfloatyes

WorldWeaponConfig​

Object

FieldTypeWritableDescription
fireIntervalfloatyes
magazineSizeintyes
reloadTimefloatyes
autoReloadboolyes

WorldSpatialCircle​

Object

FieldTypeWritableDescription
radiusfloatyes
layerintyes
maskintyes
tagintyes

WorldSpatialProxyDesc​

Object

FieldTypeWritableDescription
localXfloatyes
localYfloatyes
localZfloatyes
radiusfloatyes
layerintyes
maskintyes
tagintyes

WorldCollisionSweepDesc​

Object

FieldTypeWritableDescription
startXfloatyes
startYfloatyes
radiusfloatyes
forwardExtensionfloatyes
layerintyes
maskintyes
enabledboolyes
ignoreSourceboolyes

WorldColor3​

Object

FieldTypeWritableDescription
rfloatyes
gfloatyes
bfloatyes

WorldShieldRuntimeConfig​

Object

FieldTypeWritableDescription
collisionLayerintyes
spatialTagintyes
renderLayerfloatyes

WorldShieldConfig​

Object

FieldTypeWritableDescription
radiusfloatyes
strengthfloatyes
shellInnerfloatyes
healDelayfloatyes
tintWorldColor3yes
interceptMaskintyes

WorldShieldWound​

Object

FieldTypeWritableDescription
minimumRadiusfloatyes
radiusPerSqrtEnergyfloatyes
maximumRadiusfloatyes

WorldShieldEnergyHit​

Object

FieldTypeWritableDescription
hitboolyes
stoppedboolyes
absorbedfloatyes
remainingfloatyes
damageRadiusfloatyes

WorldArmorImpact​

Object

FieldTypeWritableDescription
radiusfloatyes
strengthfloatyes
hardnessfloatyes
heatfloatyes

WorldArmorEnergyHit​

Object

FieldTypeWritableDescription
hitboolyes
stoppedboolyes
absorbedfloatyes
remainingfloatyes
resistancefloatyes
splitboolyes

WorldConvexBody​

Object

FieldTypeWritableDescription
pointsarray<Vec2>yes
densityfloatyes
bodyTypeintyes
layerintyes
maskintyes

WorldRevoluteDesc​

Object

FieldTypeWritableDescription
anchorAVec2yes
anchorBVec2yes
referenceAnglefloatyes
limitsEnabledboolyes
lowerAnglefloatyes
upperAnglefloatyes
springHertzfloatyes
dampingRatiofloatyes
motorEnabledboolyes
motorSpeedfloatyes
maxMotorTorquefloatyes
collideConnectedboolyes

WorldJoint​

Object

FieldTypeWritableDescription
idintyes

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

FieldTypeWritableDescription
xfloatyes
yfloatyes

Rect​

Object

FieldTypeWritableDescription
xfloatyes
yfloatyes
wfloatyes
hfloatyes

WorldView​

Object

FieldTypeWritableDescription
boundsRectyes
followEntityEntityyes

WorldTransform2​

Object

FieldTypeWritableDescription
xfloatyes
yfloatyes
yawfloatyes
cosYawfloatyes
sinYawfloatyes

Component​

Object

FieldTypeWritableDescription
idintyes

read infallible​

infallible fn read(Entity entity, type valueType) -> type

write infallible​

infallible fn write(Entity entity, type valueType) -> type

WorldArchetype​

Object

FieldTypeWritableDescription
idintyes

WorldQuery​

Object

FieldTypeWritableDescription
idintyes

WorldSystem​

Object

FieldTypeWritableDescription
idintyes

WorldPhase​

Object

FieldTypeWritableDescription
idintyes

WorldPhaseCadence​

Object

FieldTypeWritableDescription
fixedStepboolyes

WorldPhasePlacement​

Object

FieldTypeWritableDescription
relationintyes
relativeWorldPhaseyes

WorldPhaseConfig​

Object

FieldTypeWritableDescription
namestringyes
cadenceWorldPhaseCadenceyes
placementWorldPhasePlacementyes

WorldResource​

Object

FieldTypeWritableDescription
idintyes

WorldResourceAccess​

Object

FieldTypeWritableDescription
resourceWorldResourceyes
modeintyes

PhysicsContact​

Object

FieldTypeWritableDescription
aEntityyes
bEntityyes

Line3​

Object

FieldTypeWritableDescription
x0floatyes
y0floatyes
z0floatyes
x1floatyes
y1floatyes
z1floatyes
rfloatyes
gfloatyes
bfloatyes
afloatyes
widthfloatyes

WorldSystemAccess​

Object

FieldTypeWritableDescription
profiletypeyes

WorldSystemFunction​

Object

update​

fn update(WorldBatch batch, float dt)

WorldSystemDesc​

Object

FieldTypeWritableDescription
namestringyes
queryWorldQueryyes
accessWorldSystemAccess?yes
batchSizeintyes
phaseWorldPhase?yes
serialboolyes
dependenciesarray<string>?yes
resourcesarray<WorldResourceAccess>?yes
readsarray<Component>?yes
writesarray<Component>?yes
handlerWorldSystemHandler?yes
relationWorldRelationSettings?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

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