(→A Simple Python Property Class) |
(→A Simple Python Property Class) |
||
| Line 5: | Line 5: | ||
from pycel import * | from pycel import * | ||
| - | import random | ||
class RotatePropClass(pyPcCommon): | class RotatePropClass(pyPcCommon): | ||
def __init__(self,oreg): | def __init__(self,oreg): | ||
pyPcCommon.__init__(self,oreg) | pyPcCommon.__init__(self,oreg) | ||
| - | + | PhysicalLayer.CallbackEveryFrame(self,CEL_EVENT_PRE) | |
| - | + | ||
| - | + | ||
| - | + | ||
def TickEveryFrame(self): | def TickEveryFrame(self): | ||
mov = celMesh(self.GetEntity()).Mesh.GetMovable() | mov = celMesh(self.GetEntity()).Mesh.GetMovable() | ||
| Line 21: | Line 17: | ||
CEL_IMPLEMENT_FACTORY(RotatePropClass,"pcrotate") | CEL_IMPLEMENT_FACTORY(RotatePropClass,"pcrotate") | ||
| + | |||
</source> | </source> | ||
Revision as of 21:47, 11 February 2008
Introduction
A Simple Python Property Class
from pycel import * class RotatePropClass(pyPcCommon): def __init__(self,oreg): pyPcCommon.__init__(self,oreg) PhysicalLayer.CallbackEveryFrame(self,CEL_EVENT_PRE) def TickEveryFrame(self): mov = celMesh(self.GetEntity()).Mesh.GetMovable() rot = csYRotMatrix3(0.1) mov.Transform(rot) mov.UpdateMove() CEL_IMPLEMENT_FACTORY(RotatePropClass,"pcrotate")
