From ca04158482628c9a4a1bca5b3731d576d8cf540f Mon Sep 17 00:00:00 2001 From: Darren Ranalli Date: Tue, 18 Nov 2003 22:24:06 +0000 Subject: [PATCH] entrancePoint entity places toons sensibly --- direct/src/level/EntityTypes.py | 2 ++ direct/src/level/EntrancePoint.py | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/direct/src/level/EntityTypes.py b/direct/src/level/EntityTypes.py index 2e1991fa82..678d82ce34 100755 --- a/direct/src/level/EntityTypes.py +++ b/direct/src/level/EntityTypes.py @@ -70,6 +70,8 @@ class EntrancePoint(Nodepath): type = 'entrancePoint' attribs = ( ('entranceId', -1, 'int'), + ('radius', 15, 'float', {'min':0}), + ('theta', 20, 'float', {'min':0}), ) class LogicGate(Entity): diff --git a/direct/src/level/EntrancePoint.py b/direct/src/level/EntrancePoint.py index 366470a3bb..f00786f713 100755 --- a/direct/src/level/EntrancePoint.py +++ b/direct/src/level/EntrancePoint.py @@ -6,14 +6,22 @@ import NodePath class EntrancePoint(BasicEntities.NodePathEntity): def __init__(self, level, entId): BasicEntities.NodePathEntity.__init__(self, level, entId) + self.rotator = self.attachNewNode('rotator') + self.placer = self.rotator.attachNewNode('placer') self.initEntrancePoint() def destroy(self): self.destroyEntrancePoint() + self.placer.removeNode() + self.rotator.removeNode() + del self.placer, self.rotator BasicEntities.NodePathEntity.destroy(self) def placeToon(self, toon, toonIndex, numToons): - toon.setPosHpr(self, 0,0,0, 0,0,0) + self.placer.setY(-self.radius) + self.rotator.setH((-self.theta*(numToons-1)*.5) + + (toonIndex*self.theta)) + toon.setPosHpr(self.placer, 0,0,0, 0,0,0) def initEntrancePoint(self): if self.entranceId >= 0: