Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi Niko, Forgive me but I thought that my topic is gone unnoticed so I publish it again. You told me I could use the functions contained in CC by simply calling. But the program I use (EWB) asks me to declare the class containing these functions. What the name of CC's class that contain these functions ? ********* EWB syntax : external TTestObject = class public function Sum(A, B: Integer): Integer; property Title: String read; end; |
||||
|
Ah, sorry, I somehow overlooked that. In the CC JavaScript API, there are no classes, there are just the global functions listed in the JavaScript reference API from the docs. Also, JavaScript actually don't have any classes, so I guess they mean function objects with that? |
||||
|
Niko, I asked Tim Young (EWB team) in this message and he answered : http://www.elevatesoft.com/forum... Eric |
||||
|
Yes, CopperCube uses JavaScript as it is: a dynamic language. Parameters passed to and returned from functions maybe of different types, for example sometimes a string, sometimes a number, depending on context. |
||||
|
So you say that every CC's functions arguments and returned values are numbers (integers or floats) or Strings. Nothing else, no objects, no records, no structured data. So, for example, the function ccbGetRootSceneNode() wich is said to Returns the root scene node, returns a simple string (the name of the node) ? |
||||
|
No, it depends on the function. Sometimes it also returns objects, like when you are querying for a object. (like you said, in ccbGetRootSceneNode) :) |
||||
|
Ok Niko, and since you did not tell me earlier where to find the defintions of these objects (node &8203;&8203;etc..) I guess you want to keep it secret ... I hope I am wrong and if this is the case can you help me ? |
||||
|
It's not a secret. You can view the I source anyway, as I also wrote to you via mail, you could use the CopperLicht SDK (functions in there are a bit less compressed) and pretty print the source, to see the details better. Also, all the functions are clearly documented in the documentation. I think the real problem is that you are using a tool which expects statically typed functions in defined classes, and CopperCube is using dynamically typed parameters and return types, added into the global window class. This won't probably work together, so maybe you are just using a tool which isn't probably suited for that job. |
||||
|
Ok Niko, I'll see that question of static or dynamic function with Tim. It seem to be a big work to build a bridge between EWB and CC. But suppose I succeed, don't you thinck it would be a great thing for CC ? EWB's users would be able to CC to draw nice 3D scene. EWB and CC may have nice financials returns too ... |
||||
|
Might be, I'm not familiar with EWB unfortunately. Sure, if you make this work, it would be nice for both EWB and CopperCube, I guess :) |
||||
|
Humm I downloaded CopperLicht SDK and inspect copperlight.js ... Maybe it is less compressed, but still very hard to understand or use to solve my problem ...CopperLicht SDK 1.7 commercial version is uncompressed but cost 99 euros; So I'm standing in front of a problem : Buying uncompressed version of copperlight.js while being not sure it will serve my cause ... |
||||
|
Well, even the full source won't help you more which what you want to do. The documentation basically tells you everything you need to know. |
||||
|
In that code sequence : var s = ccbGetSceneNodeFromName("cubeMesh1"); var position = ccbGetSceneNodeProperty(s, "Position"); ********** Var s seems to be an object called a "node". But how does this object is declared ? For example : NODE = {X : 0, Y : 0,Z : 0, AlphaX : 0,AlphaY : 0,AlphaZ : 0}; How can I use ccbGetSceneNodeFromName function externally if I can't inform EWB of how ccbGetSceneNodeFromName 's returned value (a node if I'm right) is structured ? I must declared node object structure in EWB ! |
||||
|
There is actually no declaration of this object. It is just a handle, and you should treat it like that. In the WebGL part, it is a function derived from CL3D.SceneNode (http://www.ambiera.com/copperlic...), but on other platform, it is something different, like an ID, or a string describing the object. So that's why this isn't documented, it is just a handle so the API can identify the object you mean. |
||||
|
Ok, I see. In Delphi a windows handle (for example) is a LongInt (64 bits integer). Everytime I use a handle (for a thread, a windows or anything else) it homegeneous to something an integer (long or small) or a string (or a pointer, wich is an integer). I will try to see what a node handle is homogenous to. |
|