init
This commit is contained in:
22
game_server/game/motion/motion_info.py
Normal file
22
game_server/game/motion/motion_info.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from pydantic import BaseModel
|
||||
from rail_proto.lib import MotionInfo,Vector
|
||||
|
||||
class Motion(BaseModel):
|
||||
x: float
|
||||
y: float
|
||||
z: float
|
||||
rotY: float
|
||||
|
||||
def ToProto(self) -> MotionInfo:
|
||||
return MotionInfo(
|
||||
pos=Vector(
|
||||
x=int(self.x*1000),
|
||||
y=int(self.y*1000),
|
||||
z=int(self.z*1000)
|
||||
),
|
||||
rot=Vector(
|
||||
x=0,
|
||||
y=int(self.rotY*1000),
|
||||
z=0
|
||||
)
|
||||
)
|
||||
Reference in New Issue
Block a user