physics

package
v0.0.0-...-566b5d1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2011 License: MIT Imports: 7 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) Position

func (obj *PointObject) Position() *AbsXyz

func (*PointObject) ReadNbt

func (obj *PointObject) ReadNbt(tag nbt.ITag) (err os.Error)

func (*PointObject) SendUpdate

func (obj *PointObject) SendUpdate(writer io.Writer, entityId EntityId, look *LookBytes) (err os.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) WriteIntoNbt

func (obj *PointObject) WriteIntoNbt(tag *nbt.Compound)

Jump to

Keyboard shortcuts

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