Zum Inhalt

collider_util_serialized

Quelle: base/tealdef/scripts/construction/collider_util_serialized.d.tl

Hinweise

Typen von /scripts/construction/collider_util_serialized.tl (ColliderUtilSerialized): Collider als einfache Tabellen (Quader, Zylinder, Punktwolke) für Konstruktionsergebnisse.

ColliderUtilSerialized

record global base/tealdef/scripts/construction/collider_util_serialized.d.tl:3

global record ColliderUtilSerialized

Laden: local collider_util_serialized = require "::/scripts/construction/collider_util_serialized.tl" as ColliderUtilSerialized

Hinweise

Collider-Helfer, die ug_require "/scripts/construction/collider_util_serialized.tl" zurückgibt.

Funktionen

createBox(center : Vec3Serialized.Vec3, halfExtents : Vec3Serialized.Vec3) : Collider base/tealdef/scripts/construction/collider_util_serialized.d.tl:41

Aufruf: collider_util_serialized.createBox(…)

Create a box collider.

Parameter Typ Beschreibung
center Vec3Serialized.Vec3 center position of the box
halfExtents Vec3Serialized.Vec3 half-extents along each axis

Rückgabe Collider: box collider

Im Basisspiel verwendet: 6-mal in 4 Dateien

base/content/stations/air/air/airfield.script.lua:188

collider_util_serialized.createBox(vec3.new(midPoint, -13, 10), vec3.new(halfSize, 54, 20))
base/content/stations/air/air/airport/airport_modules.script.lua:18
collider_util_serialized.createBox(center, vec3.new(20, 15, 6))
base/content/stations/air/air/airport.script.lua:237
collider_util_serialized.createBox(center, dimensions)
base/content/stations/rail/rail/modular_station/modular_station.script.lua:969
table.insert(result.colliders, collider_util_serialized.createBox(vec3.new(coordI * 5, coordJ * platformLength - 17.5 + l * 5, 4), vec3.new(2.5, 2.5, 5)))

createCylinder(direction? : ColliderUtilSerialized.Direction, center? : Vec3Serialized.Vec3, halfExtents? : Vec3Serialized.Vec3) : Collider base/tealdef/scripts/construction/collider_util_serialized.d.tl:47

Aufruf: collider_util_serialized.createCylinder(…)

Create a cylinder collider.

Parameter Typ Beschreibung
direction? ColliderUtilSerialized.Direction axis direction of the cylinder, default (nil) is z-direction
center? Vec3Serialized.Vec3 center position of the cylinder, default (nil) is origin
halfExtents? Vec3Serialized.Vec3 half-extents along each axis, default (nil) is none

Rückgabe Collider: cylinder collider

createPointCloud(points : {Vec3Serialized.Vec3}) : Collider base/tealdef/scripts/construction/collider_util_serialized.d.tl:51

Aufruf: collider_util_serialized.createPointCloud(…)

Create a point cloud collider.

Parameter Typ Beschreibung
points {Vec3Serialized.Vec3} list of points forming the cloud

Rückgabe Collider: point cloud collider

Im Basisspiel verwendet: 1-mal in 1 Datei

base/content/scripts/scripts/construction/constructionutil.lua:338

local collider = collider_util_serialized.createPointCloud(points)

extrudePoints(points : {Vec3Serialized.Vec3}, offset1 : number, offset2 : number) : {Vec3Serialized.Vec3} base/tealdef/scripts/construction/collider_util_serialized.d.tl:58

Aufruf: collider_util_serialized.extrudePoints(…)

Extrude a list of points by offsetting them along the z-direction. Each point is hence added twice once with offset1 and once with offset2.

Parameter Typ Beschreibung
points {Vec3Serialized.Vec3} input points to extrude
offset1 number offset for first set of extruded points
offset2 number offset for second set of extruded points

Rückgabe {Vec3Serialized.Vec3}: extruded point list

ColliderUtilSerialized.Collider

record base/tealdef/scripts/construction/collider_util_serialized.d.tl:4

record Collider

Hinweise

Eine Kollisionsform einer Konstruktion als einfache Tabelle mit type, transf und params.

Im Basisspiel verwendet: 7-mal in 2 Dateien

base/content/landmarks/hq/hq/headquarter.script.tl:363

local coll : ColliderUtilSerialized.Collider = {}
base/content/scripts/scripts/construction/collider_util_serialized.tl:6
collider_util_serialized.createBox = function(center : Vec3Serialized.Vec3, halfExtents : Vec3Serialized.Vec3) : ColliderUtilSerialized.Collider

Felder

Name Typ Beschreibung
type Type Form des Colliders.
transf Mat4Serialized.Mat4 Transform matrix of collider
params Params Shape parameters of collider

ColliderUtilSerialized.Collider.Type

enum base/tealdef/scripts/construction/collider_util_serialized.d.tl:5

enum Type

Hinweise

Form eines Colliders.

Wert Beschreibung
"NONE" No collider shape
"BOX" Box-shaped collider
"CYLINDER" Cylinder-shaped collider
"POINT_CLOUD" Point cloud collider

ColliderUtilSerialized.Collider.Params

record base/tealdef/scripts/construction/collider_util_serialized.d.tl:16

record Params

Hinweise

Formparameter; welches Feld gilt, hängt von type ab.

Felder

Name Typ Beschreibung
halfExtents Vec3Serialized.Table3 Half-extents of the box or cylinder (x, y, z)
points {Vec3Serialized.Table3} Points used for a point cloud collider

ColliderUtilSerialized.Direction

enum base/tealdef/scripts/construction/collider_util_serialized.d.tl:30

enum Direction

Hinweise

Achse eines Zylinder-Colliders; ohne Achse (nil) zeigt der Zylinder entlang Z.

Im Basisspiel verwendet: 1-mal in 1 Datei

base/content/scripts/scripts/construction/collider_util_serialized.tl:23

collider_util_serialized.createCylinder = function(direction : ColliderUtilSerialized.Direction, center : Vec3Serialized.Vec3, halfExtents : Vec3Serialized.Vec3

Wert Beschreibung
"X" Along the X axis
"Y" Along the Y axis