Record Class CameraFocus
java.lang.Object
java.lang.Record
net.ixdarklord.coolcatcanvas.api.cutscene.CameraFocus
- Record Components:
start- when it begins, in ticks from the cutscene's startend- when it endsblend- over how many ticks the camera turns towards the target at the start, and back to its path at the endpoint- the point looked at, in the cutscene's own spaceentity- the entity looked at, by its UUID; with neither a point nor an entity, it is the player
public record CameraFocus(float start, float end, float blend, Optional<net.minecraft.world.phys.Vec3> point, Optional<UUID> entity)
extends Record
A stretch of a cutscene in which the camera keeps looking at something, whatever its keyframes' angles say: a
point, an entity, or the player watching. The camera still follows its path; only where it looks changes, so an
orbit stays on its subject and a fly-by tracks what it passes.
CameraFocus.onPoint(0, 200, altar) // the whole shot looks at the altar
CameraFocus.onEntity(40, 120, dragon).blend(15) // turns to the dragon over 15 ticks, and away again after
CameraFocus.onPlayer(0, 60)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<CameraFocus> static final floatAn end for a focus that lasts as long as the cutscene does. -
Constructor Summary
ConstructorsConstructorDescriptionCameraFocus(float start, float end, float blend, Optional<net.minecraft.world.phys.Vec3> point, Optional<UUID> entity) Creates an instance of aCameraFocusrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfloatblend()Returns the value of theblendrecord component.blend(float ticks) floatend()Returns the value of theendrecord component.entity()Returns the value of theentityrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static CameraFocusstatic CameraFocusonEntity(float start, float end, net.minecraft.world.entity.Entity entity) static CameraFocusonPlayer(float start, float end) Looks at the player watching the cutscene.static CameraFocusonPoint(float start, float end, net.minecraft.world.phys.Vec3 point) Optional<net.minecraft.world.phys.Vec3> point()Returns the value of thepointrecord component.floatstart()Returns the value of thestartrecord component.final StringtoString()Returns a string representation of this record class.floatweight(float time) How strongly the camera is held on the target at a time: 0 outside the stretch, 1 once fully turned.
-
Field Details
-
UNTIL_END
public static final float UNTIL_ENDAn end for a focus that lasts as long as the cutscene does.- See Also:
-
CODEC
-
-
Constructor Details
-
CameraFocus
-
-
Method Details
-
onPoint
-
onEntity
public static CameraFocus onEntity(float start, float end, net.minecraft.world.entity.Entity entity) -
onEntity
-
onPlayer
Looks at the player watching the cutscene. -
blend
-
weight
public float weight(float time) How strongly the camera is held on the target at a time: 0 outside the stretch, 1 once fully turned. -
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. -
start
-
end
-
blend
-
point
-
entity
-