instructions

package
v0.0.0-...-6379f54 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EasingTypeLinear = iota
	EasingTypeSpring
	EasingTypeInQuad
	EasingTypeOutQuad
	EasingTypeInOutQuad
	EasingTypeInCubic
	EasingTypeOutCubic
	EasingTypeInOutCubic
	EasingTypeInQuart
	EasingTypeOutQuart
	EasingTypeInOutQuart
	EasingTypeInQuint
	EasingTypeOutQuint
	EasingTypeInOutQuint
	EasingTypeInSine
	EasingTypeOutSine
	EasingTypeInOutSine
	EasingTypeInExpo
	EasingTypeOutExpo
	EasingTypeInOutExpo
	EasingTypeInCirc
	EasingTypeOutCirc
	EasingTypeInOutCirc
	EasingTypeInBounce
	EasingTypeOutBounce
	EasingTypeInOutBounce
	EasingTypeInBack
	EasingTypeOutBack
	EasingTypeInOutBack
	EasingTypeInElastic
	EasingTypeOutElastic
	EasingTypeInOutElastic
)
View Source
const (
	CameraShakeTypePositional uint8 = iota
	CameraShakeTypeRotational
)

Variables

View Source
var (
	FreeCameraPreset             = free
	FirstPersonCameraPreset      = firstPerson
	ThirdPersonCameraPreset      = thirdPerson
	ThirdPersonFrontCameraPreset = thirdPersonFront
	FollowOrbitCameraPreset      = followOrbit
	FixedBoomCameraPreset        = fixedBoom

	Presets = presets
)

Functions

This section is empty.

Types

type CameraEase

type CameraEase struct {
	// Type is the type of easing function used. This is one of the constants above.
	Type uint8
	// Duration is the time that the easing function should take.
	Duration time.Duration
}

type CameraInstruction

type CameraInstruction interface {
	Packet(*session.Session) packet.Packet
}

type ClearCameraInstruction

type ClearCameraInstruction struct {
}

func (ClearCameraInstruction) Packet

type FadeCameraInstruction

type FadeCameraInstruction struct {
	// FadeInDuration is the time for the screen to fully fade in.
	FadeInDuration time.Duration
	// WaitDuration is time to wait before fading out.
	WaitDuration time.Duration
	// FadeOutDuration is the time for the screen to fully fade out.
	FadeOutDuration time.Duration

	// Colour is the colour of the screen to fade to. This only uses the red, green and blue components.
	Colour color.RGBA
}

func (FadeCameraInstruction) Packet

type SetCameraInstruction

type SetCameraInstruction struct {
	// Preset is one of the pre-defined presets that you can find in the presets.go file.
	Preset protocol.CameraPreset
	// Ease represents the easing function that is used by the instruction.
	Ease protocol.Optional[CameraEase]
	// Position represents the position of the camera.
	Position protocol.Optional[mgl32.Vec3]
	// Rotation represents the rotation of the camera.
	Rotation protocol.Optional[mgl32.Vec2]
	// Facing is a vector that the camera will always face towards during the duration of the instruction.
	Facing protocol.Optional[mgl32.Vec3]
	// ViewOffset is an offset based on a pivot point to the player, causing the camera to be shifted in a
	// certain direction.
	ViewOffset protocol.Optional[mgl32.Vec2]
	// EntityOffset is an offset from the entity that the camera should be rendered at.
	EntityOffset protocol.Optional[mgl32.Vec3]
}

func (SetCameraInstruction) Packet

type ShakeInstruction

type ShakeInstruction struct {
	// Type is the type of shake, and is one of the constants listed above. The different type affects how
	// the shake looks in game.
	Type uint8
	// Intensity is the intensity of the shaking. The client limits this value to 4, so anything higher may
	// not work.
	Intensity float32
	// Duration is for how long the camera will shake for.
	Duration time.Duration
}

func (ShakeInstruction) Packet

type StopShakeInstruction

type StopShakeInstruction struct {
}

func (StopShakeInstruction) Packet

type TargetCameraInstruction

type TargetCameraInstruction struct {
	// CenterOffset is the offset from the center of the entity that the camera should target.
	CenterOffset *mgl32.Vec3
	// EntityHandle is the entity handle that the camera should target.
	EntityHandle *world.EntityHandle
}

func (TargetCameraInstruction) Packet

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL