Skip to main content

Collision

Client Server

Deprecated

The collision functions in this class are old and may not correctly work. Instead use Cast:Ray() and Collide()

Constructors​

Collision Collision()​

Methods​

Hit[] Raycast()​

Use rayPos, rayDir, returns table of Hit values or empty table for no hit. Returns Hit.

Hit[] Raycast(boolean readColor, boolean readNormal, boolean readMaterial)​

Hit[] Raycast(Vec3 pos, Vec3 dir)​

Hit[] Raycast(Vec3 pos, Vec3 dir, boolean? readColor, boolean? readNormal, boolean? readMaterial)​

table RaycastTo(Vec3 startPos, Vec3 endPos, boolean? readColor, boolean? readNormal, boolean? readMaterial)​

Overlap[] GetOverlap(Shape? shape)​

Checks collision between shape and geometry passed by filter. Returns Overlap.

Properties​

Filter filter​

integer maxHitCount​

Doesn't influence result, just limits returned hits table size

Shape shape​

boolean precise​

Vec3 rayPos​

Vec3 rayDir​