Package net.risingworld.api.assets
Class ModelAsset
java.lang.Object
net.risingworld.api.assets.Asset
net.risingworld.api.assets.ModelAsset
Represents a 3D model file. A model typically consists of a single mesh.
Supported file formats: zip, fbx, obj, stl, ply, 3mf, gltf
Supported file formats: zip, fbx, obj, stl, ply, 3mf, gltf
-
Nested Class Summary
Nested classes/interfaces inherited from class net.risingworld.api.assets.Asset
Asset.Source, Asset.Type -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ModelAssetAn arrow with a length of 1, facing backward (towards -Z)static final ModelAssetAn arrow with a length of 1, facing down (towards -Y)static final ModelAssetAn arrow with a length of 1, facing forward (towards Z)static final ModelAssetAn arrow with a length of 1, facing left (towards -X)static final ModelAssetAn arrow with a length of 1, facing right (towards X)static final ModelAssetAn arrow with a length of 1, facing up (towards Y)static final ModelAssetA boxstatic final ModelAssetA double-sided boxstatic final ModelAssetThe frame / edges of a boxstatic final ModelAssetA cylinderstatic final ModelAssetA quad with a size of 1x1, facing upwards (y)static final ModelAssetA quad with a size of 1x1, facing forward (z)static final ModelAssetA sphereFields inherited from class net.risingworld.api.assets.Asset
DEFAULT_EXTENSION -
Method Summary
Modifier and TypeMethodDescriptionstatic ModelAssetloadFromFile(String file) Loads a model from a file.static ModelAssetloadFromFile(String file, ModelImportSettings settings) static ModelAssetloadFromGame(String path) Loads a mesh from the game assets.Methods inherited from class net.risingworld.api.assets.Asset
dispose, equals, getChecksum, getDependency, getExtension, getHandle, getPath, getSource, getType, hashCode, isDisposed
-
Field Details
-
Cube
A box -
CubeDoubleSided
A double-sided box -
CubeFrame
The frame / edges of a box -
Sphere
A sphere -
Cylinder
A cylinder -
Quad
A quad with a size of 1x1, facing forward (z) -
Plane
A quad with a size of 1x1, facing upwards (y) -
ArrowForward
An arrow with a length of 1, facing forward (towards Z) -
ArrowBack
An arrow with a length of 1, facing backward (towards -Z) -
ArrowRight
An arrow with a length of 1, facing right (towards X) -
ArrowLeft
An arrow with a length of 1, facing left (towards -X) -
ArrowUp
An arrow with a length of 1, facing up (towards Y) -
ArrowDown
An arrow with a length of 1, facing down (towards -Y)
-
-
Method Details
-
loadFromGame
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
Loads a model from a file.- Parameters:
file- the path to the model file.- Returns:
- a new model asset instance.
-
loadFromFile
-