fixed nan propogation error
authorhgn <hgodden00@gmail.com>
Tue, 6 Jun 2023 03:41:39 +0000 (04:41 +0100)
committerhgn <hgodden00@gmail.com>
Tue, 6 Jun 2023 03:41:39 +0000 (04:41 +0100)
camera.h
skeleton.h
web/board_spec.html [deleted file]
web/guide.html [deleted file]
web/workshop/board_spec.html [new file with mode: 0644]
web/workshop/custom_board.zip [new file with mode: 0644]
web/workshop/guide.html [new file with mode: 0644]
web/workshop/guide1.jpg [new file with mode: 0644]
web/workshop/guide2.jpg [new file with mode: 0644]
web/workshop/guide3.jpg [new file with mode: 0644]

index 6fcd2fc161e24b42be6701e73971fb8642fb5e9e..f028f825e67ef227119af309e365c2b49f494776 100644 (file)
--- a/camera.h
+++ b/camera.h
@@ -16,8 +16,7 @@ struct camera
    m4x3f transform,
          transform_inverse;
 
-   struct camera_mtx
-   {
+   struct camera_mtx{
       m4x4f p,
             v,
             pv;
@@ -25,7 +24,7 @@ struct camera
    mtx,
    mtx_prev;
 }
-VG_STATIC main_camera, gate_camera;
+static main_camera, gate_camera;
 
 VG_STATIC void camera_lerp_angles( v3f a, v3f b, float t, v3f d )
 {
index 79e80171b2acc49935c11ac5ad973122b3bf54e1..052975239bd6988290a2c731b8d4d4565fdc4b7a 100644 (file)
@@ -437,6 +437,11 @@ VG_STATIC void skeleton_alloc_from( struct skeleton *skele,
    skele->ik         = vg_linear_alloc( lin_alloc, ik_size );
    skele->final_mtx  = vg_linear_alloc( lin_alloc, mtx_size );
    skele->anims      = vg_linear_alloc( lin_alloc, anim_size );
+
+   memset( skele->bones, 0, bone_size );
+   memset( skele->ik, 0, ik_size );
+   memset( skele->final_mtx, 0, mtx_size );
+   memset( skele->anims, 0, anim_size );
 }
 
 VG_STATIC void skeleton_fatal_err(void)
diff --git a/web/board_spec.html b/web/board_spec.html
deleted file mode 100644 (file)
index f86fc77..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
-  <style type="text/css">
-   body{
-    margin:40px auto;
-    max-width:650px;
-    line-height:1.6;
-    font-size:18px;
-    color:#444;
-    padding:0 10px
-   }
-   h1,h2,h3{line-height:1.2}
-  </style>
- </head>
-
- <body>
-  <h1>Custom board specification</h1>
-  <p>Refer to this page if you want to make a completely new board from scratch,
-  otherwise use the template file.<br>
-  <br>
-  The board system looks for marker entities. These can be applied using the 
-  entity tab in the skaterift exporter panel.</p>
-  <h3>The aliases used for the marker meshes:</h3>
-  <p>
-  <b>board</b><br>
-  <b>truck</b> (x2)<br>
-  <b>wheel</b> (x4)<br>
-  <br>
-  The scale of each part should be 1,1,1, and have no rotation.<br>
-  Origins should be correctly placed at the place where the items are joined to 
-  eachother, refer to the diagram for the placement and size.
-  </p>
- </body>
-</html>
diff --git a/web/guide.html b/web/guide.html
deleted file mode 100644 (file)
index 4f1a907..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
-  <style type="text/css">
-   body{
-    margin:40px auto;
-    max-width:650px;
-    line-height:1.6;
-    font-size:18px;
-    color:#444;
-    padding:0 10px
-   }
-   h1,h2,h3{line-height:1.2}
-  </style>
- </head>
-
- <body>
-  <h1>Workshop Guide - Custom boards</h1>
-
-  <h2>Installing Blender</h2>
-  <p>You can get the latest version of 
-  <a href="link to blender">blender from steam</a>, this guide is for version
-  3.4 and above.</p>
-
-  <h2>Installing exporter addon</h2>
-  <p>Skaterift comes with the addon in its game files, we just need to install
-  it. This addon script gets updated between skaterift versions.<br>
-  <br>
-  To install, go to [TODO]options > preferences, then to the addons section.<br>
-  [TODO] Add image here<br>
-  [TODO]Now, select install from file, and browse to the skaterift game 
-  files.<br>
-  If you don't know where to find those, you can go into [TODO]steam and 
-  rightclick Skaterift, and browse game files.<br>
-  [TODO] Add image here<br>
-  Now just search for Skate rift in the addons panel, and enable the addon.<br>
-  [TODO] Add image here</p>
-  <hr>
-
-  <h2>Configuring the addon</h2>
-  <p>Open the [TODO] tools tab by pressing N, and click the SkateRift section
-  <br>
-  Next set the output directory to be the game folder<br>
-  [TODO] Add image here</p>
-  <hr>
-
-  <h2>Open the template</h2>
-  <p>Again in the tools folder, you will find a template .blend file for a
-  custom board. Open this to get started<br>
-  [TODO] Add image here<br>
-  An optional step here is to edit the board model, or create one from scratch.
-  <br>If you want to do this, <a href="board_spec.html">take a look at the 
-  detailed board specification</a> for how to set it up. If its your first one,
-  you probably want to skip this step.</p>
-  <hr>
-
-  <h2>Edit the texture</h2>
-  <p>Next step is to customize the artwork, in the template folder there is a
-  texture which you can edit. There is also the original .xcf file which you can
-  open using <a href="Link to gimp">GNU Gimp</a>, or a similar image editor.<br>
-  [TODO] Add image here</br>
-  Now you can change the texture on the material to your own file, and see how
-  it looks in Blender.
-  </p>
-  <hr>
-
-  <h2>Compile the model</h2>
-  <p>Rename the collection name, called boards/[template]/board.mdl, to
-  whatever you would like. The collection name is the path it will export the
-  model, relative to the directory we set earlier.<br>
-  <br>
-  Now in the Skaterift tab in the viewport, we can compile the model.
-  </p>
-  <hr>
-
-  <h2>Test it out in-game</h2>
-  <p>If everything is good, you should be able to visit the board shop and it
-  will be loaded in there.<br>
-  [TODO] add image here
-  </p>
-  <hr>
-  
-  <h2>Upload via the Workshop tool</h2>
-  <p>From the menu of Skaterift, you can open the
-  workshop tool. From here, fill in the folder name which houses the board. This
-  is relative to the game folder just like the export tool. You will know its
-  correct when you see your board after pressing the load button.<br>
-  [TODO] Image of setting the path<br>
-  From here, just fill in the information like the title and description, and
-  press submit.
-  </p>
- </body>
-</html>
diff --git a/web/workshop/board_spec.html b/web/workshop/board_spec.html
new file mode 100644 (file)
index 0000000..f86fc77
--- /dev/null
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+ <head>
+  <style type="text/css">
+   body{
+    margin:40px auto;
+    max-width:650px;
+    line-height:1.6;
+    font-size:18px;
+    color:#444;
+    padding:0 10px
+   }
+   h1,h2,h3{line-height:1.2}
+  </style>
+ </head>
+
+ <body>
+  <h1>Custom board specification</h1>
+  <p>Refer to this page if you want to make a completely new board from scratch,
+  otherwise use the template file.<br>
+  <br>
+  The board system looks for marker entities. These can be applied using the 
+  entity tab in the skaterift exporter panel.</p>
+  <h3>The aliases used for the marker meshes:</h3>
+  <p>
+  <b>board</b><br>
+  <b>truck</b> (x2)<br>
+  <b>wheel</b> (x4)<br>
+  <br>
+  The scale of each part should be 1,1,1, and have no rotation.<br>
+  Origins should be correctly placed at the place where the items are joined to 
+  eachother, refer to the diagram for the placement and size.
+  </p>
+ </body>
+</html>
diff --git a/web/workshop/custom_board.zip b/web/workshop/custom_board.zip
new file mode 100644 (file)
index 0000000..a7db977
Binary files /dev/null and b/web/workshop/custom_board.zip differ
diff --git a/web/workshop/guide.html b/web/workshop/guide.html
new file mode 100644 (file)
index 0000000..1dfa39c
--- /dev/null
@@ -0,0 +1,111 @@
+<!DOCTYPE html>
+<html>
+ <head>
+  <style type="text/css">
+   body{
+    margin:40px auto;
+    max-width:650px;
+    line-height:1.6;
+    font-size:18px;
+    color:#444;
+    padding:0 10px
+   }
+   h1,h2,h3{line-height:1.2}
+  </style>
+ </head>
+
+ <body>
+  <h1>Workshop Guide - Custom boards</h1>
+  <p>This guide covers creating a custom board model using blender and an image
+  editor. Since theres not many of us here at the moment, feel free to contact
+  me at <i>hgodden00@gmail.com</i> for any help.</p>
+
+  <h2>0. Things you need</h2>
+  <p>- Skaterift content is made using Blender. You can get the latest version 
+  of <a href="https://store.steampowered.com/app/365670/Blender/">
+     Blender from steam</a>, this guide is for version 3.4 and above.<br>
+  - <a href="https://www.gimp.org/">GNU Gimp</a> or similar image editor.<br>
+  - Download the <a href="custom_board.zip">custom_board.zip</a><br>
+  - An installed copy of Skaterift of course.</p>
+  <hr>
+
+  <h2>1. Installing exporter addon</h2>
+  <p>Skaterift comes with the addon in its game files, we just need to install
+  it. This addon script gets updated between skaterift versions. Here are the
+  steps to install it into Blender:<br>
+  <br>
+  Go to <b>edit&gt;preferences</b>, and open the <b>addons section.</b><br>
+  <br>
+  Press the <b>install...</b> button at the top right, and browse to the 
+  Skaterift game files. Inside the folder named <b>tools</b> is the script 
+  <b>blender_export.py</b> to install.<br>
+  <br>
+  If you don't know where it is, you can go into your Steam Library, and 
+  rightclick Skaterift, selecting <b>Manage&gt;Browse local files.</b><br>
+  <br>
+  Now just search for Skaterift .mdl exporter from the addons list, and enable 
+  it.<br>
+  <hr>
+
+  <h2>2. Configuring the template</h2>
+  <p>Firstly, Open the .blend file from the board_template zip.<br>
+  <br>
+  Open the side panel in the 3D Viewport, and find the Skaterift tab, and in 
+  that menu, the <b>Export tab</b><br>
+  <br>
+  <b>Export Dir</b> must be set to the game folder, which ends in 
+  <i>/steamapps/common/skaterift<b>/</b></i><br>
+  <b>NOTE:</b> the path must have a
+  <b>/</b> at the end, else things will break.<br>
+  <br>
+  Wer're now setup to go, but an optional step here is to create one from 
+  scratch. If you want to do this, <a href="board_spec.html">take a look at the 
+  detailed board specification</a> for how to set it up. If its your first one,
+  you probably want to skip this step.</p>
+  <hr>
+
+  <h2>3. Edit the texture</h2>
+  <p>Next step is to customize the artwork, in the template folder there is a
+  texture which you can edit. There is also the original .xcf file which you can
+  open using <a href="https://www.gimp.org/">GNU Gimp</a>, or a similar image 
+  editor.<br>
+  <img src="guide2.jpg" width="100%"/>
+  Now you can change the texture on the material to your own file, and see how
+  it looks in Blender.
+  <img src="guide1.jpg" width="100%"/>
+  </p>
+  <hr>
+
+  <h2>4. Compile the model</h2>
+  <p>In the <b>Outliner</b> panel in the top right, rename the collection name, 
+  called <i>boards/template/board.mdl</i>. You should replace only the word 
+  <b></i>template</i></b>. The collection name is the path it will export the
+  model, relative to the directory we set earlier.<br>
+  <br>
+  Now in the Skaterift Export tab, press Compile This collection. <b>NOTE: 
+  Blender will freeze for a second or so, since the export script has to 
+  compress the texture file.</b><br>
+  </p>
+  <hr>
+
+  <h2>5. Test it out in-game</h2>
+  <p>If everything is good, you should be able to visit the board shop and it
+  will be loaded in there. If not, try reopen it. If still not not, then
+  something broke, and there is no contingency plan here, sorry.<br>
+  </p>
+  <hr>
+  
+  <h2>6. Upload via the Workshop tool</h2>
+  <p>From the menu of Skaterift, you can open the
+  workshop tool. From here, fill in the folder name which houses the board. This
+  is relative to the game folder just like the export tool. You will know its
+  correct when you see your board after pressing the load button.<br>
+  <img src="guide3.jpg" width="100%"/>
+  <br>
+  You can customize the preview by dragging around the image, left, right and 
+  middle mouse buttons do different controls.
+  From here, just fill in the information like the title and description, and
+  press submit.
+  </p>
+ </body>
+</html>
diff --git a/web/workshop/guide1.jpg b/web/workshop/guide1.jpg
new file mode 100644 (file)
index 0000000..acbfc7f
Binary files /dev/null and b/web/workshop/guide1.jpg differ
diff --git a/web/workshop/guide2.jpg b/web/workshop/guide2.jpg
new file mode 100644 (file)
index 0000000..4e51f49
Binary files /dev/null and b/web/workshop/guide2.jpg differ
diff --git a/web/workshop/guide3.jpg b/web/workshop/guide3.jpg
new file mode 100644 (file)
index 0000000..06dc2d9
Binary files /dev/null and b/web/workshop/guide3.jpg differ