objects

package
v0.0.0-...-50c553c Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CIRCLE      int64 = 1
	SLIDER      int64 = 2
	SPINNNER    int64 = 8
	NEWCIRCLE   int64 = 5
	NEWSLIDER   int64 = 6
	NEWSPINNNER int64 = 12
)

Variables

This section is empty.

Functions

func Clamp

func Clamp(value float64, min float64, max float64) float64

限制范围

func DrawHitCircleNumber

func DrawHitCircleNumber(number int64, position bmath.Vector2d, batch *render.SpriteBatch)

绘制圈内数字

func GetHitCircleNumberWidth

func GetHitCircleNumberWidth(number int64) int32

获取圈内数字宽度

Types

type BaseObject

type BaseObject interface {
	GetBasicData() *basicData
	Update(time int64) bool
	GetPosition() om.Vector2d
	SetDifficulty(preempt, fadeIn float64)
}

func GetObject

func GetObject(data []string, number int64) (BaseObject, int64)

func GetObjectbyPath

func GetObjectbyPath(data []string, number int64, isHR bool) (BaseObject, int64)

type Circle

type Circle struct {
	Timings *Timings
	// contains filtered or unexported fields
}

func DummyCircle

func DummyCircle(pos bmath.Vector2d, time int64) *Circle

func DummyCircleInherit

func DummyCircleInherit(pos bmath.Vector2d, time int64, inherit bool) *Circle

func NewCircle

func NewCircle(data []string, number int64) *Circle

func NewCirclebyPath

func NewCirclebyPath(data []string, number int64, isHR bool) *Circle

func (*Circle) Draw

func (self *Circle) Draw(time int64, preempt float64, fadeIn float64, color mgl32.Vec4, batch *render.SpriteBatch) bool

func (*Circle) DrawApproach

func (self *Circle) DrawApproach(time int64, preempt float64, fadeIn float64, color mgl32.Vec4, batch *render.SpriteBatch)

func (Circle) GetBasicData

func (self Circle) GetBasicData() *basicData

func (*Circle) GetObjectNumber

func (self *Circle) GetObjectNumber() int64

func (*Circle) GetPosition

func (self *Circle) GetPosition() bmath.Vector2d

func (*Circle) SetDifficulty

func (self *Circle) SetDifficulty(preempt, fadeIn float64)

func (*Circle) SetTiming

func (self *Circle) SetTiming(timings *Timings)

func (*Circle) Update

func (self *Circle) Update(time int64) bool

type Pause

type Pause struct {
	// contains filtered or unexported fields
}

func NewPause

func NewPause(data []string) *Pause

func (Pause) GetBasicData

func (self Pause) GetBasicData() *basicData

func (*Pause) GetObjectNumber

func (self *Pause) GetObjectNumber() int64

func (*Pause) GetPosition

func (self *Pause) GetPosition() bmath.Vector2d

func (*Pause) SetDifficulty

func (self *Pause) SetDifficulty(preempt, fadeIn float64)

func (*Pause) Update

func (self *Pause) Update(time int64) bool

type Renderable

type Renderable interface {
	Draw(time int64, preempt float64, fadeIn float64, color mgl32.Vec4, batch *render.SpriteBatch) bool
	DrawApproach(time int64, preempt float64, fadeIn float64, color mgl32.Vec4, batch *render.SpriteBatch)
	GetObjectNumber() int64
}

type Slider

type Slider struct {
	Timings *Timings
	TPoint  TimingPoint

	Pos m2.Vector2d

	TickPoints      []tickPoint
	TickReverse     []tickPoint
	TickReverseTrue []tickPoint
	ScorePoints     []tickPoint
	ScorePointsTrue []tickPoint

	End bool

	//加入tail真正的judge点
	TailJudgePoint  bmath.Vector2d
	TailJudgeOffset int64
	// contains filtered or unexported fields
}

func NewSlider

func NewSlider(data []string, number int64) *Slider

func NewSliderbyPath

func NewSliderbyPath(data []string, number int64, isHR bool) *Slider

func (*Slider) Draw

func (self *Slider) Draw(time int64, preempt float64, fadeIn float64, color mgl32.Vec4, batch *render.SpriteBatch) bool

func (*Slider) DrawApproach

