-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEntity.py
More file actions
54 lines (32 loc) · 1.04 KB
/
Entity.py
File metadata and controls
54 lines (32 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
'''
* Entity.py
*
* Created on: 27.12.2018
* Author: Andrew Jason Bishop
*
* General description:
* xxx
'''
import numpy as np
class Entity:
def __init__(self, _texModel, _matFac):
self.texturedModel = _texModel
self.matrixFactory = _matFac
self.transformationMatrix = _matFac.createNewIdentityMatrix()
self.position = np.array([0.0,0.0,0.0])
self.scale = np.array([1.0,1.0,1.0])
self.rotation = np.array([0.0,0.0,0.0])
#self.updateRotation()
def getTransformationMatrix(self):
return self.transformationMatrix
def updateTransformation(self):
pass
def updateRotation(self):
tm = self.matrixFactory.createExtrinsicRotationMatrix( self.rotation )
self.transformationMatrix = tm
def increasePosition(self, _deltaPos):
self.position += _deltaPos
def increaseRotation(self, _deltaRot):
self.rotation += _deltaRot
self.updateRotation()
''' END '''