Class ModelAsset

java.lang.Object
net.risingworld.api.assets.Asset
net.risingworld.api.assets.ModelAsset

public final class ModelAsset extends Asset
Represents a 3D model file. A model typically consists of a single mesh.
Supported file formats: zip, fbx, obj, stl, ply, 3mf, gltf
  • Field Details

    • Cube

      public static final ModelAsset Cube
      A box
    • CubeDoubleSided

      public static final ModelAsset CubeDoubleSided
      An double-sided box
    • CubeFrame

      public static final ModelAsset CubeFrame
      The frame / edges of a box
    • Sphere

      public static final ModelAsset Sphere
      A sphere
    • Cylinder

      public static final ModelAsset Cylinder
      A cylinder
    • Quad

      public static final ModelAsset Quad
      A quad with a size of 1x1, facing forward (z)
    • Plane

      public static final ModelAsset Plane
      A quad with a size of 1x1, facing upwards (y)
    • ArrowForward

      public static final ModelAsset ArrowForward
      An arrow with a length of 1, facing forward (towards Z)
    • ArrowBack

      public static final ModelAsset ArrowBack
      An arrow with a length of 1, facing backward (towards -Z)
    • ArrowRight

      public static final ModelAsset ArrowRight
      An arrow with a length of 1, facing right (towards X)
    • ArrowLeft

      public static final ModelAsset ArrowLeft
      An arrow with a length of 1, facing left (towards -X)
    • ArrowUp

      public static final ModelAsset ArrowUp
      An arrow with a length of 1, facing up (towards Y)
    • ArrowDown

      public static final ModelAsset ArrowDown
      An arrow with a length of 1, facing down (towards -Y)
  • Method Details

    • loadFromGame

      public static ModelAsset loadFromGame(String path)
      Loads a mesh from the game assets. This is quite efficient because the server doesn't have to send any data to the clients.
      Parameters:
      path - the path to the game mesh / model.
      Returns:
      a new model asset instance.
    • loadFromFile

      public static ModelAsset loadFromFile(String file)
      Loads a model from a file.
      Parameters:
      file - the path to the model file.
      Returns:
      a new model asset instance.
    • loadFromFile

      public static ModelAsset loadFromFile(String file, ModelImportSettings settings)