refactoring

This commit is contained in:
iperov 2021-10-26 20:06:50 +04:00
parent d90ec2d024
commit 8b385f6d80
11 changed files with 263 additions and 137 deletions

View file

@ -1,21 +1,23 @@
from typing import Tuple
import numpy as np
from .. import math as lib_math
from .IState import IState
class FPose:
class FPose(IState):
"""
Describes face pitch/yaw/roll
"""
def __init__(self):
self._pyr : np.ndarray = None
def __getstate__(self):
return self.__dict__.copy()
def restore_state(self, state : dict):
self._pyr = IState._restore_np_array(state.get('_pyr', None))
def __setstate__(self, d):
self.__init__()
self.__dict__.update(d)
def dump_state(self) -> dict:
return {'_pyr' : IState._dump_np_array(self._pyr)}
def as_radians(self) -> Tuple[float, float, float]:
"""