Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
Bug in the 3D Software or Mystery

3dnoob
Registered User
Quote
2018-08-15 17:14:48

Why don't I get the Y-value.

Test: (y is 0, but should have a value.)

https://workupload.com/file/GSZm...



var LevPosX = new Array();
var LevPosY = new Array();
var LevelWall = new Array();

var outPos;

//….other code

//CreateCube !!!
sourceNode = ccbGetSceneNodeFromName("wall0");
newscenenode = ccbCloneSceneNode(sourceNode);
ccbSetSceneNodeProperty(newscenenode, "Position", -y, 0, -x);
LevelWall[t-1] = newscenenode;

//….other code


for (var q = 0; q <= 441; q++)
{
outPos = ccbGetSceneNodeProperty(LevelWall[q], "Position");
LevPosX[q] = outPos.z; //I get this value
LevPosY[q] = outPos.x; //I don't get that value!!! (BUG!)
}





3dnoob
Registered User
Quote
2018-08-15 17:55:30

This works:


print("Y-Pos: "+LevPosX[ty]); //Why LevPosX and not LevPosY ?
print("X-Pos: "+LevPosX[tx]);


And that also confirms the bug!

"CopperCube " has a problem with dynamic JavaScript arrays..

The memory area will overlap.

Or do I make a mistake in thinking ?


niko
Moderator
Quote
2018-08-17 08:10:22

Generally speaking: CopperCube shouldn't have any problem with dynamic JavaScript arrays, it is using the JavaScript engine from Firefox, which is quite tested.

I'm not exactly sure what bug you are describing, especially not with the .ccb file which contains a lot of JavaScript code and I'm not sure where I should be looking at. Could you describe it a bit more exactly what you mean? Or a small test case where the problem you have happens?


3dnoob
Registered User
Quote
2018-08-17 09:35:00

Sorry!
It has nothing to do with the dynamic JavaScript arrays.

The Bug is here:
outPos = ccbGetSceneNodeProperty(LevelWall[q], "Position");
LevPosX[q] = outPos.z; //I get this value
LevPosY[q] = outPos.x; //I don't get that value!!! (BUG!)

outPos.z contains all values. (also outPos.x)

If I use '"print (outPos) ", all values are output as Z-position.

But I give the values so on:

ccbSetSceneNodeProperty(newscenenode, "Position", -y, 0, -x);


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internat?onal" (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