ParallelGraphics Forums
Cortona VRML Client
You are here: [Forums]::[Browsers]::[Cortona VRML Client]

Registration 
Registration
Forgot your password?

Help 
Help
Support

Quick search 

Subscribe to newsletters 

Install Cortona VRML Client for FREE!
Outline 3D
Try RobinZone!
email:  password:
   Browsers - Cortona VRML Client

Subject: USE-referenced node is copied by value ...
Sender: michaelusachov@mail.ru 3.01.08 00:46

A node referenced form another node by USE statement, is copied by value, when passed to eventIn of Script...
Thus, next code does not work. BS Contact and Octaga works fine...

#VRML V2.0 utf8

PROTO Signal [ exposedField SFBool processed FALSE ] {}
PROTO Wrapper [ field SFNode nodeRef NULL ] {}

DEF    S1 Signal {}
DEF    W1 Wrapper { nodeRef USE S1 }
DEF    Script1 Script {
    directOutput TRUE mustEvaluate TRUE
    eventIn    SFNode processSignal
    url "javascript:
        function processSignal ( v ) {
        // referenced node S1 is copied by value...
        v.nodeRef.processed = true;
        }
        "
    }

DEF    Script2 Script {
    directOutput TRUE mustEvaluate TRUE
    field    SFNode w USE W1
    field    SFNode s USE Script1
    eventIn    SFTime sendSignal
    url    "javascript:
        function sendSignal () {
        s.processSignal = w;
        print (w.nodeRef.processed);
        // Octaga prints 'true' and BS Contact - '1'
        }
        "
    }

DEF    PS ProximitySensor {
    size 1e36 1e36 1e36
    enabled    TRUE
    }

ROUTE PS.enterTime TO Script2.sendSignal

 


USE-referenced node is copied by value ... / michaelusachov@mail.ru / 3.01.08 00:46
     Re: USE-referenced node is copied by value ... / Uh / 8.01.08 23:36
         Re: USE-referenced node is copied by value ... / michaelusachov@mail.ru / 9.01.08 00:29
             Re: USE-referenced node is copied by value ... / Uh / 9.01.08 03:09
                 Re: USE-referenced node is copied by value ... / Uh / 9.01.08 03:16
                     Re: USE-referenced node is copied by value ... / michaelusachov@mail.ru / 9.01.08 09:31
                         Re: USE-referenced node is copied by value ... / nalex@parallelgraphics.com / 11.01.08 01:45

Messages in thread: 7


© 1998-2007 ParallelGraphics. All rights reserved. Terms of use.