Documentation ¶
Index ¶
- Constants
- Variables
- func IntDurToStr(count int64, dur time.Duration) string
- type ActionPoint
- type ActionStat
- type ActionStatElement
- type ActionType
- type GoCmd
- type HyperRect
- func (h *HyperRect) Center() Vector3D
- func (h *HyperRect) DiagLen() float64
- func (h *HyperRect) IMul(i float64) *HyperRect
- func (h *HyperRect) IsContact(c Vector3D, r float64) bool
- func (h1 *HyperRect) IsIn(h2 *HyperRect) bool
- func (h1 *HyperRect) IsOverlap(h2 *HyperRect) bool
- func (h *HyperRect) MakeCubeBy8Driect(center Vector3D, direct8 int) *HyperRect
- func (h *HyperRect) Move(v Vector3D) *HyperRect
- func (h *HyperRect) RandVector() Vector3D
- func (h *HyperRect) SizeVector() Vector3D
- type IDList
- type Octree
- type OctreeObjI
- type OctreeObjList
- type Vector3D
- func (p Vector3D) Abs() float64
- func (p Vector3D) Add(other Vector3D) Vector3D
- func (p Vector3D) Angle(other Vector3D) float64
- func (srcpos Vector3D) CalcAimAheadDur(dstpos Vector3D, dstmv Vector3D, bulletspeed float64) float64
- func (p Vector3D) Cross(other Vector3D) Vector3D
- func (p Vector3D) Dot(other Vector3D) float64
- func (p Vector3D) Eq(other Vector3D) bool
- func (p Vector3D) Idiv(other float64) Vector3D
- func (p Vector3D) Imul(other float64) Vector3D
- func (p Vector3D) IsIn(hr *HyperRect) bool
- func (p Vector3D) IsZero() bool
- func (p Vector3D) LenTo(other Vector3D) float64
- func (p *Vector3D) MakeIn(hr *HyperRect) int
- func (p Vector3D) Mul(other Vector3D) Vector3D
- func (p Vector3D) Ne(other Vector3D) bool
- func (p Vector3D) Neg() Vector3D
- func (v Vector3D) NewInt32Vector() [3]int32
- func (p *Vector3D) Normalize()
- func (p Vector3D) Normalized() Vector3D
- func (p Vector3D) NormalizedTo(l float64) Vector3D
- func (p Vector3D) Project(other Vector3D) Vector3D
- func (p Vector3D) Reflect(normal Vector3D) Vector3D
- func (p Vector3D) RotateAround(axis Vector3D, theta float64) Vector3D
- func (p Vector3D) Sqd(q Vector3D) float64
- func (v Vector3D) String() string
- func (p Vector3D) Sub(other Vector3D) Vector3D
- func (center Vector3D) To8Direct(v2 Vector3D) int
Constants ¶
View Source
const (
MaxOctreeData = 8
)
Variables ¶
View Source
var IdGenCh chan int64
View Source
var V3DUnitX = Vector3D{1, 0, 0}
View Source
var V3DUnitY = Vector3D{0, 1, 0}
View Source
var V3DUnitZ = Vector3D{0, 0, 1}
View Source
var V3DZero = Vector3D{0, 0, 0}
Functions ¶
Types ¶
type ActionPoint ¶
type ActionPoint struct {
// contains filtered or unexported fields
}
func NewActionPoint ¶
func NewActionPoint(typecount int) *ActionPoint
func (*ActionPoint) Add ¶
func (ap *ActionPoint) Add(val int)
func (*ActionPoint) CanUse ¶
func (ap *ActionPoint) CanUse(value int) bool
func (*ActionPoint) Use ¶
func (ap *ActionPoint) Use(apt ActionType, value int) bool
type ActionStat ¶
type ActionStat struct { Total ActionStatElement Laps []ActionStatElement }
func NewActionStat ¶
func NewActionStat() *ActionStat
func (*ActionStat) Add ¶
func (a *ActionStat) Add(n int64)
func (*ActionStat) Inc ¶
func (a *ActionStat) Inc()
func (*ActionStat) NewLap ¶
func (a *ActionStat) NewLap()
func (ActionStat) String ¶
func (a ActionStat) String() string
func (*ActionStat) UpdateLap ¶
func (a *ActionStat) UpdateLap()
type ActionStatElement ¶
type ActionType ¶
type ActionType int
type HyperRect ¶
type HyperRect struct {
Min, Max Vector3D
}
func NewHyperRect ¶
make normalized hyperrect , if not need use HyperRect{Min: , Max:}
func NewHyperRectByCR ¶
func (*HyperRect) MakeCubeBy8Driect ¶
func (*HyperRect) RandVector ¶
func (*HyperRect) SizeVector ¶
type Octree ¶
type Octree struct { BoundCube *HyperRect Center Vector3D DataList OctreeObjList Children [8]*Octree }
func (*Octree) Insert ¶
func (ot *Octree) Insert(o OctreeObjI) bool
func (*Octree) QueryByHyperRect ¶
func (ot *Octree) QueryByHyperRect(fn func(OctreeObjI) bool, hr *HyperRect) bool
type OctreeObjI ¶
type OctreeObjI interface {
Pos() Vector3D
}
type OctreeObjList ¶
type OctreeObjList []OctreeObjI
type Vector3D ¶
type Vector3D [3]float64
func FromInt32Vector ¶
func RandVector ¶
func RandVector3D ¶
func (Vector3D) CalcAimAheadDur ¶
func (srcpos Vector3D) CalcAimAheadDur(dstpos Vector3D, dstmv Vector3D, bulletspeed float64) float64
for aim ahead target with projectile return time dur
func (Vector3D) Normalized ¶
func (Vector3D) NormalizedTo ¶
func (Vector3D) RotateAround ¶
Click to show internal directories.
Click to hide internal directories.