Jump to content

Light.state = "on/ off"


Richard C
 Share

Recommended Posts

@Wingnut

I'm thinking you created this playground ..............

http://www.babylonjs-playground.com/#12BHLU#0

I am struggling to understand the light on/off logic. Can you briefly summarise how Light1.state = "on" works. State is a string and I can see the string is being changed in the action manager but I assume it in itself is not changing the lights but only serves as an indicator that the lights are off or on. I don't see the purpose. I cant find any documentation other than the description in the classes as to how it all functions. Is state only used for lights or can it be used to control action/properties of mesh too?

I think it would be useful to me if only I understood it !!!!!

I'd appreciate your help please.

cheers

RC.

Link to comment
Share on other sites

You're already speaking to the oracle.  @Temechon is VERY good at actionManagers... far better than I. 

This is not my playground, but you honor me by thinking I could program such a nice demo.   :) 

That is a Deltakosh demo, I suspect... where he was trying to utilize MANY actMan features... in a single playground demo.

I DO love it, though.  The actionManager is really quite excellent and fun.

 

As best I can tell, BABYLON.SetStateAction and BABYLON.StateCondition are specifically used for properties named .state.  Interesting, huh? 

I THINK that BABYLON.SetValueAction could be used, too.  It could change the value of a property named .state.

DK (deltakosh) has been known to say odd things like "state machine", sometimes.  I think SOME people around here... understand what that means.  I don't, except... somebody once told me that state machines are somewhat like "freeze cartridges" from Commodore 64 days.  A person could bootleg a commercial game... by "freezing" its "state" at game-startup point, and saving that "state"... to floppy.  :)  Essentially, it would save an IMAGE/ISO of the entire computer's memory and CPU "state".  Big gulp.  :)

I have a JS-based text adventure game "framework" that uses "session store" to save the JS object state.  It FEELS like an awkward way to "save game" but... it was easy to activate.  Maybe this same method can be used to quick-gulp an entire BJS scene, huh?   hmm.  But perhaps, the .state property is not pertinent to this... at all.  Wingnut speculation.  :)

 

Perhaps DK or others will teach us about "state", soon.  Also, look in the forum.  Search for "state" and "state machine" and things like that.  These "state rangers" (guys who talk about state machines) are here and might have done some talking.  I'm not sure what these guys have planned for "state machines"... but if you learn THAT, then it MIGHT answer WHY BABYLON.SetStateAction and BABYLON.StateCondition exist.  They might be for a SPECIAL future thing... involving the "State Rangers".

Meantime, keep listening to Temechon and others, here, RC.  And trust yourself, too.  You're quickly becoming an expert in BJS!   Perhaps web-read about state machines... see if those make sense.  Then re-examine actionManagers, and then come teach us everything you learn, okay?  :)  I see a very bright future for you, RC!

I am most-interested in WHY ".state" would be a "special purpose property", if indeed it is.  What makes the .state property so special, that it gets special .setStateAction and .stateCondition tools? 

Sherlock Holmes:  "I think there is a secret room behind this bookcase, Watson."  :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...