Home - Forums - Documentation - Gallery - Bugs

Introduction

A Simple Python Property Class

from pycel import *
import random
 
class RotatePropClass(pyPcCommon):
        def __init__(self,oreg):
                pyPcCommon.__init__(self,oreg)
                pl.CallbackEveryFrame(self,CEL_EVENT_PRE)
                self.foo = 160
        def ReceiveMessage(msg_id,sender,ret,params):
                pass
        def TickEveryFrame(self):
                mov = celMesh(self.GetEntity()).Mesh.GetMovable()
                rot = csYRotMatrix3(0.1)
                mov.Transform(rot)
                mov.UpdateMove()
 
CEL_IMPLEMENT_FACTORY(RotatePropClass,"pcrotate")
| Article | Discussion | View source | History |