Example #1
0
func (self *Transform) processMovement(deltaT float32, component *components.Transform) {
	moveDir := component.MoveDir()

	if component.MoveRelativeToRotation {
		moveDir = component.Rotation.Inverse().TimesV(moveDir)
	}

	moveDir = moveDir.Times(component.Speed).Scale(deltaT)
	component.Position = component.Position.Add(moveDir)
}