Stormworks: Build and Rescue

Stormworks: Build and Rescue

Недостаточно оценок
Synthetic Vision MC
   
Наградить
В избранное
В избранном
Удалить
Метки: v1.15.1
Размер файла
Добавлен
Изменён
81.707 KB
23 дек. 2022 г. в 5:34
29 июл в 8:00
Обновлений: 6 (просмотреть)

Подпишитесь, чтобы загрузить
Synthetic Vision MC

Описание
The microcontroller for synthetic vision, which is used in this vehicle: Synthetic Vision (Augmented Reality)

A simpler bare-bone setup compared to the flying vehicle.
Code [github.com]


Property
Example_Value
Description
Head Mounted Display (HMD)
on
Initially whether to start displaying for HMD or not. Can dynamically change and is connected to a XOR gate in MC.
Do Not Auto Switch HMD
off
If Auto Switching HMD then you can connect 2 screens with same video link in which one is HMD and another is not, then when changing whether to display HMD it is automatically choosing in onDraw() in script. If 'on' then manually change video switching between screens. Can be dynamically changed in MC at runtime.
HMD
256, 192, 128, 96, 128, 96, -345.6
width, height, width/2, height/2, width/2, height/2, -height/math.tan(1.014197/2). Constant values for HMD screen. Last value is a constant used for pixel culling. Here to save script chars and shouldn't be changed.
w, h
96, 96
Pixel width and height of non-HMD screen.
near, far
0.25, 3000
near is the distance from the end of (compact) seat model to the screen in meters. I.e. how many blocks between (compact) seat and screen divided by 4. far is the render distance. HMD doesn't use near.
sizeX|Y
0.71, 0.71
Physical sizeX|Y / width|height of screen in meters. (Important that it is the actual screen part with pixels and not model block size. Not used by HMD) Pre-values[github.com]
posOffsetX|Y
0, 0.01
Physical offset in the screen XY plane along X:right, Y:up in meters. (For example the HUD screen is 0.01 m offset in the model upwards. Not used by HMD).
pxOffsetX|Y
0, 0
Optional pixel offset. Not used by HMD
drawWireframe
off
Whether to initially draw triangles in wireframe mode. Can be dynamically changed in MC and is by default connected to a XOR gate.
W
(255, 50, 255), (0, 0, 255)
RGB color gradient for triangles underwater. Triangle color is set by triangles normal vector y-value with lerp between colors in config, i.e. how steep is triangle. Minimum 6 values and add with multiples of 3 values i.e. RGB.
G
(150, 0, 100), (170, 70, 0), (255, 140, 0), (255, 245, 0), (0, 255, 0)
RGB color gradient for triangles over water, i.e. ground.
GPS_to_camera
0.25, 1, -1
Offset from center physics sensor block to center seat headrest block. (X:right, Y:up, Z:forward. Relative to Physics Sensor orientation)
PhysicsTick
4
Tick compensation of Physics Sensor due to tick delay in microcontroller. Predicting vehicle linear motion and rotation.
SeatTick
5
Tick compensation of for seat lookX|Y values due to tick delay in microcontroller.
Mouse (Vel, Acc, Jerk) Smoothing
0.9, 0.95, 1
Smoothing values between 0-1, where 0 is raw prediction and upto 1 is smoothing, where exact 1 is disabled. Don't mind Jerk as it's mostly just jitter.
MaxDrawnTriangles
4000
Max Drawn Triangles. Will cap the amount of rendered triangles. If exceeded then it will try and shuffle some of the capped off triangles into the buffer range.
TriangleBufferRefresh
15
Triangle Buffer Refreshrate. Number of ticks/frames before the buffer refreshes by culling a ball-tree data structure of inserted triangles.
MaxTriangleSizeSquared
90000
Max Triangle Size Squared. The threshold for the max accepted size of a triangle, in which it is the 2D minimum enclosing circle radius of triangle squared, which is used as size comparison.
MinPointDist
10
The minimum threshold for the distance between nearest neighbor/point in point cloud (in 3D), which is used when trying to add new point. Other interpretation then the minimum allowed triangle side length.
FlatTerrainPointDist
200
Try and keep 'MinPointDist' at a larger value when nearby points height doesn't change much. To optimize for less triangles.
PixelSizeCulling
7
When a 'batch of triangles' minimum sphere size projected onto the screen is less than threshold then remove some of the triangles in batch. A 'batch' is 4-7 triangles stored in leaf node of ball-tree.
MinPointAlt
-1
Clamp points minimum height value. To disable then choose a large negative value. Choose a negtive value near 0 if you don't care about the details of the seabed.


Laser Property
Example_Value
Description
LaserSum, tickDelay, PointOUTSum, OutBufferSize
7, 6, 5, 32
LaserSum: The amount of used lasers, max possible is 16. tickDelay: The microcontroller tick compensation. PointOUTSum: Max xyz points output at once, max possible for laser system is 10, but max input to triangulation is 5. OutBufferSize: Buffer storage if output is saturated.
Laser Config: gpsOffset[x,y,z], fwrdDir[x,y,z], rghtDir[x,y,z], spread[L,R,B,T], minRange[n]
(Property is not used and only description)
For each active laser then a property of "LaserN" where 'N' is the enumeration and holds value containing the offset from physics sensor to center of the laser head block. The forward direction and right direction of laser orientation. The laser xy pivot has a output of x:(-1,1), y:(-1,1) and spread is capping those bounds. The minimum accepted range, for example to hinder scanning own vehicle.
Laser1
(-0.25, 0, 0.75), (0, 0, 1), (1, 0, 0), (-0.4, 0.4, -0.5, 0.8), 1
Laser2
(0.25, 0, 0.75), (0, 0, 1), (1, 0, 0), (-0.3, 0.3, -0.3, 0.2), 1
Laser...
...
Комментариев: 9
Jumper  [создатель] 29 июл в 9:23 
Updated to work with HMD and some extra features.
Jumper  [создатель] 15 фев в 11:41 
Don't feel like trying atm, so don't expect any time soon
Peppie 13 фев в 7:38 
Would be sick if this could work with the new HMD update.
DangerInstructor 24 дек. 2024 г. в 9:32 
On multiplayer it works for a bit then throws a tick error "attempted to perform arithmatic on nil value (Field "?")
Vergil Sparda 7 мар. 2023 г. в 7:34 
"(Description/explanation is to be updated)"
We belive.
DE Baumstamm 8 янв. 2023 г. в 9:41 
thanks
Jumper  [создатель] 8 янв. 2023 г. в 9:32 
You can use this: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2907355026
as reference for setup. Screen alpha is just a value from 0-255 for the color alpha value.
DE Baumstamm 8 янв. 2023 г. в 9:30 
how do i get laser compass, laser tilt foward and screen alpha
bongokat 27 дек. 2022 г. в 0:11 
Nice!