Пример #1
0
func (self *SimpleMoveWModule) Process(time_step float32) {
	move := self.Speed.Mul(time_step)
	move_quat := v.QuaternionFromAngle(self.SurfaceNormal,
		self.Object.Rotation.GetAngle())
	rot_move := move_quat.Mul3f(move)

	//	rot_move.Y += self.Gravity * time_step

	self.Object.MovePosition(rot_move.X, rot_move.Y, rot_move.Z)
}
Пример #2
0
func (s *GameState) UpdatePlayerCtrl(moveDir v.Vector3f, horAngle v.Angle) {
	//	move := wobject.FindSimpleMoveWModule(s.Player)
	//	move.Speed = moveDir

	move := FindCharacterControlerWModule(s.Player)
	move.Controler.SetWalkDirection(moveDir)

	s.Player.Rotation = v.QuaternionFromAngle(
		v.Vector3f{0, 1, 0},
		horAngle)

}