WaterPlane - LuisAntonRebollo/Torque-3D-Wiki-Test GitHub Wiki

<SCRIPT SRC="../../../include/tutorial.js" LANGUAGE="JavaScript"></SCRIPT> <SCRIPT SRC="../../../include/prototype.js" LANGUAGE="JavaScript"></SCRIPT> <SCRIPT SRC="../../../include/scriptaculous.js" LANGUAGE="JavaScript"></SCRIPT> <SCRIPT SRC="../../../include/glossaryLookUp.js" LANGUAGE="JavaScript"></SCRIPT> <SCRIPT SRC="../../../include/referenceLookUp.js" LANGUAGE="JavaScript"></SCRIPT> <SCRIPT SRC="../../../include/component.js" LANGUAGE="JavaScript"></SCRIPT> <SCRIPT SRC="../../../include/componentContainer.js" LANGUAGE="JavaScript"></SCRIPT> <SCRIPT>DocImagePath = "../../../";</SCRIPT> <script> // this script chunk is to update the ToC to the current doc and expand it pageID = 93; parent.leftFrame.expandToItem('tree2', 'doc93'); var element = parent.leftFrame.document.getElementById('doc93'); if((element) && (element.className==parent.leftFrame.nodeClosedClass)) { element.className = parent.leftFrame.nodeOpenClass } ; </script> <title>Torque 3D World Editor - WaterPlane</title> <script type="text/javascript" src="../../../include/wz_tooltip.js"></script>
    <table border="0" cellpadding="15" cellspacing="0" width="700">
      <tbody>
        <tr>
          <td width="700"><table id="toc" summary="Contents">
              <tbody>
                <tr>
                  <td><div id="toctitle">
                      <h2>Contents</h2>
                      
                    <ul>
                      <li class="toclevel-1"><a href="#Introduction"><span class="tocnumber">1</span> <span class="toctext">Introduction</span></a></li>
                      <li class="toclevel-1"><a href="#Adding_a_WaterPlane"><span class="tocnumber">2</span> <span class="toctext">Adding a WaterPlane</span></a></li>
                      <li class="toclevel-1"><a href="#Properties"><span class="tocnumber">3</span> <span class="toctext">Properties</span></a></li>
                      <li class="toclevel-1"><a href="#Conclusion"><span class="tocnumber">4</span> <span class="toctext">Conclusion</span></a></li>
                    </ul></td>
                </tr>
              </tbody>
            </table>
            <a name="Introduction" id="Introduction"></a>
            <h2> <span class="mw-headline">Introduction</span></h2>
            <p>Like a WaterBlock, the WaterPlane object can add realism to the  environment of your level. However, the WaterPlane is an infinite body of water with an adjustable height. The moment you add this object to your scene, everything below the height of the WaterPlane will be submerged, similarly to a WaterBlock, but the Water Plane has no edges. </p>
            <br />
            <a name="Adding_a_WaterPlane" id="Adding_a_WaterPlane"></a>
            <h2> <span class="mw-headline">Adding a WaterPlane</span></h2>
            <p>To add a Water Plane, select the Library tab in the Scene Tree Panel. Select the Level tab and double-click the Environment folder. Locate the WaterPlane object.</p>
            <p><br />
              <img alt="Image:WPLibrary.jpg" src="images/WPLibrary.jpg" border="0" width="206" height="303" /> </p>
            <p><br />
            Double-click the WaterPlane entry. the Create Object dialog window will appear. </p>
            <p><br />
              <img alt="Image:AddWaterPlane.jpg" src="images/AddWaterPlane.jpg" border="0" width="255" height="114" /> </p>
            <p><br />
            Enter a name for your Water Plane, then click the Create New button. A new Water Plane will be added to your scene. If your entire screen fills up with a dark blue or black color, this means the WaterPlane was placed above your camera so that your camera is underwater. Just move your camera up to get out of the water.</p><br />
            <p><i>(click to enlarge)</i> </p>
            <a href="images/WaterPlaneAdded.jpg" class="livethumbnail"><img src="images/WaterPlaneAdded.jpg" width="320" height="247" largewidth="640" largeheight="495" /></a><br />
            <p><br />This is typical if your objects are set to drop at or above your camera in the Object > Drop Location sub-menu. </p>
            <a name="Properties" id="Properties"></a>
            <h2> <span class="mw-headline">WaterPlane Properties</span></h2>
            <p>Additional properties can be changed with the Inspector pane and are identical to what you will find in a WaterBlock. To change a WaterPlanes properties using the Inspector Pane, click the Scene tab, then click the name of your new Water Plane object. The Inspector pane will update to display the current properties of your new WaterPlane.</p>

            <p><br /><img src="images/WaterPlaneInspector.png" width="208" height="1460" /></p>
            <p><br /><b>Name:</b> <i>TypeName</i>. Optional global name of this object.</p>
            <p><br /><b>id:</b> <i>TypeCaseString</i>. SimObjectId of this object. Read Only.</p>
            <p><br /><b>Source Class:</b> <i>TypeCaseString</i>. Source code class of this object. Read Only.</p>
            <h4>Transform</h4>
            <p><br /><b>position:</b> <i>MatrixPosition</i>. Object world position.</p>
            <h4>WaterPlane</h4>
            <p><br /><b>gridSize:</b> <i>TypeF32</i>. Duplicate of gridElementSize for backwards compatibility.</p>
            <p><br /><b>gridElementSize:</b> <i>TypeF32</i>. Spacing between vertices in the WaterPlane.</p>
            <h4>WaterObject</h4>
            <p><br /><b>density:</b> <i>TypeF32</i>. Affects buoyancy of an object, thus affecting the Z velocity of a player (jumping, falling, etc).</p>
            <p><br /><b>viscosity:</b> <i>TypeF32</i>. Affects drag force applied to an object submerged in this container.</p>
            <p><br /><b>liquidType:</b> <i>TypeRealString</i>. Liquid type of WaterPlane, such as water, ocean, lava. Currently only Water is defined and used.</p>
            <p><br /><b>baseColor:</b> <i>TypeColorI</i>. Changes color of water fog, which is what gives the water its color appearance.</p>
            <p><br /><b>fresnelBias:</b> <i>TypeF32</i>. Extent of fresnel affecting reflection fogging.</p>
            <p><br /><b>fresnelPower:</b> <i>TypeF32</i>. Measures intensity of affect on reflection based on fogging.</p>
            <p><br /><b>specularPower:</b> <i>TypeName</i>. Power used for specularity on the 
                water surface (sun only).</p>
            <p><br /><b>specularColor:</b> <i>TypeColorF</i>. Color used for specularity on the 
                water surface (sun only).</p>
            <p><br /><b>emissive:</b> <i>TypeBool</i>. When true, the water colors do not react 
                to changes in environmental lighting.</p>
            <h4>Waves (vertex undulation)</h4>
            <p><br /><b>overallWaveMagnitude:</b> <i>TypeF32</i>. Master variable affecting entire body of water undulation.</p>
            <p><br /><b>rippleTex:</b> <i>TypeImageFilename</i>. Normal map used to simulate small surface ripples.</p>
            <h4>Ripples (texture undulation)</h4>
            <p><br /><b>overallRippleMagnitude:</b> <i>TypeF32</i>. Master variable affecting 
                the entire surface of the waterplane.</p>
            <p><br /><b>foamTex:</b> <i>TypeImage Filename</i>. Diffuse texture for foam in 
                shallow water (advanced lighting only).</p>
            <h4>Foam</h4>
            <p><br /><b>overalFoamOpacity:</b> <i>TypeF32</i>. Opacity of foam texture.</p>
            <p><br /><b>foamMaxDepth:</b> <i>TypeF32</i>. Maximum depth for foam texture 
                display.</p>
            <p><br /><b>foamAmbientLerp:</b> <i>TypeF32</i>. Interpolation for foam settings.</p>
            <p><br /><b>foamRippleInfluence:</b> <i>TypeF32</i>. Intensity of the ripples.</p>
            <h4>Reflect</h4>
            <p><br /><b>cubemap:</b> <i>TypeCubemapName</i>. Cubemap is used instead of 
                reflection texture if fullReflect is off.</p>
            <p><br /><b>fullReflect:</b> <i>TypeBool</i>. Enables dynamic reflection rendering.</p>
            <p><br /><b>reflectivity:</b> <i>TypeF32</i>. Overall reflectivity of the water 
                surface.</p>
            <p><br /><b>reflectPriority:</b> <i>TypeF32</i>. Affects the sort order of reflected 
                objects.</p>
            <p><br /><b>reflectMaxRateMs:</b> <i>TypeF32</i>. Affects the sort time of reflected 
                objects.</p>
            <p><br /><b>reflectDetailAdjust:</b> <i>TypeF32</i>. Scale up or down the detail 
                level for objects rendered in a reflection.</p>
            <p><br /><b>reflectNormalUp:</b> <i>TypeBool</i>. Always use Z up as the reflection 
                normal.</p>
            <p><br /><b>useOcclusionQuery:</b> <i>TypeBool</i>. Turn off reflection rendering 
                when occluded (delayed).</p>
            <p><br /><b>reflectTexSize:</b> <i>TypeF32</i>. Texure size used for reflections 
                (square).</p>
            <h4>Underwater Fogging</h4>
            <p><br /><b>waterFogDensity:</b> <i>TypeF32</i>. Intensity of underwater fogging.</p>
            <p><br /><b>waterFogDensityOffset:</b> <i>TypeF32</i>. Delta, or limit, applied to 
                waterFogDensity.</p>
            <p><br /><b>wetDepth:</b> <i>TypeF32</i>. The depth in world units at which full 
                darkening will be received giving a wet appearance.</p>
            <p><br /><b>wetDarkening:</b> <i>TypeF32</i>. The refract color intensity scaled at 
                wetDepth.</p>
            <h4>Misc</h4>
            <p><br /><b>depthGradientTex:</b> <i>TypeImage filename</i>. 1D texture defining the 
                base water color.</p>
            <p><br /><b>depthGradientMax:</b> <i>TypeF32</i>. Depth in world units, the max 
                range of the color gradient texture.</p>
            <h4>Distortion</h4>
            <p><br /><b>distortStartDist:</b> <i>TypeF32</i>. Determines start of distortion 
                effect where water surface intersects.</p>
            <p><br /><b>distortEndDist:</b> <i>TypeF32</i>. Max distance that distortion 
                algorithm is performed.</p>
            <p><br /><b>distortFullDepth:</b> <i>TypeF32</i>. Determines the scaling down of 
                distortion in shallow water.</p>
            <h4>Basic Lighting</h4>
            <p><br /><b>clarity:</b> <i>TypeF32</i>. Relative opacity or transparency of the 
                water surface.</p>
            <p><br /><b>underwaterColor:</b> <i>TypeColor</i>. Changes the color shading of 
                objects beneath the water surface.</p>
            <h4>Sound</h4>
            <p><br /><b>soundAmbience:</b> <i>TypeSFXAmbienceName</i>. Ambient sound environment 
                when listener is active.</p>
            <h4>Editing</h4>
            <p><br /><b>isRenderEnabled:</b> <i>TypeBool</i>. Toggles whether the object is 
                rendered.</p>
            <p><br /><b>isSelectionEnabled:</b> <i>TypeBool</i>. Toggle whether this object can 
                be selected in the editor.</p>
            <p><br /><b>hidden:</b> <i>TypeBool</i>.Toggle visibility in editor.</p>
            <p><br /><b>locked:</b> <i>TypeBool</i>. Toggle whether the object can be edited.</p>
            <h4>Mounting</h4>
            <p><br /><b>mountPID:</b> <i>TypePID</i>. Unique identifier of the mount.</p>
            <p><br /><b>mountNode:</b> <i>TypeS32</i>. Node where the mount occurs.</p>
            <p><br /><b>mountPos:</b> <i>TypeS32</i>. Offset for positioning the node.</p>
            <p><br /><b>mountRot:</b> <i>TypeS32</i>. Rotation of this object in relation to 
                the mount node.</p>
            <h4>Object</h4>
            <p><br /><b>internalName:</b> <i>TypeString</i>. Non-unique name used by child objects 
                of a group.</p>
            <p><br /><b>parentGroup:</b> <i>TypeString</i>. Group object belongs to.</p>
            <p><br /><b>class:</b> <i>TypeString</i>. Links object to script class namespace.</p>
            <p><br /><b>superClass:</b> <i>TypeString</i>. Links object to script super class 
                (parent) namespace.</p>
            <h4>Persistence</h4>
            <p><br /><b>canSave:</b> <i>TypeBool</i>. Toggle whether the object can be saved in 
                the editor.</p>
            <p><br /><b>canSaveDynamicFields:</b> <i>TypeBool</i>. True if dynamic fields (added at runtime) should be saved, defaults to true.</p>

            <br />
            <a name="Conclusion" id="Conclusion"></a>
            <h2> <span class="mw-headline">Conclusion</span></h2>
            <p>The relationship between WaterBlock and WaterPlane is simple. Both are similar objects with the same properties. However, WaterBlocks are for isolated bodies of water anda  WaterPlane is for an endless ocean.</p>
            <p>&nbsp;</p>
            <p>For a full walkthrough, read the <a href="../Tutorials/AddingLake.html">Lake Tutorial</a> to learn how the WaterBlock and WaterPlane properties affect appearance as the properties are the same.</p>
           
              </td>
        </tr>
      </tbody>
    </table>
