'From Squeak3.1alpha of 28 February 2001 [latest update: #4016] on 11 May 2001 at 2:10:36 pm'! "Change Set: WnldCamRefPt Date: 11 May 2001 Author: Andreas Raab Make distanceToCamera use an optional reference object which has to be a child of the camera with the name 'referencePoint'."! !WonderlandActor methodsFor: 'eToy-basic' stamp: 'ar 5/11/2001 13:20'! distanceToCamera | aCamera | aCamera _ myWonderland getDefaultCamera. aCamera _ aCamera getChildren detect:[:any| any getName = 'referencePoint'] ifNone:[aCamera]. ^(self distanceTo: aCamera) * 100! ! !WonderlandActor methodsFor: 'eToy-basic' stamp: 'ar 5/11/2001 13:20'! setDistanceToCamera: distance | pos oldDistance oldPos aCamera | aCamera _ myWonderland getDefaultCamera. aCamera _ aCamera getChildren detect:[:any| any getName = 'referencePoint'] ifNone:[aCamera]. oldPos _ self getPosition: aCamera. pos _ B3DVector3 x: oldPos first y: 0 z: oldPos third. oldDistance _ pos length. oldDistance abs < 1.0e-5 ifTrue:[ pos _ 0@0@1. oldDistance _ 1]. pos _ pos * (distance * 0.01 / oldDistance). self moveToRightNow: {pos x. oldPos second. pos z} asSeenBy: myWonderland getDefaultCamera undoable: false.! !