Documentation
¶
Index ¶
- func CollisionReactionBallBall(collider1, collider2 collider, weight1, weight2, pf1, pf2, x2, y2 float64)
- func Cos(radian float64) float64
- func DegToRadian(angle float64) float64
- func Factorial(n float64) float64
- func GetAnchorWeapon(weaponXAttach, weaponYAttach, slotXAttach, slotYAttach int) (float64, float64, int, int)
- func GetBetweenAngle(x, y, targetX, targetY float64) float64
- func GetBetweenDist(fromX, fromY, toX, toY int) float64
- func GetBetweenDistFloat(fromX, fromY, toX, toY float64) float64
- func GetMaxDistBallisticWeapon(speed, targetLvl, startLvlBullet, radian float64, weaponType string, g float64) float64
- func GetRangeRand(min, max int) int
- func GetReachAngle(xPlace, yPlace, xTarget, yTarget int, targetLvl, startLvlBullet, speed float64, ...) float64
- func GetWeaponFirePosition(ownerX, ownerY, ownerScale int, ownerRotate float64, gunRotate float64, ...) *position.Positions
- func GetWeaponFirePositions(ownerX, ownerY, ownerScale int, ownerRotate float64, gunRotate float64, ...) []*position.Positions
- func GetWeaponPosInMap(ownerX, ownerY, ownerScale int, slotXAttach, slotYAttach, rotate float64) (int, int)
- func GetWeaponSlotAttachPoint(slotXAttach, slotYAttach, rotate float64, ownerScale int) (float64, float64)
- func GetZBulletByX(startZ, startRadian, x, speed float64, weaponType string, gravity float64) float64
- func GetZBulletByXPath(startZ, startRadian, speed float64, startX, startY, currentX, currentY int, ...) float64
- func IntersectVectorToCircle(a, b, centerCircle *Point, radius int) (intersect bool, x1, y1, x2, y2 float64)
- func PointInVector(a, b *Point, x, y float64) bool
- func PrepareAngle(angle *float64)
- func RadianToDeg(radian float64) float64
- func Rotate(unitRotate, needRotate *float64, step float64) float64
- func RotatePoint(x, y, x0, y0, rotate float64) (newX, newY float64)
- func ShortestBetweenAngle(angle1, angle2 float64) int
- func Sin(radian float64) float64
- func SpeedAndAngleToVelocity(speed float64, radian float64) (float64, float64)
- func VectorToAngleBySpeed(x1, y1, speed, angle float64) (int, int)
- type Point
- type Polygon
- func (r *Polygon) DetectCollisionRectToCircle(centerCircle *Point, radius int) bool
- func (r *Polygon) DetectCollisionRectToRect(r2 *Polygon) bool
- func (r *Polygon) DetectPointInRectangle(x, y float64) bool
- func (r *Polygon) GetAngle() float64
- func (r *Polygon) GetCenter() (float64, float64)
- func (r *Polygon) GetRotateSides() []*SideRec
- func (r *Polygon) Rotate(rotate float64)
- func (r *Polygon) UpdateCenterRect(x, y, height, width float64) *Polygon
- type SideRec
- type Vector
- func (v *Vector) Add(vec *Vector) *Vector
- func (v *Vector) Copy() *Vector
- func (v *Vector) Len() float64
- func (v *Vector) LenSqrt() float64
- func (v *Vector) Norm() *Vector
- func (v *Vector) Resize(len float64) *Vector
- func (v *Vector) Scale(fac float64) *Vector
- func (v *Vector) Sub(vec *Vector) *Vector
- func (v *Vector) VecTo(vec *Vector) *Vector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollisionReactionBallBall ¶
func CollisionReactionBallBall(collider1, collider2 collider, weight1, weight2, pf1, pf2, x2, y2 float64)
func DegToRadian ¶
func GetAnchorWeapon ¶
func GetBetweenAngle ¶
func GetBetweenDist ¶
func GetBetweenDistFloat ¶
func GetRangeRand ¶
func GetReachAngle ¶
func GetWeaponFirePosition ¶
func GetWeaponFirePosition(ownerX, ownerY, ownerScale int, ownerRotate float64, gunRotate float64, weaponXAttach, weaponYAttach int, weaponFirePositions []*coordinate.Coordinate, slotXAttach, slotYAttach float64, firePosition int) *position.Positions
func GetWeaponFirePositions ¶
func GetWeaponFirePositions(ownerX, ownerY, ownerScale int, ownerRotate float64, gunRotate float64, weaponXAttach, weaponYAttach int, weaponFirePositions []*coordinate.Coordinate, slotXAttach, slotYAttach float64) []*position.Positions
func GetWeaponPosInMap ¶
func GetZBulletByX ¶
func GetZBulletByXPath ¶
func IntersectVectorToCircle ¶
func PointInVector ¶
func PrepareAngle ¶
func PrepareAngle(angle *float64)
func RadianToDeg ¶
func RotatePoint ¶
func ShortestBetweenAngle ¶
func SpeedAndAngleToVelocity ¶
func VectorToAngleBySpeed ¶
Types ¶
type Polygon ¶
type Polygon struct { RotateSides []*SideRec `json:"-"` CenterX, CenterY float64 Angle float64 // contains filtered or unexported fields }
func GetCenterRect ¶
func (*Polygon) DetectCollisionRectToCircle ¶
func (*Polygon) DetectCollisionRectToRect ¶
func (*Polygon) DetectPointInRectangle ¶
func (*Polygon) GetRotateSides ¶
func (*Polygon) UpdateCenterRect ¶
Click to show internal directories.
Click to hide internal directories.