ywywdh / papervision3d

Automatically exported from code.google.com/p/papervision3d
0 stars 0 forks source link

Missing keyword "new" in DisplayObject3D.as line 195 - and name clash? #153

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I am not sure but I think Tim Knip is implying a clash of names when I
reported to him about the missing "new" keyword. See emails below:
//********************
Hi John,

Think this a bug indeed.

Checkout CameraObject3D (line #454) which extends DisplayObject3D.
CameraObject3D has a protected var _target...

So, my guess is that's the problem (as all other ... = Number3D.ZERO's
seem to be okay).

Could you report the issue @
http://code.google.com/p/papervision3d/issues/list ?

Thanks for reporting!
Tim

//********************
2008/12/18 John McCormack <john@easypeasy.co.uk>:
Tim,
On stepping through the code for DisplayObject3D to try and understand it,
I found that _target stayed as null at line 195:

Code: private  var _target:Number3D = Number3D.ZERO; // and nearby lines

It should be
Code: private  var _target:Number3D = *new *Number3D.ZERO;

_target stays as null, although when passed to a function later (on line
1201) it pass a value even though it shown _target to be null before and
after - the other variables such as _position  are proper (private)
references. These other variables, such as _position, do get set;

Is this an error?
A strange effect.

John

Original issue reported on code.google.com by Whistler...@gmail.com on 18 Dec 2008 at 4:15

GoogleCodeExporter commented 9 years ago
The absence of the "new" keyword doesn't seem to matter in these few line - 
probbaly
because the Number3D.ZERO function does this...
return new Number3D(0,0,0);
and so the new keyword is used.
So the problem seems to be a name clash with the _target protected variable in
CameraObject3D line #454.

Original comment by Whistler...@gmail.com on 18 Dec 2008 at 6:07

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I am tracing the code in
http://blog.zupko.info/?s=Dragging3D

In a call from Dragging3D, line 70, setting up the BasicView:
   DisplayObject3D line 196
   Inside Number3D.ZERO
   the instance id is @2eb8101
   _target stays as null after the call

DisplayObject3D line 1201
  _target is null but on tracing into
  _target.reset() it's instance id is seen to be @2eb8101

Conclusion:
In DisplayObject3D _target stays at null because of the protected _target (also 
null)
in CamerObject3D, line #454
_target is never set in CamerObject3D, line #374
The instance id makes it through the system anyway, surprisingly.

Original comment by Whistler...@gmail.com on 19 Dec 2008 at 9:04

GoogleCodeExporter commented 9 years ago

Original comment by neori...@gmail.com on 29 Dec 2008 at 5:06

GoogleCodeExporter commented 9 years ago
Its a name clash. Should be solved by making DO3D#_target a protected var and by
killing CameraObject3D#_target.
John, maybe its better if I take this on?

Original comment by tim.k...@gmail.com on 29 Dec 2008 at 6:00

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Should be fixed, can you verify too?

Original comment by tim.k...@gmail.com on 29 Dec 2008 at 6:07