Skip to content

PhysicsLayer

Narta Xaymar Dirks edited this page Nov 5, 2026 · 1 revision
BlitzLLVM

PhysicsLayer 〔BlitzLLVM〕

PhysicsLayer:Void entity:Int32, layer:Int32, mask_low:Int32=-1, mask_high:Int32=-1
Parameter Mode Type Default Description
entity In Int32 required The body.
layer In Int32 required 0 to 63.
mask_low In Int32 -1 Layers 0 to 31 that it collides with.
mask_high In Int32 -1 Layers 32 to 63 that it collides with.

Description

〔BlitzLLVM〕 This command does not exist in the original Blitz products. BlitzLLVM adds it.

Sets which layer a body is in and which layers it collides with. Two bodies collide only if each one has the layer of the other in its mask. Bodies are in layer 0 and collide with all layers by default.

The mask has a bit for each of the 64 layers, split into two numbers of 32 bits: bit n of mask_low is layer n, bit n of mask_high is layer 32 + n. -1 sets all bits.

Differences

  • The original has no such command. This is an extension; programs that use it do not compile with the original Blitz3D.

Examples

; Ghosts (layer 1) pass through walls (layer 2) but not through each other.
PhysicsLayer ghost, 1, ~(1 Shl 2), -1
PhysicsLayer wall, 2, -1, -1

Related Commands

GetPhysicsLayer 〔BlitzLLVM〕, PhysicsAngularDamping 〔BlitzLLVM〕, PhysicsAngularVelocity 〔BlitzLLVM〕, PhysicsApplyAngularImpulse 〔BlitzLLVM〕, PhysicsApplyForce 〔BlitzLLVM〕, PhysicsApplyForceAt 〔BlitzLLVM〕, PhysicsApplyImpulse 〔BlitzLLVM〕, PhysicsApplyImpulseAt 〔BlitzLLVM〕

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally