forked from bedohswe/p3he
A commit.
This commit is contained in:
parent
2d08605590
commit
4f30139286
7
gyro.py
7
gyro.py
@ -35,7 +35,7 @@ class GyroVector:
|
|||||||
self.normalize()
|
self.normalize()
|
||||||
|
|
||||||
def __add__(gA, gB):
|
def __add__(gA, gB):
|
||||||
cAdd, cGyr = MobiusAddGyr(gA.cPos, gB.cPos / ZeroCheck(gA.cRot))
|
cAdd, cGyr = MobiusAddGyr(gA.cPos, gB.cPos * (1 / gA.cRot))
|
||||||
return GyroVector(cAdd, gA.cRot * gB.cRot * cGyr)
|
return GyroVector(cAdd, gA.cRot * gB.cRot * cGyr)
|
||||||
|
|
||||||
def __neg__(self):
|
def __neg__(self):
|
||||||
@ -56,7 +56,8 @@ class GyroVector:
|
|||||||
self.cRot *= cRot
|
self.cRot *= cRot
|
||||||
|
|
||||||
def transform(self, cA):
|
def transform(self, cA):
|
||||||
cAdd, cGyr = MobiusAddGyr(self.cPos, cA / ZeroCheck(self.cRot))
|
#cAdd, cGyr = MobiusAddGyr(self.cPos, cA / ZeroCheck(self.cRot))
|
||||||
|
cAdd, cGyr = MobiusAddGyr(self.cPos, cA / self.cRot)
|
||||||
self.cPos = cAdd
|
self.cPos = cAdd
|
||||||
self.cRot = self.cRot * cGyr
|
self.cRot = self.cRot * cGyr
|
||||||
|
|
||||||
@ -66,4 +67,4 @@ class GyroVector:
|
|||||||
return gA.copy().transform(cA)
|
return gA.copy().transform(cA)
|
||||||
|
|
||||||
def nrtransformed(self, cA):
|
def nrtransformed(self, cA):
|
||||||
return MobiusAdd(self.cPos, cA / ZeroCheck(self.cRot))
|
return MobiusAdd(self.cPos, cA / self.cRot)
|
||||||
|
Loading…
Reference in New Issue
Block a user