Go to file
Jordan Irwin 3b039ef6a1 Update README 2021-08-26 14:02:45 -07:00
models Rename stair models 2021-08-26 13:50:59 -07:00
previews Rename stair models 2021-08-26 13:50:59 -07:00
textures Rename stair models 2021-08-26 13:50:59 -07:00
.cdb.json Update license info in ContentDB config 2021-08-23 18:53:21 -07:00
.gitattributes add double_node model 2021-08-16 23:32:27 -07:00
LICENSE.txt Change code license to MIT 2021-08-23 16:15:35 -07:00
README.md Update README 2021-08-26 14:02:45 -07:00
TODO.txt Support opening/closing colored door-like nodes 2021-08-24 18:03:33 -07:00
api.lua Support opening/closing colored door-like nodes 2021-08-24 18:03:33 -07:00
defs.lua Rename stair models 2021-08-26 13:50:59 -07:00
init.lua Delete global alias "smodel" 2021-08-26 08:50:26 -07:00
mod.conf Change code license to MIT 2021-08-23 16:15:35 -07:00
samples.lua Rename stair models 2021-08-26 13:50:59 -07:00
screenshot.png add double_node model 2021-08-16 23:32:27 -07:00
settingtypes.txt Add sample nodes & setting to enable them 2021-08-23 15:27:48 -07:00

README.md

Simple Models


Description

A set of very simple models for Minetest & API for handling them.


Usage

Models

simple_models_cube_1x2x1:

  • for nodes with dimensions 1x2x1

  • preview:

  • texture map:

simple_models_panel_1x2x1:

  • for door or panel-like nodes with dimensions 1x2x1

  • preview:

  • texture map:

simple_models_panel_mid_1x2x1:

  • for door or panel-like nodes with dimensions 1x2x1 positioned in center
  • texture map: same as simple_models_panel_1x2x1

simple_models_panel_rear_1x2x1:

  • for door or panel-like nodes with dimensions 1x2x1 positioned at rear
  • texture map: same as simple_models_panel_1x2x1

simple_models_stair_2s_1x1x1:

  • for stair-like nodes with dimensions 1x1x1

  • preview:

  • texture map:

simple_models_stair_4s_1x1x1:

  • for stair-like nodes with dimensions 1x1x1

  • preview:

  • texture map:

simple_models_slope_1x1x1:

  • for slope-like nodes with dimensions 1x1x1

  • preview:

  • texture map:

simple_models_slope_1x1x2:

  • for slope-like nodes with dimensions 1x1x2

  • preview:

  • texture map:

Tables

There are some tables for accessing pre-defined attributes:

simple_models.cube_1x2x1:
- fields:
  - mesh: "simple_models_cube_1x2x1.obj"
  - box:  {-0.5, -0.5, -0.5, 0.5, 1.5, 0.5}
- alias: simple_models.cube

simple_models.panel_1x2x1:
- fields:
  - mesh: "simple_models_panel_1x2x1.obj"
  - box:  {-0.5, -0.5, -0.5, 0.5, 1.5, -0.45}
- alias: simple_models.panel

simple_models.panel_mid_1x2x1:
- fields:
  - mesh: "simple_models_panel_mid_1x2x1.obj"
  - box:  {-0.5, -0.5, 0.025, 0.5, 1.5, -0.025}
- alias: simple_models.panel_mid

simple_models.panel_rear_1x2x1:
- fields:
  - mesh: "simple_models_panel_rear_1x2x1.obj"
  - box:  {-0.5, -0.5, 0.45, 0.5, 1.5, 0.5}
- alias: simple_models.panel_rear

simple_models.stair_2s_1x1x1:
- fields:
  - mesh: "simple_models_stair_2s_1x1x1.obj"
  - box:  {{-0.5, 0.0, 0.0, 0.5, 0.5, 0.5}, {-0.5, -0.5, -0.5, 0.5, 0.0, 0.5}}
- alias: simple_models.stair_2s

