Skip to content

Commit

Permalink
fix visible docs
Browse files Browse the repository at this point in the history
  • Loading branch information
guycalledfrank committed Jun 8, 2016
1 parent 6b72f0c commit 6945d70
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 23 deletions.
28 changes: 6 additions & 22 deletions src/framework/components/model/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -590,22 +590,22 @@ pc.extend(pc, function () {
* @function
* @name pc.ModelComponent#hide
* @description Stop rendering model without removing it from the scene hierarchy.
* This method sets the {@link pc.MeshInstance#hidden} property of every MeshInstance in the model to false
* This method sets the {@link pc.MeshInstance#visible} property of every MeshInstance in the model to false
* Note, this does not remove the model or mesh instances from the scene hierarchy or draw call list.
* So the model component still incurs some CPU overhead.
* @example
* this.timer = 0;
* this.hidden = false;
* this.visible = true;
* // ...
* // blink model every 0.1 seconds
* this.timer += dt;
* if (this.timer > 0.1) {
* if (this.hidden) {
* if (!this.visible) {
* this.entity.model.show();
* this.hidden = false;
* this.visible = true;
* } else {
* this.entity.model.hide();
* this.hidden = true;
* this.visible = false;
* }
* this.timer = 0;
* }
Expand All @@ -625,23 +625,7 @@ pc.extend(pc, function () {
* @function
* @name pc.ModelComponent#show
* @description Enable rendering of the model if hidden using {@link pc.ModelComponent#hide}.
* This method sets all the {@link pc.MeshInstance#hidden} property on all mesh instances to true.
* @example
* this.timer = 0;
* this.hidden = false;
* // ...
* // blink model every 0.1 seconds
* this.timer += dt;
* if (this.timer > 0.1) {
* if (this.hidden) {
* this.entity.model.show();
* this.hidden = false;
* } else {
* this.entity.model.hide();
* this.hidden = true;
* }
* this.timer = 0;
* }
* This method sets all the {@link pc.MeshInstance#visible} property on all mesh instances to true.
*/
show: function () {
var model = this.data.model;
Expand Down
2 changes: 1 addition & 1 deletion src/scene/mesh.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ pc.extend(pc, function () {
* mesh instance.
* @property {Boolean} castShadow Controls whether the mesh instances casts shadows.
* Defaults to false.
* @property {Boolean} hidden Disable rendering for this mesh instance. Use hidden property to disable rendering without overhead of removing from scene.
* @property {Boolean} visible Enable rendering for this mesh instance. Use visible property to enable/disable rendering without overhead of removing from scene.
* But note that the mesh instance is still in the hierarchy and still in the draw call list.
* @property {Number} layer The layer used by this mesh instance. Can be:
* <ul>
Expand Down

0 comments on commit 6945d70

Please sign in to comment.