Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Shadows to ModelInstanceCollection #4341

Merged
merged 5 commits into from Sep 20, 2016

Conversation

HeercoGrond
Copy link

This is a possible solution for Issue #4340.

This is a possible solution for Issue CesiumGS#4340.
@lilleyse
Copy link
Contributor

Thanks for the pull request! Can you send over a CLA so we can merge this? You can find instructions in CONTRIBUTING.md

@@ -72,6 +72,7 @@ define([
* @param {Boolean} [options.asynchronous=true] Determines if model WebGL resource creation will be spread out over several frames or block until completion once all glTF files are loaded.
* @param {Boolean} [options.debugShowBoundingVolume=false] For debugging only. Draws the bounding sphere for the collection.
* @param {Boolean} [options.debugWireframe=false] For debugging only. Draws the instances in wireframe.
* @param {ShadowMode} [options.shadows] Determines the shadowmode to be used for the Models.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For organization purposes can you place this right after the options.asynchronous line. Also consider rewording the description to match Model.js, but change 'model' to 'collection'.

* @param {ShadowMode} [options.shadows=ShadowMode.ENABLED] Determines whether the model casts or receives shadows from each light source.

@@ -131,6 +132,7 @@ define([
this._gltf = options.gltf;
this._basePath = options.basePath;
this._asynchronous = options.asynchronous;
this._shadows = option.shadows;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would also be nice to make shadows settable whenever. Add a getter/setter shadows property to the defineProperties section that sets _model.shadows.

@@ -131,6 +132,7 @@ define([
this._gltf = options.gltf;
this._basePath = options.basePath;
this._asynchronous = options.asynchronous;
this._shadows = option.shadows;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be options.shadows.

Changed a typo, changed position of some lines to adhere to consistency and added a getter/setter property shadows for the active model within the ModelInstanceCollection to edit shadows in runtime instead of only on creation.
@HeercoGrond
Copy link
Author

Already, commited a new version with the proposed changes (the getter/setter property being quite the useful one, I only thought on the basic level.). Regarding the CLA, I hope it'll be filled in soon. (I am not in a position to make that).

If any problems are found I'll happily edit them. Unfortunately our timezones are a bit apart so it might take a while.

Copy link
Contributor

@lilleyse lilleyse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just these few new comments.

@@ -165,6 +167,12 @@ define([
return this._readyPromise.promise;
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comma at the end of the readyPromise block and remove the empty line

shadows : {
get : function () {
return this._model.shadows;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should also add a set function that sets this._model.shadows.

@@ -70,6 +70,7 @@ define([
* @param {Boolean} [options.show=true] Determines if the collection will be shown.
* @param {Boolean} [options.allowPicking=false] When <code>true</code>, each glTF mesh and primitive is pickable with {@link Scene#pick}.
* @param {Boolean} [options.asynchronous=true] Determines if model WebGL resource creation will be spread out over several frames or block until completion once all glTF files are loaded.
* @param {ShadowMode} [options.shadows=ShadowMode.ENABLED] Determines whether the model casts or receives shadows from each light source.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change 'model' to 'collection'.

@HeercoGrond
Copy link
Author

Updated it again.

@pjcozzi
Copy link
Contributor

pjcozzi commented Sep 20, 2016

We have a CLA from @HeercoGrond. Thanks again for the contribution!

return this._model.shadows;
}
set : function () {
this._model.shadows = shadows;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After closer review I noticed that setting the shadows dynamically is actually more involved that setting the model's shadow property. Would you mind removing this getter/setter for now? I'll be happy to merge the rest of the changes and should have a different PR open soon.

@HeercoGrond
Copy link
Author

Removed the Getter/Setter Property for shadows. Hope for now the base of it all is done.

@lilleyse
Copy link
Contributor

Looks good! Thanks @HeercoGrond.

@lilleyse lilleyse merged commit 6bec60d into CesiumGS:3d-tiles Sep 20, 2016
@lilleyse
Copy link
Contributor

Can you also add your company and yourself to CONTRIBUTORS.md under the Corporate CLA section? Please open another pull request for that, I merged this one too soon...

HeercoGrond pushed a commit to HeercoGrond/cesium that referenced this pull request Sep 21, 2016
Per Request - Added our Organization details and my name to Contributors.md
lilleyse added a commit that referenced this pull request Sep 21, 2016
Update with credentials (see #4340 and #4341)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants