Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > CopperCube Open discussion
Coppercube's class and functions

falcon12
Registered User
Quote
2013-11-20 20:53:07

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;


niko
Moderator
Quote
2013-11-21 07:44:06

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?


falcon12
Registered User
Quote
2013-11-28 14:21:51

Niko, I asked Tim Young (EWB team) in this message and he answered :

http://www.elevatesoft.com/forum...



Eric


niko
Moderator
Quote
2013-11-29 07:40:01

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.


falcon12
Registered User
Quote
2013-11-29 19:30:07

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) ?


niko
Moderator
Quote
2013-12-01 21:53:43

No, it depends on the function. Sometimes it also returns objects, like when you are querying for a object. (like you said, in ccbGetRootSceneNode) :)


falcon12
Registered User
Quote
2013-12-02 16:46:57

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 ?


niko
Moderator
Quote
2013-12-03 05:30:34

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.


falcon12
Registered User
Quote
2013-12-03 11:53:48

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 ...






niko
Moderator
Quote
2013-12-04 07:50:50

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 :)


falcon12
Registered User
Quote
2013-12-15 19:55:10

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 ...


niko
Moderator
Quote
2013-12-16 21:13:59

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.


falcon12
Registered User
Quote
2013-12-16 22:03:26

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 !


niko
Moderator
Quote
2013-12-17 06:05:26

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.


falcon12
Registered User
Quote
2013-12-17 15:39:35

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.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "In?ernational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact