Record Class ObjProp
java.lang.Object
java.lang.Record
net.ixdarklord.coolcatcanvas.api.client.armature.ObjProp
- Record Components:
part- only this part of the file (ano,gorusemtlname); null for all of it
public record ObjProp(String point, net.minecraft.resources.Identifier model, net.minecraft.resources.Identifier texture, ArmatureMaterial material, org.joml.Vector3fc offset, org.joml.Vector3fc rotation, float scale, @Nullable String part)
extends Record
An
.obj model carried by an armature: a sword in a hand, a lantern on a belt, a detailed head on a simple
body. It sits on a joint or point and moves with it, and is hidden, tinted and lit up with its joint. Use one for
shapes Blockbench's cubes do badly: smooth, high-detail or sculpted parts.
Give them in the armature's .armature.json, for every animator:
"props": [
{ "point": "right_hand", "model": "mymod:models/obj/sword.obj", "texture": "mymod:textures/obj/sword.png",
"offset": [0, -1, 0], "rotation": [90, 0, 0], "scale": 0.8, "material": "cutout" }
]
or in code, for one animator (Animator.prop(ObjProp)), such as the item an entity holds:
animator.prop(ObjProp.of("right_hand", MyMod.id("models/obj/torch.obj"), MyMod.id("textures/obj/torch.png")).scale(0.5F));
Positions are in pixels from the point and turns in degrees, on the point's own axes (Blockbench's: Y up). The
model's units are its file's, one to a block, before scale.-
Constructor Summary
ConstructorsConstructorDescriptionObjProp(String point, net.minecraft.resources.Identifier model, net.minecraft.resources.Identifier texture, ArmatureMaterial material, org.joml.Vector3fc offset, org.joml.Vector3fc rotation, float scale, @Nullable String part) Creates an instance of aObjProprecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanloaded()Whether the model file can be read (logged once if not;ObjModelsexplains).material()Returns the value of thematerialrecord component.material(ArmatureMaterial material) net.minecraft.resources.Identifiermodel()Returns the value of themodelrecord component.static ObjPropof(String point, net.minecraft.resources.Identifier model, net.minecraft.resources.Identifier texture) org.joml.Vector3fcoffset()Returns the value of theoffsetrecord component.offset(float x, float y, float z) @Nullable Stringpart()Returns the value of thepartrecord component.point()Returns the value of thepointrecord component.rotate(float x, float y, float z) org.joml.Vector3fcrotation()Returns the value of therotationrecord component.floatscale()Returns the value of thescalerecord component.scale(float scale) net.minecraft.resources.Identifiertexture()Returns the value of thetexturerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ObjProp
public ObjProp(String point, net.minecraft.resources.Identifier model, net.minecraft.resources.Identifier texture, ArmatureMaterial material, org.joml.Vector3fc offset, org.joml.Vector3fc rotation, float scale, @Nullable @Nullable String part) Creates an instance of aObjProprecord class.- Parameters:
point- the value for thepointrecord componentmodel- the value for themodelrecord componenttexture- the value for thetexturerecord componentmaterial- the value for thematerialrecord componentoffset- the value for theoffsetrecord componentrotation- the value for therotationrecord componentscale- the value for thescalerecord componentpart- the value for thepartrecord component
-
-
Method Details
-
of
-
offset
-
rotate
-
scale
-
material
-
part
-
loaded
public boolean loaded()Whether the model file can be read (logged once if not;ObjModelsexplains). -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
point
Returns the value of thepointrecord component.- Returns:
- the value of the
pointrecord component
-
model
public net.minecraft.resources.Identifier model()Returns the value of themodelrecord component.- Returns:
- the value of the
modelrecord component
-
texture
public net.minecraft.resources.Identifier texture()Returns the value of thetexturerecord component.- Returns:
- the value of the
texturerecord component
-
material
Returns the value of thematerialrecord component.- Returns:
- the value of the
materialrecord component
-
offset
public org.joml.Vector3fc offset()Returns the value of theoffsetrecord component.- Returns:
- the value of the
offsetrecord component
-
rotation
public org.joml.Vector3fc rotation()Returns the value of therotationrecord component.- Returns:
- the value of the
rotationrecord component
-
scale
public float scale()Returns the value of thescalerecord component.- Returns:
- the value of the
scalerecord component
-
part
-