Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > CopperCube Open discussion
I'm sure you all know this already

j9907
Registered User
Quote
2020-01-01 15:05:48

You guys probably knew fog could be disabled (and enabled) dynamically at runtime. I tried this out of curiosity after I saw the "FogColor" parameter could be changed, so I decided to change the param name to "Fog". That works! Haha.

var root = ccbGetRootSceneNode();

ccbSetSceneNodeProperty(root, "Fog", false);


I'd guess FogDensity works too. I haven't tried it yet. Also: Obviously make sure to change it to true or false (depending on if you want to enable it or disable it)

Enjoy.


just_in_case
Moderator
Quote
2020-01-01 18:30:01

As far as i know you can change every attributes property of any node dynamically, you can change attributes of Root node, a 2D overlay, particle system , water, meshnode etc. every attribute can be changed dynamically.


j9907
Registered User
Quote
2020-01-02 12:46:04

Cool. Why this isn't mentioned in the documentation is beyond me!


niko
Moderator
Quote
2020-01-03 15:32:15

This works for all properties as displayed in the property window, with the exact name as displayed there. It's not documented because that only works in the Windows and MacOS targets. :)


Robo
Guest
Quote
2020-01-04 02:14:15

wrote:
Cool. Why this isn't mentioned in the documentation is beyond me!


I agree - I had to work this all out myself also and found the same.

I have a video with dynamic weather to see:
https://www.youtube.com/watch?v=7J3YqpNgIOI


j9907
Registered User
Quote
2020-01-04 05:47:20

wrote:
This works for all properties as displayed in the property window, with the exact name as displayed there. It's not documented because that only works in the Windows and MacOS targets. :)



Hmm. Is there any reason why certain things work fine on the desktop targets whereas on WebGL / Android they're not usable? It's weird in a way. Isn't the JS-related stuff universal regardless of the desired platform?


j9907
Registered User
Quote
2020-01-04 05:48:06

Robo wrote:
wrote:
Cool. Why this isn't mentioned in the documentation is beyond me!


I agree - I had to work this all out myself also and found the same.

I have a video with dynamic weather to see:
https://www.youtube.com/watch?v=7J3YqpNgIOI


I saw that. Most impressed! I recently devised a very nice (but also time-consuming) technique which allows me to use dynamic lights on levels which have shadows + normalmaps (with a slight caveat)


niko
Moderator
Quote
2020-01-04 06:45:42

wrote:
Is there any reason why certain things work fine on the desktop targets whereas on WebGL / Android they're not usable?


It's simply an implementation detail, and side effect. They are fundamentally different platforms, (like the WebGL platform is running itself in JavaScript, while this needs to be emulated in the Windows platform), so you have a lot of parts working differently internally, but trying to look like it's the same.

The property thing was a nice feature, so I didn't prevent it because you can obviously do very cool things with that.


srfstudio
Registered User
Quote
2020-01-05 18:09:11

On similar note, I'm trying to change 'FollowSmoothingSpeed' of the 3rd person camera during gameplay, so far I tried:
ccbSetSceneNodeProperty(ccbGetSceneNodeFromName("Camera1"), "FollowSmoothingSpeed", 5);
...but that didn't work, I guess because it's a property of a behavior and not property of a camera? I also tried treating 'FollowSmoothingSpeed' as a variable but that, of course, didn't work since it was really a long shot :)
Does anyone knows if this is possible, I mean it's possible because it is a property that can be tweaked in behavior, but can it be changed somehow during gameplay?


Create reply:


Posted by: (you are not logged in)


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