physics

package
v0.0.0-...-c982c26 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2014 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VelocityFromLook

func VelocityFromLook(look LookDegrees, speed float64) AbsVelocity

Create a velocity from a look (yaw and pitch) and a momentum.

Types

type IBlockQuerier

type IBlockQuerier interface {
	BlockQuery(blockLoc BlockXyz) (isSolid bool, isWithinChunk bool)
}

type PointObject

type PointObject struct {
	// Used in knowing what to send as client updates
	LastSentPosition AbsIntXyz
	LastSentVelocity Velocity
	// contains filtered or unexported fields
}

func (*PointObject) Init

func (obj *PointObject) Init(position *AbsXyz, velocity *AbsVelocity)

func (*PointObject) MarshalNbt

func (obj *PointObject) MarshalNbt(tag *nbt.Compound) (err error)

func (*PointObject) Position

func (obj *PointObject) Position() *AbsXyz

func (*PointObject) SendUpdate

func (obj *PointObject) SendUpdate(writer io.Writer, entityId EntityId, look *LookBytes) (err error)

Generates any packets needed to update clients as to the position and velocity of the object. It assumes that the clients have either been sent packets via this method before, or that the previous position/velocity sent was generated from the LastSentPosition and LastSentVelocity attributes.

func (*PointObject) Tick

func (obj *PointObject) Tick(blockQuerier IBlockQuerier) (leftChunk bool)

func (*PointObject) UnmarshalNbt

func (obj *PointObject) UnmarshalNbt(tag *nbt.Compound) (err error)

Jump to

Keyboard shortcuts

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