func (self *Slider) DrawApproach(time int64, preempt float64, fadeIn float64, color mgl32.Vec4, batch *render.SpriteBatch)

func (*Slider) DrawBody

func (self *Slider) DrawBody(time int64, preempt float64, fadeIn float64, color mgl32.Vec4, color1 mgl32.Vec4, renderer *render.SliderRenderer)

func (*Slider) GetAsDummyCircles

func (self *Slider) GetAsDummyCircles() []BaseObject

func (Slider) GetBasicData

func (self Slider) GetBasicData() *basicData

func (*Slider) GetCurve

func (self *Slider) GetCurve() []m2.Vector2d

func (Slider) GetCurvePointsLen

func (self Slider) GetCurvePointsLen() int

func (Slider) GetEndAngle

func (self Slider) GetEndAngle() float64

func (Slider) GetHalf

func (self Slider) GetHalf() m2.Vector2d

func (*Slider) GetObjectNumber

func (self *Slider) GetObjectNumber() int64

func (Slider) GetPartLen

func (self Slider) GetPartLen() float64

func (Slider) GetPointAt

func (self Slider) GetPointAt(time int64) m2.Vector2d

func (Slider) GetPointAtTail

func (self Slider) GetPointAtTail(time int64) m2.Vector2d

func (*Slider) GetPosition

func (self *Slider) GetPosition() m2.Vector2d

func (Slider) GetStartAngle

func (self Slider) GetStartAngle() float64

func (*Slider) InitCurve

func (self *Slider) InitCurve(renderer *render.SliderRenderer, flag bool)

func (*Slider) SetDifficulty

func (self *Slider) SetDifficulty(preempt, fadeIn float64)

func (*Slider) SetTiming

func (self *Slider) SetTiming(timings *Timings)

func (*Slider) Update

func (self *Slider) Update(time int64) bool

type Spinner

type Spinner struct {
	Timings *Timings
	// contains filtered or unexported fields
}

func NewSpinner

func NewSpinner(data []string, number int64) *Spinner

func (*Spinner) Draw

func (self *Spinner) Draw(time int64, preempt float64, fadeIn float64, color mgl32.Vec4, batch *render.SpriteBatch) bool

func (*Spinner) DrawApproach

func (self *Spinner) DrawApproach(time int64, preempt float64, fadeIn float64, color mgl32.Vec4, batch *render.SpriteBatch)

func (Spinner) GetBasicData

func (self Spinner) GetBasicData() *basicData

func (*Spinner) GetObjectNumber

func (self *Spinner) GetObjectNumber() int64

func (*Spinner) GetPosition

func (self *Spinner) GetPosition() bmath.Vector2d

func (*Spinner) SetDifficulty

func (self *Spinner) SetDifficulty(preempt, fadeIn float64)

func (*Spinner) SetTiming

func (self *Spinner) SetTiming(timings *Timings)

func (*Spinner) Update

func (self *Spinner) Update(time int64) bool

type TimingPoint

type TimingPoint struct {
	Time         int64
	BaseBpm, Bpm float64
	SampleSet    int
	SampleIndex  int
	SampleVolume float64
}

func (TimingPoint) GetRatio

func (t TimingPoint) GetRatio() float64

type Timings

type Timings struct {
	Points []TimingPoint

	SliderMult float64
	Current    TimingPoint

	BaseSet  int
	LastSet  int
	TickRate float64
	// contains filtered or unexported fields
}

func NewTimings

func NewTimings() *Timings

func (*Timings) AddPoint

func (tim *Timings) AddPoint(time int64, bpm float64, sampleset, sampleindex int, samplevolume float64)

func (*Timings) GetPoint

func (tim *Timings) GetPoint(time int64) TimingPoint

func (Timings) GetSliderTime

func (tim Timings) GetSliderTime(pixelLength float64) int64

func (Timings) GetSliderTimeP

func (tim Timings) GetSliderTimeP(point TimingPoint, pixelLength float64) int64

func (Timings) GetSliderTimeS

func (tim Timings) GetSliderTimeS(time int64, pixelLength float64) int64

func (*Timings) Log

func (tim *Timings) Log()

func (*Timings) Reset

func (tim *Timings) Reset()

func (*Timings) Update

func (tim *Timings) Update(time int64)

Jump to

Keyboard shortcuts

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