forked from bedohswe/p3he
A commit.
This commit is contained in:
parent
d6e5cf9b5d
commit
64402f86b6
3
gyro.py
3
gyro.py
@ -35,7 +35,8 @@ class GyroVector:
|
|||||||
self.normalize()
|
self.normalize()
|
||||||
|
|
||||||
def __add__(gA, gB):
|
def __add__(gA, gB):
|
||||||
cAdd, cGyr = MobiusAddGyr(gA.cPos, gB.cPos * (1 / gA.cRot))
|
#cAdd, cGyr = MobiusAddGyr(gA.cPos, gB.cPos / gA.cRot)
|
||||||
|
cAdd, cGyr = MobiusAddGyr(gA.cPos, gB.cPos)
|
||||||
return GyroVector(cAdd, gA.cRot * gB.cRot * cGyr)
|
return GyroVector(cAdd, gA.cRot * gB.cRot * cGyr)
|
||||||
|
|
||||||
def __neg__(self):
|
def __neg__(self):
|
||||||
|
4
main.py
4
main.py
@ -86,9 +86,9 @@ def mainLoop():
|
|||||||
if keys[pygame.K_a]:
|
if keys[pygame.K_a]:
|
||||||
gPlayer.rotate(IROT)
|
gPlayer.rotate(IROT)
|
||||||
if keys[pygame.K_w]:
|
if keys[pygame.K_w]:
|
||||||
gPlayer -= GyroVector(OFFSET, 1)
|
gPlayer -= GyroVector(OFFSET * gPlayer.cRot, 1)
|
||||||
if keys[pygame.K_s]:
|
if keys[pygame.K_s]:
|
||||||
gPlayer += GyroVector(OFFSET, 1)
|
gPlayer += GyroVector(OFFSET * gPlayer.cRot, 1)
|
||||||
display.fill(WHITE)
|
display.fill(WHITE)
|
||||||
#pygame.draw.rect(display,BLACK, c_tr(Poincare2Klein(gPlayer.cPos) * -100) + (100,100),0)
|
#pygame.draw.rect(display,BLACK, c_tr(Poincare2Klein(gPlayer.cPos) * -100) + (100,100),0)
|
||||||
drawn = draw(level,gPlayer,PI/2,640)
|
drawn = draw(level,gPlayer,PI/2,640)
|
||||||
|
Loading…
Reference in New Issue
Block a user