simple_models.stair_4s_1x1x1x:
- fields:
  - mesh: "simple_models_stair_4s_1x1x1x.obj"
  - box:  {
      {-0.5,  0.25,  0.25, 0.5,  0.5,  0.5},
      {-0.5,  0.0,   0.0,  0.5,  0.25, 0.5},
      {-0.5, -0.25, -0.25, 0.5,  0.0,  0.5},
      {-0.5, -0.5,  -0.5,  0.5, -0.25, 0.5},
    }
- alias: simple_models.stair_4s

simple_models.slope_1x1x1:
- fields:
  - mesh: "simple_models_slope_1x1x1.obj"
  - box:  {
      {-0.5, -0.5,  0.4, 0.5,  0.5, 0.5},
      {-0.5, -0.5,  0.3, 0.5,  0.4, 0.5},
      {-0.5, -0.5,  0.2, 0.5,  0.3, 0.5},
      {-0.5, -0.5,  0.1, 0.5,  0.2, 0.5},
      {-0.5, -0.5,  0.0, 0.5,  0.1, 0.5},
      {-0.5, -0.5, -0.1, 0.5,  0.0, 0.5},
      {-0.5, -0.5, -0.2, 0.5, -0.1, 0.5},
      {-0.5, -0.5, -0.3, 0.5, -0.2, 0.5},
      {-0.5, -0.5, -0.4, 0.5, -0.3, 0.5},
      {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5},
    }
- alias: simple_models.slope

simple_models.slope_1x1x2:
- fields:
  - mesh: "simple_models_slope_1x1x2.obj"
  - box:  {
      {-0.5, -0.5,  0.3, 0.5,  0.5, 0.5},
      {-0.5, -0.5,  0.1, 0.5,  0.4, 0.5},
      {-0.5, -0.5, -0.1, 0.5,  0.3, 0.5},
      {-0.5, -0.5, -0.3, 0.5,  0.2, 0.5},
      {-0.5, -0.5, -0.5, 0.5,  0.1, 0.5},
      {-0.5, -0.5, -0.7, 0.5,  0.0, 0.5},
      {-0.5, -0.5, -0.9, 0.5, -0.1, 0.5},
      {-0.5, -0.5, -1.1, 0.5, -0.2, 0.5},
      {-0.5, -0.5, -1.3, 0.5, -0.3, 0.5},
      {-0.5, -0.5, -1.5, 0.5, -0.4, 0.5},
    }
- alias: simple_models.slope_long

Helper Methods

There are some helper methods to make opening & closing door-like nodes simpler. They take the parameters pos, new_node, & invert. If invert is set to true, doors will swing in the opposite direction:

simple_models:door_inward_open
- Helper method for inward opening door-like nodes.

simple_models:door_inward_close
- Helper method for inward closing door-like nodes.

simple_models.door_outward_open
- Helper method for outward opening door-like nodes.

simple_models.door_outward_close
- Helper method for outward closing door-like nodes.

Example usage:

core.register_node("simple_models:door_l_closed", {
  on_rightclick = function(pos, node, clicker, stack, pointed_thing)
    simple_models:door_inward_open(pos, "simple_models:door_l_open")
    return stack
  end,
})

core.register_node("simple_models:door_r_closed", {
  on_rightclick = function(pos, node, clicker, stack, pointed_thing)
    simple_models:door_inward_open(pos, "simple_models:door_r_open", true)
    return stack
  end,
})

Samples

To use sample nodes, enable the setting simple_models.enable_samples.

Sample nodes include:

  • simple_models:node_tall
  • simple_models:panel
  • simple_models:panel_mid
  • simple_models:panel_rear
  • simple_models:door_l_in_closed
  • simple_models:door_l_in_open
  • simple_models:door_l_out_closed
  • simple_models:door_l_out_open
  • simple_models:stair_2s
  • simple_models:stair_4s
  • simple_models:slope
  • simple_models:slope_long

Licensing