Documentation
¶
Index ¶
- type Base
- type Camera
- func (camera *Camera) Backwards(dt float64)
- func (camera *Camera) Forwards(dt float64)
- func (camera *Camera) Left(dt float64)
- func (camera *Camera) ModelMatrix() mgl32.Mat4
- func (camera *Camera) ProjectionMatrix() mgl32.Mat4
- func (camera *Camera) Right(dt float64)
- func (camera *Camera) Rotate(x, y, z float32)
- func (camera *Camera) Update(dt float64)
- func (camera *Camera) ViewMatrix() mgl32.Mat4
- type EntityId
- type GenericEntity
- type IClassname
- type IEntity
- type Transform
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base struct {
// contains filtered or unexported fields
}
Base is an object in the game world. By itself entity is nothing more than an identifiable object located at a point in space
func (*Base) SetKeyValues ¶
SetKeyValues set this entity's keyvalues
type Camera ¶
type Camera struct {
*Base
// contains filtered or unexported fields
}
func (*Camera) ModelMatrix ¶
ModelMatrix returns identity matrix (camera model is our position!)
func (*Camera) ProjectionMatrix ¶
ProjectionMatrix calculates projection matrix. This is unlikely to change throughout program lifetime, but could do
func (*Camera) ViewMatrix ¶
ViewMatrix calculates the cameras View matrix
type GenericEntity ¶
type GenericEntity struct {
Base
}
GenericEntity can be used to substitute out an entity that doesn't have a known implementation
func NewGenericEntity ¶
func NewGenericEntity(definition *entity2.Entity) *GenericEntity
NewGenericEntity returns new Entity
type IClassname ¶
type IClassname interface {
Classname() string
}
IClassname all valid game entities should have a classname, but there may be temporary non-game entities that have classnames
type IEntity ¶
type IEntity interface {
KeyValues() *entity.Entity
SetKeyValues(entity2 *entity.Entity)
Classname() string
Transform() *Transform
New() IEntity
}
IEntity Base interface All game entities need to implement this
type Transform ¶
type Transform struct {
Position mgl32.Vec3
Rotation mgl32.Vec3
Scale mgl32.Vec3
// contains filtered or unexported fields
}
Transform Represents the transformation of an entity in a 3-dimensional space: position, rotation and scale. Note: Rotation is measured in degrees
func (*Transform) GetTransformationMatrix ¶
GetTransformationMatrix computes object transformation matrix