Home Back to Top
<script type="text/javascript">

var links = document.getElementsByTagName('a');

for (var i = 0; i < links.length; i++) if (links[i].className == 'livethumbnail') { var img = links[i].getElementsByTagName('img')[0]; img.state = 'small'; img.smallSrc = img.getAttribute('src'); img.smallWidth = parseInt(img.getAttribute('width')); img.smallHeight = parseInt(img.getAttribute('height')); img.largeSrc = links[i].getAttribute('href'); img.largeWidth = parseInt(img.getAttribute('largewidth')); img.largeHeight = parseInt(img.getAttribute('largeheight')); img.ratio = img.smallHeight / img.smallWidth; links[i].onclick = scale; }

function scale() { var img = this.getElementsByTagName('img')[0]; img.src = img.smallSrc;

if (! img.preloaded)
{
	img.preloaded = new Image();
	img.preloaded.src = img.largeSrc;
}

var interval = window.setInterval(scaleStep, 10);
return false;

function scaleStep()
{
	var step = 45;
	var width = parseInt(img.getAttribute('width'));
	var height = parseInt(img.getAttribute('height'));
	
	if (img.state == 'small')
	{
		width += step;
		height += Math.floor(step * img.ratio);
		
		img.setAttribute('width', width);
		img.setAttribute('height', height);
		
		if (width > img.largeWidth - step)
		{
			img.setAttribute('width', img.largeWidth);
			img.setAttribute('height', img.largeHeight);
			img.setAttribute('src', img.largeSrc);
			window.clearInterval(interval);
			img.state = 'large';
		}
	}
	else
	{
		width -= step;
		height -= Math.floor(step * img.ratio);

		img.setAttribute('width', width);
		img.setAttribute('height', height);
		
		if (width < img.smallWidth + step)
		{
			img.setAttribute('width', img.smallWidth);
			img.setAttribute('height', img.smallHeight);
			img.src = img.smallSrc;
			window.clearInterval(interval);
			img.state = 'small';
		}
	}
}			

}

</script>
⚠️ **GitHub.com Fallback** ⚠️