Did I find the right examples for you? yes no

All Samples(68)  |  Call(43)  |  Derive(0)  |  Import(25)

        def manage(m, *args):
    c = m
    c.__del__ = manage_del
    n = c(*args)
    n.incReferences()
    n.incReferences()
    #print "Referencing", n, n.getReferences()
    return n
        


src/s/y/sylphis3d-HEAD/runtime/base/game/actors/CMiscModel.py   sylphis3d(Download)
from string import *
from CSimpleActor import *
from util import manage
from math import pi
 
        sm = self.mScene
 
        m = manage(sylphis.CSceneMD3, sm)
 
        worldmodel = self.model_id
 
        if rigidbody == 1:
            self.body = manage(sylphis.CRigidBox, 0, self.node, sylphis.CVector3(20, 50, 20))
        elif rigidbody == 2:
            self.body = manage(sylphis.CRigidSphere, 0, self.node, 20)
        elif rigidbody == 3:
            self.body = manage(sylphis.CRigidCylinder, 0, self.node)

src/s/y/sylphis3d-HEAD/runtime/base/game/actors/CProjectile.py   sylphis3d(Download)
"""
import sys, sylphis, mthread
from util import manage
from string import *
from CSimpleActor import *
        if self.model != '':
            model = CEngine.models.registerMD3Model(self.model)
            m = manage(sylphis.CSceneMD3, sm)
            m.setModel(model)
            m.setPosition(self.origin)
            self.node = m
            self.body = manage(sylphis.CRigidSphere, 0, self.node, self.radius)
        else:
            self.body = manage(sylphis.CRigidSphere, 0, None, self.radius)
        if self.hit_sound != '':
            shotsound = CEngine.mSoundEnv.registerSoundBuffer(self.hit_sound)
            self.s = manage(sylphis.CSoundSource, CEngine.mSoundEnv)
            self.s.setBuffer(shotsound)
            self.s.setLooping(0)

src/s/y/sylphis3d-HEAD/runtime/base/game/actors/CPlayer.py   sylphis3d(Download)
#from string import *
from CSimpleActor import CSimpleActor
from util import manage
import pyui
 
    def __init__(self, *args):
        CSimpleActor.__init__(self, *args)
        self.camera = manage(sylphis.CCamera, self.mScene)
        self.camera.setFov(self.fov)
        self.node = self.camera # To be registered on the scenemanager
        self.body = manage(sylphis.CRigidCapsule, 0, None, sylphis.CVector3(self.width, self.height, self.width))
        self.omove.mAccel = 0.1
 
        self.slistener = manage(sylphis.CSoundListener, CEngine.mSoundEnv)
        self.camera.addChild(self.slistener)
 

src/s/y/sylphis3d-HEAD/runtime/base/game/actors/CVehicleCar.py   sylphis3d(Download)
from string import *
from CVehicle import *
from util import manage
import pyui
 
    def initBody(self):
        self.body = manage(sylphis.CRigidBox, 0, self.carModel, CVector3(self.width,self.height, self.length*0.9))
        self.body.setMass(50.0)
        #self.body.fitToModel(self.carModel)
        self.body.setListener(self)
        self.tireBody = []
        for i in range(4):
            self.tireBody.append(manage(sylphis.CRigidSphere, 0, self.tireModels[i], 25))
            self.tireBody[i].setMass(2.2)
            self.tireBody[i].fitToModel(self.tireModels[i])
 
        for i in range(4):
            joint.append(manage(sylphis.CJointDoubleHinge, 0, 0))
            joint[i].attach(self.body, self.tireBody[i])
            joint[i].setAnchor(self.tireBody[i].getPosition())
    def precache(self):
        self.carModel = manage(sylphis.CSceneMD3, self.mScene)
        m = CEngine.models.registerMD3Model('models/jeep.md3')
        #m = CEngine.models.registerSMFModel('models/car.smf')
        self.carModel.setModel(m)

src/s/y/sylphis3d-HEAD/runtime/base/game/actors/CVehicle.py   sylphis3d(Download)
from string import *
from CSimpleActor import *
from util import manage
import pyui
 
    def initBody(self):
        self.body = manage(sylphis.CRigidSphere, 0, self.node, 20)
        self.body.setDensity(0.000001)
        self.body.fitToModel(self.node)
        self.body.setListener(self)
        self.body.applyGravity(False)
        CPhysicsEnv.registerRigidBody(self.body)
 
    def precache(self):
        self.model = manage(sylphis.CSceneMD3, self.mScene)

src/s/y/sylphis3d-HEAD/runtime/base/game/actors/CWeapon.py   sylphis3d(Download)
"""
import sys, sylphis, mthread
from util import manage
from string import *
from CSimpleActor import *
 
        # Create the weapon scene model
        self.gun = manage(sylphis.CSceneModel, sm, gun)
        self.gun.setPosition(sylphis.CVector3(0.0, 0.0, 0.0))
        self.gun.blendAnimCycle('idle', 0.1, 0.1)
 
        # Create the weapon sound source
        self.s = manage(sylphis.CSoundSource, CEngine.mSoundEnv)
        self.s.setLooping(0)
 

src/s/y/sylphis3d-HEAD/runtime/base/game/actors/CJointBall.py   sylphis3d(Download)
from string import *
from CJoint import *
from util import manage
 
class CJointBall(CJoint):
    def join(self, ent):
        CJoint.join(self, ent)
        self.joint = manage(sylphis.CJointBall, 0, 0)
 
 

src/s/y/sylphis3d-HEAD/runtime/base/game/actors/CJointUniversal.py   sylphis3d(Download)
from string import *
from CJoint import *
from util import manage
 
class CJointUniversal(CJoint):
        self.axis2 = sylphis.CVector3(float(o[0]), float(o[1]), float(o[2]))
        self.axis2.swapHand()
        self.joint = manage(sylphis.CJointUniversal, 0, 0)
 
    def start(self):

src/s/y/sylphis3d-HEAD/runtime/base/game/actors/CJointSlider.py   sylphis3d(Download)
from string import *
from CJoint import *
from util import manage
 
class CJointSlider(CJoint):
        self.axis.swapHand()
 
        self.joint = manage(sylphis.CJointSlider, 0, 0)
 
    def start(self):

src/s/y/sylphis3d-HEAD/runtime/base/game/actors/CJointHinge.py   sylphis3d(Download)
from string import *
from CJoint import *
from util import manage
 
class CJointHinge(CJoint):
        self.cfm = self.stop_softness
 
        self.joint = manage(sylphis.CJointHinge, 0, 0)
 
    def start(self):

  1 | 2 | 3  Next